summaryrefslogtreecommitdiff
path: root/src/ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast.h')
-rw-r--r--src/ast.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ast.h b/src/ast.h
index 1f0da13..70d6100 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -32,9 +32,14 @@ typedef struct ast_return_stmt_t
ast_node_t *argument;
} ast_return_stmt_t;
-typedef struct ast_function_declaration_t
+typedef struct ast_identifier_t
{
string_view_t name;
+} ast_identifier_t;
+
+typedef struct ast_function_declaration_t
+{
+ ast_identifier_t identifier;
type_t return_type;
vector_t *body;
} ast_function_declaration_t;
@@ -70,14 +75,9 @@ typedef struct ast_literal_t
ast_literal_value_t value;
} ast_literal_t;
-typedef struct ast_identifier_t
-{
- string_view_t name;
-} ast_identifier_t;
-
typedef struct ast_variable_declaration_t
{
- string_view_t name;
+ ast_identifier_t identifier;
type_t type;
ast_node_t *value;
} ast_variable_declaration_t;
@@ -117,7 +117,7 @@ ast_node_destroy(ast_node_t *node);
void
ast_node_init_binary_operation(ast_node_t *node, ast_binary_operation_kind_t kind, ast_node_t *left, ast_node_t *right);
void
-ast_node_init_function_declaration(ast_node_t *node, string_view_t name, type_t return_type, vector_t *body);
+ast_node_init_function_declaration(ast_node_t *node, string_view_t function_name, type_t return_type, vector_t *body);
void
ast_node_init_identifier(ast_node_t *node, string_view_t name);
void