aboutsummaryrefslogtreecommitdiff
path: root/include/ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ast.h')
-rw-r--r--include/ast.h9
1 files changed, 9 insertions, 0 deletions
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);