From a7b2cec4719ed5b42889aafac20a25f1820ab78b Mon Sep 17 00:00:00 2001 From: Johnny Richard Date: Sun, 30 Apr 2023 02:00:39 +0200 Subject: ast: Rename variable and variable_declaration correctly Signed-off-by: Johnny Richard --- src/ast.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ast.c') 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 -- cgit v1.2.3