aboutsummaryrefslogtreecommitdiff
path: root/src/ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast.h')
-rw-r--r--src/ast.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ast.h b/src/ast.h
index 074c9b2..f5eea17 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -115,6 +115,7 @@ enum StatementKind
STATEMENT_GOTO,
STATEMENT_SYSCALL,
STATEMENT_IF,
+ STATEMENT_WHILE,
STATEMENT_CALL,
STATEMENT_STACK,
};
@@ -149,6 +150,15 @@ struct IfStatement
size_t else_count;
};
+struct WhileStatement
+{
+ struct Expr* left;
+ struct Token comparison;
+ struct Expr* right;
+ struct Statement* body;
+ size_t body_count;
+};
+
struct CallStatement
{
struct Token name;
@@ -172,6 +182,7 @@ struct Statement
struct LabelStatement label;
struct GotoStatement jump;
struct IfStatement branch;
+ struct WhileStatement loop;
struct CallStatement call;
struct StackStatement stack;
};