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, 16 insertions, 0 deletions
diff --git a/src/ast.h b/src/ast.h
index 7d2d2f1..315de1e 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -54,6 +54,11 @@ typedef struct ast_variable_t
ast_identifier_t *identifier;
} ast_variable_t;
+typedef struct ast_function_call_t
+{
+ ast_identifier_t *identifier;
+} ast_function_call_t;
+
typedef struct ast_function_declaration_t
{
ast_identifier_t identifier;
@@ -128,6 +133,7 @@ typedef enum
AST_BINARY_OPERATION,
AST_BLOCK,
AST_FUNCTION_DECLARATION,
+ AST_FUNCTION_CALL,
AST_LITERAL,
AST_RETURN_STMT,
AST_IF_STMT,
@@ -142,6 +148,7 @@ typedef union
ast_namespace_t ns;
ast_binary_operation_t binary_operation;
ast_function_declaration_t function;
+ ast_function_call_t function_call;
ast_literal_t literal;
ast_block_t block;
ast_if_stmt_t if_stmt;
@@ -183,6 +190,9 @@ ast_node_t *
ast_node_new_function_declaration(string_view_t function_name, type_t return_type, ast_node_t *body);
ast_node_t *
+ast_node_new_function_call(ast_identifier_t *identifier, type_t result_type);
+
+ast_node_t *
ast_node_new_return_stmt(ast_node_t *argument);
ast_node_t *
@@ -212,4 +222,10 @@ ast_node_ns_get_function_node_by_sv(ast_node_t *ns, string_view_t name);
ast_node_t *
ast_node_ns_get_function_node_by_name(ast_node_t *ns, char *function_name);
+bool
+ast_node_is_variable_declaration(ast_node_t *node);
+
+bool
+ast_node_is_function_declaration(ast_node_t *node);
+
#endif /* AST_H */