diff options
author | Johnny Richard <johnny@johnnyrichard.com> | 2023-05-01 01:57:22 +0200 |
---|---|---|
committer | Carlos Maniero <carlos@maniero.me> | 2023-05-01 18:24:42 -0300 |
commit | e3d8e031c6f20c68f2227028ee8b3e73cd9b8161 (patch) | |
tree | 52068df5df3fea73eea9e5af311b03771a0f614a /src/ast.c | |
parent | 8c56ddf0b640b8880eb5b97e5ca1b787585c29c0 (diff) |
parser: Implement variable assignment
This commit introduces variable assignment making it possible to
change a variable value. Example:
myvar: i32 = 1;
myvar = 2;
Signed-off-by: Johnny Richard <johnny@johnnyrichard.com>
Co-authored-by: Carlos Maniero <carlos@maniero.me>
Diffstat (limited to 'src/ast.c')
-rw-r--r-- | src/ast.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -57,6 +57,8 @@ ast_node_destroy(ast_node_t *node) case AST_RETURN_STMT: ast_node_destroy(node->data.return_stmt.argument); break; + case AST_VARIABLE_ASSIGNMENT: + ast_node_destroy(node->data.variable_assignment.expression); case AST_LITERAL: case AST_IDENTIFIER: case AST_UNKOWN_NODE: |