lang: ast: replace var keyword with global

local variables are now created automatically when they are first assigned to.

the global keyword can be used to declare that a name refers to a global variable instead,
at which point, assigning to the name results in the assignment referencing the global variable
instead of allocating a new global variable.
This commit is contained in:
2025-09-08 15:50:50 +01:00
parent 5ea544692b
commit 84e52b1649
5 changed files with 39 additions and 41 deletions

View File

@@ -173,9 +173,6 @@ struct ast_node_type lambda_node_ops = {
SYM_PARSER(PIPE, parse_pipe),
SYM_PARSER(COLON, parse_colon),
},
.n_keyword_parsers = {
KW_PARSER(VAR, parse_expr_begin),
},
.n_expr_parser = {
.expr_begin = parse_expr_begin,
},