summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ast.c8
-rw-r--r--src/ast.h4
-rw-r--r--src/parser.c2
3 files changed, 7 insertions, 7 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
diff --git a/src/ast.h b/src/ast.h
index 4fd1d1d..2bd700e 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -105,9 +105,9 @@ typedef union
ast_function_declaration_t function;
ast_literal_t literal;
ast_return_stmt_t return_stmt;
- ast_variable_declaration_t variable; // FIXME: Rename to variable_declaration
+ ast_variable_declaration_t variable_declaration;
ast_identifier_t identifier;
- ast_variable_t variable_ex; // FIXME: Rename to variable
+ ast_variable_t variable;
} ast_node_data_t;
typedef struct ast_node_t
diff --git a/src/parser.c b/src/parser.c
index 469fa99..87676d3 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -257,7 +257,7 @@ parser_parse_variable_definition(parser_t *parser, string_view_t variable_name,
}
ast_node_init_variable_declaration(node, variable_name, type, expression);
- scope_push(parser->scope, &node->data.variable.identifier, node);
+ scope_push(parser->scope, &node->data.variable_declaration.identifier, node);
return true;
}