From 24dd666121e2786efb82854b05aa71d759e04ee6 Mon Sep 17 00:00:00 2001 From: Mustafa Quraish Date: Sat, 5 Feb 2022 00:57:20 -0500 Subject: Add ability to initialize global variables The code to initialize them is put right before calling `main()` --- src/parser.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/parser.c') diff --git a/src/parser.c b/src/parser.c index 49c9689..81c90da 100644 --- a/src/parser.c +++ b/src/parser.c @@ -375,9 +375,6 @@ Node *parse_var_declaration(Lexer *lexer) } if (token.type == TOKEN_ASSIGN) { - if (is_global) - die_location(token.loc, "Cannot initialize global variable `%s` outside function", node->var_decl.var.name); - node->var_decl.value = parse_expression(lexer); if (is_missing_type) { -- cgit v1.2.3