From efe230205f254fc5369b53d3de2841723beb6ff8 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 21 Aug 2026 20:38:39 +0000 Subject: Start work on testing the evaluator FossilOrigin-Name: 530cc9567bc825fd8a7eb21f2ca12dbf7ecbecae3ed02638537dc4a8dca9ae1a --- src/lib/aplwc_internal.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/lib/aplwc_internal.h') diff --git a/src/lib/aplwc_internal.h b/src/lib/aplwc_internal.h index 833a351..4ad30f8 100644 --- a/src/lib/aplwc_internal.h +++ b/src/lib/aplwc_internal.h @@ -53,8 +53,17 @@ struct token_list { struct token tokens[1]; }; +enum value_tag { + VALUE_NUMBER +}; + +struct aplwc_value { + struct aplwc *aplwc; + enum value_tag tag; +}; + /* eval.c */ -void eval_line(struct aplwc_line *); +struct aplwc_value *eval_line(struct aplwc_line *); /* memory.c */ struct memory memory_init(uint8_t *, size_t); @@ -62,10 +71,12 @@ struct aplwc *memory_alloc_aplwc(struct memory *); struct aplwc_line *memory_alloc_aplwc_line(struct memory *); struct string *memory_alloc_string(struct memory *, size_t); struct token_list *memory_alloc_token_list(struct memory *, size_t); +struct aplwc_value *memory_alloc_aplwc_value(struct memory *); void memory_free_aplwc(struct memory *, struct aplwc *); void memory_free_aplwc_line(struct memory *, struct aplwc_line *); void memory_free_string(struct memory *, struct string *); void memory_free_token_list(struct memory *, struct token_list *); +void memory_free_aplwc_value(struct memory *, struct aplwc_value *); /* string.c */ struct string *chars_to_string(struct aplwc *, const char *); -- cgit v1.2.3