Commit graph

6 commits

Author SHA1 Message Date
145fcddbed format: Use %G to print numbers
This avoids appending .000[...] on integer numbers
2022-10-30 22:51:51 +01:00
1a41df2389 format: Don't try (and fail) to write an empty buffer
We failed at dumping empty strings, because the file writer reported 0
bytes written as an error. Let's just not write empty buffers in the first
place, this fixes the bug and also avoids some pointless function calls.
2022-07-14 21:51:41 +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