diff options
| author | peter <peter@pmikkelsen.com> | 2026-08-29 15:22:21 +0000 |
|---|---|---|
| committer | peter <peter@pmikkelsen.com> | 2026-08-29 15:22:21 +0000 |
| commit | a01b62d7ace95aef73b9f2d33f01486e0856233f (patch) | |
| tree | 49738b1da92d7ee8b00b8d1fed93f4d3a0edef65 /src/lib/aplwc_internal.h | |
| parent | 3787b5c0b7870eec43ce384beaa16288073e89cf (diff) | |
Commit unsaved work.
FossilOrigin-Name: 46adf8e389516e01f11696af5cf48d7dbee8764a480e20957a251538ace8cf3a
Diffstat (limited to 'src/lib/aplwc_internal.h')
| -rw-r--r-- | src/lib/aplwc_internal.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/lib/aplwc_internal.h b/src/lib/aplwc_internal.h index 888d35c..e394bd8 100644 --- a/src/lib/aplwc_internal.h +++ b/src/lib/aplwc_internal.h @@ -17,6 +17,7 @@ struct memory { struct aplwc { enum aplwc_rc last_error; struct memory memory; + struct aplwc_module *modules; }; struct aplwc_line { @@ -42,7 +43,9 @@ enum token_tag { TOKEN_TAG_DEL, TOKEN_TAG_LEFT_PAREN, TOKEN_TAG_RIGHT_PAREN, - TOKEN_TAG_IBEAM + TOKEN_TAG_IBEAM, + TOKEN_TAG_QUAD, + TOKEN_TAG_UNKNOWN_SYM }; struct token { @@ -67,6 +70,13 @@ struct aplwc_value { enum value_tag tag; }; +struct aplwc_module { + struct aplwc *aplwc; + struct string *name; + struct token_list *tokens; + struct aplwc_module *link; +}; + /* eval.c */ struct aplwc_value *eval_line(struct aplwc_line *); @@ -77,21 +87,28 @@ 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 *); +struct aplwc_module *memory_alloc_aplwc_module(struct memory *); +struct module_imports *memory_alloc_module_imports(struct memory *, size_t); 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 *); +void memory_free_aplwc_module(struct memory *, struct aplwc_module *); /* string.c */ struct string *chars_to_string(struct aplwc *, const char *, int len); uint32_t string_char(struct string *, size_t); size_t char_length(struct string *, size_t); +int string_compare(struct string *, struct string *); /* syntax.c */ struct token_list *scan_string(struct aplwc *, struct string *, int); +enum aplwc_rc check_tokens(struct token_list *); /* module.c */ enum aplwc_rc load_module(struct aplwc *, struct string *, struct token_list *); +struct aplwc_module *module_lookup(struct aplwc *, struct string *); +struct string *module_imports_syms(struct module_imports *); #endif /* APLWC_INTERNAL_H */ |