From 812fe9cbe124bf39a06f58a538c8c01f7402fb09 Mon Sep 17 00:00:00 2001 From: Zuhaitz Méndez Fernández de Aránguiz Date: Sat, 24 Jan 2026 12:14:48 +0000 Subject: Fix for #110 --- src/parser/parser_decl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/parser/parser_decl.c') 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) -- cgit v1.2.3