diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-24 12:14:48 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-24 12:14:48 +0000 |
| commit | 812fe9cbe124bf39a06f58a538c8c01f7402fb09 (patch) | |
| tree | 8ea1f8258714e7dd8916eb221006e45082a129bb /src/parser/parser_decl.c | |
| parent | 22035400ed7b7fcda088a1a5b1ca6505b23bf63f (diff) | |
Fix for #110
Diffstat (limited to 'src/parser/parser_decl.c')
| -rw-r--r-- | src/parser/parser_decl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/parser/parser_decl.c b/src/parser/parser_decl.c index 7e0cc5b..bd56350 100644 --- a/src/parser/parser_decl.c +++ b/src/parser/parser_decl.c @@ -562,17 +562,17 @@ ASTNode *parse_var_decl(ParserContext *ctx, Lexer *l) // Fallbacks for literals else if (init->type == NODE_EXPR_LITERAL) { - if (init->literal.type_kind == 0) + if (init->literal.type_kind == LITERAL_INT) { type = xstrdup("int"); type_obj = type_new(TYPE_INT); } - else if (init->literal.type_kind == 1) + else if (init->literal.type_kind == LITERAL_FLOAT) { type = xstrdup("float"); type_obj = type_new(TYPE_FLOAT); } - else if (init->literal.type_kind == 2) + else if (init->literal.type_kind == LITERAL_STRING) { type = xstrdup("string"); type_obj = type_new(TYPE_STRING); @@ -596,7 +596,7 @@ ASTNode *parse_var_decl(ParserContext *ctx, Lexer *l) add_symbol_with_token(ctx, name, type, type_obj, name_tok); // NEW: Capture Const Integer Values - if (init && init->type == NODE_EXPR_LITERAL && init->literal.type_kind == 0) + if (init && init->type == NODE_EXPR_LITERAL && init->literal.type_kind == LITERAL_INT) { Symbol *s = find_symbol_entry(ctx, name); // Helper to find the struct if (s) |
