From 902a81528b9d2edcf93226a2ca13da6fcc1839e5 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 23 Dec 2019 08:57:48 +0100 Subject: wip: function pointers and other stuff --- include/ast.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/ast.h') diff --git a/include/ast.h b/include/ast.h index eaaf93e..f56c180 100644 --- a/include/ast.h +++ b/include/ast.h @@ -29,6 +29,7 @@ typedef struct Import Import; typedef struct String String; typedef struct Variable Variable; typedef struct Number Number; +typedef struct AstBool AstBool; typedef struct Binop Binop; typedef struct IfStatement IfStatement; typedef struct ElseIfStatement ElseIfStatement; @@ -47,6 +48,7 @@ typedef union { Import *import; String *string; Number *number; + AstBool *bool; Variable *variable; Binop *binop; IfStatement *if_stmt; @@ -64,6 +66,7 @@ typedef enum { AST_IMPORT, AST_STRING, AST_NUMBER, + AST_BOOL, AST_VARIABLE, AST_BINOP, AST_IF_STATEMENT, @@ -266,6 +269,11 @@ struct Number { BufferView code_ref; }; +struct AstBool { + bool value; + BufferView code_ref; +}; + struct Binop { Ast *lhs; Ast *rhs; @@ -332,6 +340,7 @@ void assignmentexpr_init(AssignmentExpr *self, Ast *lhs_expr, Ast *rhs_expr); void import_init(Import *self, BufferView path); CHECK_RESULT int string_init(String *self, BufferView str); void number_init(Number *self, AmalNumber *value, BufferView code_ref); +void ast_bool_init(AstBool *self, bool value, BufferView code_ref); void variable_init(Variable *self, BufferView name); void binop_init(Binop *self); CHECK_RESULT int if_statement_init(IfStatement *self, Scope *parent, ArenaAllocator *allocator); -- cgit v1.2.3