summaryrefslogtreecommitdiff
path: root/src/parser/parser_decl.c
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-27 01:22:42 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-27 01:22:42 +0000
commit938773d9cc062fd028f6560b1127a2ecd23f61c3 (patch)
tree403aacd629975440ba23a645975c34a141d634ee /src/parser/parser_decl.c
parent2f47bdf7f49f05bd421e4182635f489c8cae01b3 (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/parser/parser_decl.c')
-rw-r--r--src/parser/parser_decl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/parser/parser_decl.c b/src/parser/parser_decl.c
index ab1516e..98f46e1 100644
--- a/src/parser/parser_decl.c
+++ b/src/parser/parser_decl.c
@@ -586,6 +586,9 @@ ASTNode *parse_var_decl(ParserContext *ctx, Lexer *l)
type_obj->arg_count = init->type_info->arg_count;
type_obj->is_varargs = init->type_info->is_varargs;
}
+ type_obj->array_size = init->type_info->array_size;
+ type_obj->is_raw = init->type_info->is_raw;
+ type_obj->is_explicit_struct = init->type_info->is_explicit_struct;
type = type_to_string(type_obj);
}
else if (init->type == NODE_EXPR_SLICE)
@@ -775,7 +778,7 @@ ASTNode *parse_def(ParserContext *ctx, Lexer *l)
if (lexer_peek(l).type == TOK_INT)
{
Token val_tok = lexer_peek(l);
- int val = atoi(token_strdup(val_tok)); // quick check
+ int val = (int)strtol(token_strdup(val_tok), NULL, 0); // support hex/octal
ZenSymbol *s = find_symbol_entry(ctx, ns);
if (s)