This avoids copying the string every time we pass it around. Not too
important right now, but will become important onve we're able to evaluate
more complex expressions.
This replaces the grow_cap function with the ensure_cap family of
functions, as they actually do what you want: You'll likely not want to
blindly increase the capacity of a growable, but you want to make sure that
the capacity is large enough to hold the elements you're about to insert.
It's really easy to accidentally pass an uninitialized string as dst into
the copy function, which will result in an free() call to an arbitrary
pointer. Maybe it's a better idea to not deinit the dst string before
copying? The documentation at least makes it more clear and the new
apfl_string_blank() function makes it easy to create an empty string.
With the varargs approach that was used before, it was very easy to add a
list item of the wrong type, which would (hopefully) result in an assertion
violation, because va_arg() then read some senseless data.
A useful source reader implementation to pass in a source saved as an
in-memory string into the tokenizer.
This replaces the string_src_reader in the tokenizer_test and is even a bit
more flexible, by allowing any aplf_string_view as the source.
- Simplify return types: Many functions that returned
`enum parse_fragment_result` only ever returned PF_OK or PF_ERROR.
Changing these functions to return bool simplifies things a lot. This
also helped in identifying some places where I didn't handle all
parse_fragment_result values properly.
- More cleaning up
- Allow linebreaks inside parenthesis
During development on the parser I got a "malloc(): corrupted top size"
error in the tokenizer when parsing `a=a`. I wrote this test to see if it
was really a problem with the tokenizer. It wasn't, lets keep the test
nontheless.