From f9a6691243d59915dad8785a321ca021bb27de27 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sat, 30 Oct 2021 09:39:04 +0200 Subject: Add minimal syntax file for vim --- src/parser.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/parser.c b/src/parser.c index e32a571..2215fad 100644 --- a/src/parser.c +++ b/src/parser.c @@ -375,12 +375,13 @@ parse_tree(Parser *parser, Errors *errors) { Root * parse(Token *tokens, Errors *errors) { - // Build initial AST. array_init(roots, 0); Parser parser = { .tokens = tokens, .current = 0, }; + + // Build initial ASTs. This also ensures the core grammar is correct. while (has_next_token(&parser)) { Object *root = parse_tree(&parser, errors); OBJ_PRINT(root); @@ -391,9 +392,8 @@ parse(Token *tokens, Errors *errors) { } // Perform semantic analysis. - // 1. Ensure core grammar is correct. - // 2. Check that symbols are defined before usage. - // 3. Remove unnecessary statements. + // TODO: Check that symbols are defined before usage. + // TODO: Remove unnecessary statements. return roots; } -- cgit v1.2.1