apfl/src
Laria Carolin Chabowski c5fbd92f75 Various cleanup tasks, mostly simplifying the REPL
Instead of passing a flag through the parser and tokenizer for telling
the input source if we need further input or not, we steal a trick from
Lua: In the REPL, we just continue to read lines and append them to the
input, until the input was loaded with no "unexpected EOF" error. After
all, when we didn't expect an EOF is exactly the scenario, when we need
more input.

Doing things this way simplifies a bunch of places and lets us remove
the ugly source_reader and iterative_runner concepts.

To allow the REPL to see the error that happened during loading required
some smaller refactorings, but those were honestly for the better
anyway.

I also decided to get rid of the token_source concept, the parser now
gets the tokenizer directly. This also made things a bit simpler, also
I want to soon-ish implement string interpolation, and for that the
parser needs to do more with the tokenizer than just reading the next
token.

One last thing: This also cleans up the web playground and makes the
playground and REPL share a bunch of code. Nice!
2025-11-30 22:23:40 +01:00
..
functional-tests tokenizer: Add backtick delimited strings 2023-11-07 21:45:27 +01:00
alloc.c Grow resizables more than requested to avoid excessive alloocator calls 2024-01-14 16:29:55 +01:00
alloc.h alloc: Guard against multiplication overflow 2023-02-14 22:04:10 +01:00
alloc_test.c alloc: Guard against multiplication overflow 2023-02-14 22:04:10 +01:00
apfl.h Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
apflc.c Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
bytecode.c Fixing uninitialized vars etc found by building with -O2 2024-08-25 18:16:36 +02:00
bytecode.h gc: Tighter coupling to full context 2023-11-23 21:30:51 +01:00
CMakeLists.txt Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
compile.c compiler: Use correct put function for index 2025-11-18 23:31:46 +01:00
compile.h Define globals in apfl itself 2023-03-07 21:40:07 +01:00
context.c Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
context.h Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
encode.c Implement bytecode (de)serialization 2023-03-07 21:40:07 +01:00
encode.h apflc: Use an apfl_ctx for compilation 2023-11-23 21:03:40 +01:00
encode_test.c Implement bytecode (de)serialization 2023-03-07 21:40:07 +01:00
error.c Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
eval.c Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
expr.c Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
format.c Make line and column size_t 2023-02-16 21:41:02 +01:00
format.h Rename format => io_writer 2023-02-10 21:48:31 +01:00
functional-test-runner.c Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
gc.c gc: Remember position when searching for a free slot 2024-07-12 23:12:25 +02:00
gc.h gc: Tighter coupling to full context 2023-11-23 21:30:51 +01:00
globals.apfl Expose get-or-default as global 2024-05-23 23:41:38 +02:00
globals.c Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
globals.h apflc: Use an apfl_ctx for compilation 2023-11-23 21:03:40 +01:00
hashmap.c alloc: Guard against multiplication overflow 2023-02-14 22:04:10 +01:00
hashmap.h hashmap: Improve cursor / peek API 2022-04-11 23:31:20 +02:00
hashmap_test.c Fix NDEBUG builds 2023-07-03 23:45:43 +02:00
intrinsics.h Grow resizables more than requested to avoid excessive alloocator calls 2024-01-14 16:29:55 +01:00
io.c Implement bytecode (de)serialization 2023-03-07 21:40:07 +01:00
main.c Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
messages.c Implement global slice and splice functions 2023-10-26 21:31:27 +02:00
modules.c apflc: Use an apfl_ctx for compilation 2023-11-23 21:03:40 +01:00
modules.h apflc: Use an apfl_ctx for compilation 2023-11-23 21:03:40 +01:00
numparse.c tokenizer: Use same number parsing code as in tonumber 2023-09-04 14:04:40 +02:00
parser.c Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
parser_test.c Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
parsing.h tokenizer: Use same number parsing code as in tonumber 2023-09-04 14:04:40 +02:00
position.c Initial commit 2021-12-15 21:47:17 +01:00
re.apfl tokenizer: Add backtick delimited strings 2023-11-07 21:45:27 +01:00
re.c Fixing uninitialized vars etc found by building with -O2 2024-08-25 18:16:36 +02:00
registry.c Implement the registry and a agrv getter to test it 2023-03-31 21:31:07 +02:00
registry.h Implement the registry and a agrv getter to test it 2023-03-31 21:31:07 +02:00
repl.c Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
repl.h Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
resizable.c Grow resizables more than requested to avoid excessive alloocator calls 2024-01-14 16:29:55 +01:00
resizable.h gc+context: Make stack no longer a gc object 2022-07-01 22:40:43 +02:00
resizable_test.c Introduce allocator abstraction 2022-02-08 22:53:13 +01:00
scope.c Implement assigning into dictionaries 2022-11-19 23:26:52 +01:00
scope.h gc: Tighter coupling to full context 2023-11-23 21:30:51 +01:00
strings.c Fixing uninitialized vars etc found by building with -O2 2024-08-25 18:16:36 +02:00
strings.h Define globals in apfl itself 2023-03-07 21:40:07 +01:00
strings_test.c Implement a simple test runner for functional tests 2022-10-30 22:51:51 +01:00
stubs_for_apflc.c apflc: Use an apfl_ctx for compilation 2023-11-23 21:03:40 +01:00
symbols.c Implement symbol values 2023-03-23 23:44:54 +01:00
test.h alloc: Guard against multiplication overflow 2023-02-14 22:04:10 +01:00
token.c Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
tokenizer.c Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
tokenizer_test.c Various cleanup tasks, mostly simplifying the REPL 2025-11-30 22:23:40 +01:00
value.c Implement global slice and splice functions 2023-10-26 21:31:27 +02:00
value.h gc: Tighter coupling to full context 2023-11-23 21:30:51 +01:00