diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-27 01:22:42 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-27 01:22:42 +0000 |
| commit | 938773d9cc062fd028f6560b1127a2ecd23f61c3 (patch) | |
| tree | 403aacd629975440ba23a645975c34a141d634ee /src/analysis | |
| parent | 2f47bdf7f49f05bd421e4182635f489c8cae01b3 (diff) | |
Fixed constant hex/oct bug + Fixed some of the examples (work in progress) + added bootloader example (I will add some docs)
Diffstat (limited to 'src/analysis')
| -rw-r--r-- | src/analysis/typecheck.c | 8 | ||||
| -rw-r--r-- | src/analysis/typecheck.h | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/analysis/typecheck.c b/src/analysis/typecheck.c index e83bb4b..1faff2c 100644 --- a/src/analysis/typecheck.c +++ b/src/analysis/typecheck.c @@ -15,7 +15,10 @@ static void tc_error(TypeChecker *tc, Token t, const char *msg) static void tc_enter_scope(TypeChecker *tc) { Scope *s = malloc(sizeof(Scope)); - if (!s) return; + if (!s) + { + return; + } s->symbols = NULL; s->parent = tc->current_scope; tc->current_scope = s; @@ -365,6 +368,9 @@ static void check_node(TypeChecker *tc, ASTNode *node) case NODE_EXPR_CALL: check_expr_call(tc, node); break; + case NODE_EXPR_ARRAY_LITERAL: + check_node(tc, node->array_literal.elements); + break; default: // Generic recursion for lists and other nodes. // Special case for Return to trigger move? diff --git a/src/analysis/typecheck.h b/src/analysis/typecheck.h index b690f1d..f141deb 100644 --- a/src/analysis/typecheck.h +++ b/src/analysis/typecheck.h @@ -9,7 +9,7 @@ // Unlike the parser, this focuses on semantic validity (types, definitions). /** * @brief Type Checker Context. - * + * * Holds the state during the semantic analysis pass. * Unlike the parser, this focuses on semantic validity (types, definitions, correctness). */ @@ -24,9 +24,9 @@ typedef struct TypeChecker /** * @brief Main Type Checking Entry Point. - * + * * Performs semantic analysis on the entire AST. - * + * * @param ctx Global parser context. * @param root Root AST node of the program. * @return 0 on success (no errors), non-zero if errors occurred. |
