From 3495c3390361a9952de7ace2838b23b04bde7514 Mon Sep 17 00:00:00 2001 From: s-over-4 Date: Sun, 9 Jul 2023 23:36:39 -0400 Subject: hi Ī£airu --- src/include/parser.h | 22 +++++----------------- src/include/tree.h | 6 ++++-- 2 files changed, 9 insertions(+), 19 deletions(-) (limited to 'src/include') diff --git a/src/include/parser.h b/src/include/parser.h index 694bd5e..0ba2038 100644 --- a/src/include/parser.h +++ b/src/include/parser.h @@ -13,37 +13,25 @@ parser_t* parser_init(lexer_t* lexer); void parser_destroy(parser_t* parser); // expect token, or die -void parser_token_expect(parser_t* parser, token_t* token); +void parser_token_expect(parser_t* parser, int token); void parser_token_expectf(parser_t* parser, int (*expected_token)(token_t*)); // do the parse tree_t* parser_parse(parser_t* parser); -// parse statements -// - end in semicolon or ) or } -// - can contain one expression -// - return what they evaluate to -tree_t* parser_parse_statements(parser_t* parser); -tree_t* parser_parse_statement(parser_t* parser); - // parse expressions -// - in parenthetical -// - contain only one statement -// - return what that statement evaluates to -// - adds layer of scope) -// basically a statement, but with a layer of scope +// - returns what it evaluates to +// - can contain other exprs tree_t* parser_parse_exprs(parser_t* parser); tree_t* parser_parse_expr(parser_t* parser); // parse blocks // - in curly brackets -// - many statements -// - return what last statement evaluates to +// - contains many exprs +// - returns last expr tree_t* parser_parse_blocks(parser_t* parser); tree_t* parser_parse_block(parser_t* parser); -// blocks contain many statements, any of which may contain any number of expressions - tree_t* parser_parse_def(parser_t* parser); tree_t* parser_parse_call(parser_t* parser); diff --git a/src/include/tree.h b/src/include/tree.h index 6374062..fde66ea 100644 --- a/src/include/tree.h +++ b/src/include/tree.h @@ -19,9 +19,11 @@ typedef struct TREE_STRUC { } comp; struct { // === DEFINITIONS === - char* name; // name of definition - int mutability; // mutability of definition + char* type; // the definition type + char** tags; // the definition tags + char* name; // the definition name struct TREE_STRUC* value; // value of definition + // :D lines line up :D } def; struct { // === CALLS === -- cgit v1.2.3