Commit graph

10 commits

Author SHA1 Message Date
97f5986781 Implement tonumber 2023-07-03 23:52:49 +02:00
4d01f20d6e Implement first try of a module system
Very much inspired by lua, as so often: The module system maintains a list
of searchers that will be called with the requested module name. They can
then return a loader function, which will then be called again with the
module name. That loader then returns the actual module, which is then
cached. We also add a goofy "foo" module in main.c to test this.
2023-07-03 23:45:43 +02:00
c07caa9aa2 Implement the registry and a agrv getter to test it
The registry is a global dictionary accessible from C that stores arbitrary
apfl values.
2023-03-31 21:31:07 +02:00
370fb89367 Add / rename functions for loading other sources 2023-03-30 20:51:30 +02:00
0e9f8ae0ee Implement global ++/-- functions 2023-03-29 22:36:38 +02:00
e31dc3d585 Add global raise function 2023-03-29 22:35:08 +02:00
1cff056e53 Implement symbol values 2023-03-23 23:44:54 +01:00
2e7fefc7f7 Implement some string manipulation functions 2023-03-07 21:57:04 +01:00
1634b9439b Implement for / loop / [k]each loops 2023-03-07 21:40:07 +01:00
25c872f4ee Define globals in apfl itself
We're now first building a standalone bytecode compiler `apflc` that will
compile `globals.apfl` into bytecode and write it out as a C source file.
When initializing a new context, that embedded bytecode will then get
evaluated and the global scope will be populated from the dictionary
returned by that bytecode.
2023-03-07 21:40:07 +01:00