summaryrefslogtreecommitdiff
path: root/src/ast.c
diff options
context:
space:
mode:
authorJohnny Richard <johnny@johnnyrichard.com>2023-04-30 02:00:39 +0200
committerJohnny Richard <johnny@johnnyrichard.com>2023-04-30 02:00:39 +0200
commita7b2cec4719ed5b42889aafac20a25f1820ab78b (patch)
tree338929acd69cae70da390cbc8ecb6512b560cc78 /src/ast.c
parentde3f8f73810d77f7231ceddfd63b0720493bd437 (diff)
ast: Rename variable and variable_declaration correctly
Signed-off-by: Johnny Richard <johnny@johnnyrichard.com>
Diffstat (limited to 'src/ast.c')
-rw-r--r--src/ast.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ast.c b/src/ast.c
index 49d772a..1131bbf 100644
--- a/src/ast.c
+++ b/src/ast.c
@@ -52,7 +52,7 @@ ast_node_destroy(ast_node_t *node)
ast_node_destroy(node->data.binary_operation.right);
break;
case AST_VARIABLE_DECLARATION:
- ast_node_destroy(node->data.variable.value);
+ ast_node_destroy(node->data.variable_declaration.value);
break;
case AST_LITERAL:
break;
@@ -103,15 +103,15 @@ void
ast_node_init_variable_declaration(ast_node_t *node, string_view_t variable_name, type_t type, ast_node_t *value)
{
node->kind = AST_VARIABLE_DECLARATION;
- node->data =
- (ast_node_data_t){ .variable = { .identifier = { .name = variable_name }, .type = type, .value = value } };
+ node->data = (ast_node_data_t){ .variable_declaration = {
+ .identifier = { .name = variable_name }, .type = type, .value = value } };
}
void
ast_node_init_variable(ast_node_t *node, ast_identifier_t *identifier)
{
node->kind = AST_VARIABLE;
- node->data = (ast_node_data_t){ .variable_ex = { .identifier = identifier } };
+ node->data = (ast_node_data_t){ .variable = { .identifier = identifier } };
}
void