Commit graph

15 commits

Author SHA1 Message Date
63d64b0778 Add regex module "re"
This uses the PCRE2 library to implement regexes in apfl
2023-07-03 23:53:09 +02:00
1650a8f8be Fix NDEBUG builds 2023-07-03 23:45:43 +02: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
e0881c558c strings+io: Make chars unsigned 2023-02-13 22:31:18 +01:00
01dfec2e32 Make playground usable on mobile 2023-02-10 21:48:31 +01:00
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
bd19f689b9 Add backtraces to errors 2023-01-28 21:44:56 +01:00
5e9ac36a39 Get rid of fatal errors and report allocation error directly 2023-01-13 22:54:06 +01:00
5b4ac67de9 Make APFL_ERR_INPUT_ERROR non fatal
For two reasons:

- We'll later want apfl code to load other apfl code. If an IO error
  happens in that case, we don't want that to be a fatal error, only a
  regular error that can be catched in apfl (once we have something like
  `try`).
- I want to get rid of fatal errors as a generic category completely.
  Instead the error reporting functions themselves should tell you the type
  of error directly, if it was something fatal.
2022-12-08 22:10:18 +01:00
4ecfeabded main+playground: Don't print nil values in repl
This makes the output of `print` in the repl nicer :)
2022-10-30 22:51:51 +01:00
62e859638e Fix web playground includes 2022-10-30 21:21:40 +01:00
fa4ed7bf83 Abstract away stdout
Instead of using stdout directly, we're now using a configurable
apfl_format_writer.
2022-10-30 21:21:40 +01:00
3aabadbf6d Switch to CMake 2022-09-16 23:04:20 +02:00
8d947244c9 Implement exceptions-like error handling
Most functzions will no longer return an enum apfl_result, but will raise
an error that bubbles up.
2022-06-26 16:06:14 +02:00
2c04e57a0c Implement a simple web playground REPL with emscripten 2022-06-05 22:31:02 +02:00