implement else if nesting
This commit is contained in:
@@ -9,11 +9,25 @@ public class IfStatement extends Statement {
|
||||
public Expression cond;
|
||||
public Block then;
|
||||
public Block alt;
|
||||
public IfStatement elif;
|
||||
|
||||
public IfStatement(Expression cond, Block then, Block alt) {
|
||||
public IfStatement(Expression cond, Block then, Block alt, IfStatement elif) {
|
||||
this.cond = cond;
|
||||
this.then = then;
|
||||
this.alt = alt;
|
||||
this.elif = elif;
|
||||
}
|
||||
|
||||
public IfStatement(Expression cond, Block then, Block alt) {
|
||||
this(cond, then, alt, null);
|
||||
}
|
||||
|
||||
public IfStatement(Expression cond, Block then, IfStatement elif) {
|
||||
this(cond, then, null, elif);
|
||||
}
|
||||
|
||||
public IfStatement(Expression cond, Block then) {
|
||||
this(cond, then, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user