From 68f651f90ac9bb42e6fcb461f72f82ee74df1fdd Mon Sep 17 00:00:00 2001 From: AidenRushbrooke <72034940+AidenRushbrooke@users.noreply.github.com> Date: Sat, 20 Nov 2021 02:24:52 +0000 Subject: Added initial support for do while loops --- src/Compiler/Statement.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/Compiler/Statement.java') diff --git a/src/Compiler/Statement.java b/src/Compiler/Statement.java index 10ed878..a3c0960 100644 --- a/src/Compiler/Statement.java +++ b/src/Compiler/Statement.java @@ -71,6 +71,22 @@ abstract class Statement { } } + static class DoWhileStatement extends Statement{ + DoWhileStatement(Expression condition,BlockStatement codeBlock){ + this.condition=condition; + this.codeBlock=codeBlock; + + } + + final Expression condition; + final BlockStatement codeBlock; + + @Override + public String getStatmentType() { + return "dowhileStmt"; + } + } + static class VariableDeclaration extends Statement{ VariableDeclaration(Token name,String type){ -- cgit v1.2.3