From 7cf2065be92855b5b1db31a4bb7afbb4af29a817 Mon Sep 17 00:00:00 2001 From: Carson Fleming Date: Sun, 29 Mar 2026 08:28:28 -1000 Subject: calling functions and some optimizations --- ast.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'ast.h') diff --git a/ast.h b/ast.h index 5ae0d12..2eabb02 100644 --- a/ast.h +++ b/ast.h @@ -1,6 +1,8 @@ #ifndef AST_H #define AST_H +#include "scope.h" + struct stmt_node; struct expr_node; @@ -8,8 +10,8 @@ struct type_node { bool _unsigned; bool _short; bool _long; + struct type_def def; unsigned char ptr_level; - char* name; }; struct int_lit_node { @@ -56,6 +58,12 @@ struct assign_node { struct expr_node* rval; }; +struct call_node { + /* TODO: eventually this could also be a function pointer */ + struct fn_decl_node* called_fn; + struct expr_node* args_head; +}; + struct expr_node { enum { EXPR_INT_LIT, @@ -64,6 +72,7 @@ struct expr_node { EXPR_STR_LIT, EXPR_VAR_REF, EXPR_ASSIGN, + EXPR_CALL, } type; union { struct int_lit_node _int_lit; @@ -72,7 +81,10 @@ struct expr_node { struct str_lit_node _str_lit; struct var_ref_node _var_ref; struct assign_node _assign; + struct call_node _call; } as; + + struct expr_node* next; }; struct group_node { -- cgit v1.2.3