@@ -0,0 +1,7 @@
+export class CommandBlock {
+
+ constructor(variables, commands) {
+ this.variables = variables;
+ this.commands = commands;
+ }
+}
@@ -7,7 +7,17 @@ import { While } from './while';
import { For } from './for';
import { Function } from './function';
import { IfThenElse } from './ifThenElse';
+import { CommandBlock } from './commandBlock';
export {
- Break, Return, Assign, Declaration, ArrayDeclaration, While, For, Function, IfThenElse
+ Break,
+ Return,
+ Assign,
+ Declaration,
+ ArrayDeclaration,
+ While,
+ For,
+ Function,
+ IfThenElse,
+ CommandBlock
};
@@ -507,7 +507,7 @@ export class IVProgParser {
this.checkCloseCurly();
this.pos++;
this.consumeNewLines();
- return {variables: variablesDecl, commands: commands};
+ return new Commands.CommandBlock(variablesDecl, commands);
}
parseIfThenElse () {