summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorpeter <peter@pmikkelsen.com>2026-08-21 10:55:30 +0000
committerpeter <peter@pmikkelsen.com>2026-08-21 10:55:30 +0000
commit8af7b7fc0a8dbe3502a7cd43c6a10fdcc6013677 (patch)
tree68f2456a9f31044ca088a26a2c3306c98e6cce2b /src/bin
parent86feda786f115cb4468957f00b8968b986ed7c54 (diff)
Start working on the scanner.
For now, all that is implemented is some functionality which imports UTF-8 into the memory managed by aplwc, after checking that the data is in fact valid UTF-8. FossilOrigin-Name: c861e88777d8180cb7b37c11fc7016a900f9d5821a7e3c8e8aab54118d2fca94
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index 80b2ee0..a1c65bf 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -5,6 +5,7 @@ int
main(void)
{
struct aplwc *aplwc;
+ struct aplwc_line *line;
uint8_t *data;
int ret;
size_t memsize;
@@ -24,6 +25,13 @@ main(void)
return 1;
}
+ line = aplwc_read(aplwc, "a←10+20");
+ if(line == NULL)
+ fprintf(stderr, "Could not parse line: %s\n", aplwc_errstr(aplwc));
+ else
+ aplwc_eval(line);
+ aplwc_free_line(line);
+
aplwc_destroy(aplwc);
free(data);