Commit graph

7 commits

Author SHA1 Message Date
55c95f99ad Rename format => io_writer
To make it clearer that this can be used for writing binary data too.
2023-02-10 21:48:31 +01:00
dd580a1519 Improve a bunch of error messages 2023-01-24 21:30:05 +01:00
4f9a33628c Implement first global function "print"
This introduces the globals and moves some previously non-public functions
into apfl.h.
2022-07-12 22:13:07 +02:00
09f7df79bb apfl_debug_print_val: Use format writer abstraction 2022-06-05 22:06:33 +02:00
a4fd3acfac Use formatter for expr printing 2022-04-22 22:52:53 +02:00
0f6f136873 Push formatted parser error on stack during evaluation
This way we can see the parse errors again in evaluation mode

Not fully fleshed out yet: We simply use apfl_debug_print_val to dump the
top of the stack (the formatted error) to stderr but don't nicely handle
if there is nothing on the stack (apfl_debug_print_val will print a rather
cryptic "stack index invalid" error). Also the whole dance we need to do to
put the formatted error onto the stack feels rather awkward (there should
probably a function for this) and we also should probably try to push an
error description on the stack in case this moving-string-to-stack business
fails.

Now "only" all other errors need to be put on the stack as a string :)
2022-04-21 22:55:11 +02:00
f8bab311d7 Add formatter abstraction for errors
This will allow us to format errors as strings later by implementing a
different format writer.
2022-04-21 22:14:37 +02:00