Commit graph

14 commits

Author SHA1 Message Date
e4f2053ca6 Fix apfl_join_strings manipulating the parts list 2022-11-26 23:06:55 +01:00
e8a92a18b4 Implement functions for concatenating strings 2022-11-20 21:44:00 +01:00
f9878b43d8 Implement comparison operators 2022-11-20 13:47:38 +01:00
3bbd0e79a1 Implement predicates
This implements the last remaining feature of the language syntax! :)

The implementation of this was delightfully simple, since all the heavy
lifting is done by already implemented functions.
2022-11-19 23:26:59 +01:00
3d7bef187c Matchers: Don't return twice when value to capture is missing
We called return_from_matcher once inside
matcher_evaluate_capturing_instruction and outside of it. That way we
returned not to the parent call stack entry but to the grandparent.
2022-11-19 23:26:59 +01:00
20c2880f4c Implement assigning into dictionaries
It's now possible to assign to a key of a dictionary and even to a nested
key path.

This patch changes the way matchers work a bit:
First, a function call stack frame now has a stack of matchers that are
manipulateable instead of a single matcher.
Second, the matcher is now in charge of setting the matched values to the
variables (previously the caller of the matcher needed to extract the
matched values and assign them itself). This change simplifies code
generation, especially for chained assignments and dictionary key paths.

This removes the last usage of APFL_ERR_NOT_IMPLEMENTED :)
2022-11-19 23:26:52 +01:00
7c5465d266 Add a test for chained assignments 2022-11-19 21:27:08 +01:00
0682b5464d Add test for == function 2022-11-08 22:03:05 +01:00
97d79754dd Implement while 2022-11-08 22:03:05 +01:00
18ae382414 Add test for if 2022-10-31 15:50:51 +01:00
0836b8c97c Implement global functions not, len and type 2022-10-31 15:29:01 +01:00
154cc42740 globals: Fix math operations returning argument list on single arg 2022-10-30 23:08:41 +01:00
39578c9478 Add more functional tests 2022-10-30 23:07:53 +01:00
b7015e7b13 Implement a simple test runner for functional tests 2022-10-30 22:51:51 +01:00