|
@@ -314,17 +314,33 @@ function parseWhileTrue (command, function_obj) {
|
|
|
|
|
|
function parseDoWhileTrue (command, function_obj) {
|
|
|
|
|
|
- // TODO
|
|
|
- console.log(command)
|
|
|
+ var expression = CodeParser.expressionParserCodeVisual(command.expression, function_obj);
|
|
|
+ var commands = parseCommands(command.commands, function_obj);
|
|
|
|
|
|
- // return new Models.DoWhileTrue([new Models.VariableValueMenu(VariableValueMenuManagement.VAR_OR_VALUE_TYPES.all, null, null, null, true)], null);
|
|
|
+ return new Models.DoWhileTrue(
|
|
|
+ expression,
|
|
|
+ commands
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
function parseSwitch (command, function_obj) {
|
|
|
|
|
|
- console.log(command)
|
|
|
-
|
|
|
- // var sc = [new Models.SwitchCase(new Models.VariableValueMenu(VariableValueMenuManagement.VAR_OR_VALUE_TYPES.all, null, null, null, true))];
|
|
|
+ var expression = CodeParser.expressionParserCodeVisual(command.expression, function_obj);
|
|
|
+
|
|
|
+ var sc = [];
|
|
|
+ if (command.cases) {
|
|
|
+ command.cases.forEach(function(case_el) {
|
|
|
|
|
|
- // return new Models.Switch(new Models.VariableValueMenu(VariableValueMenuManagement.VAR_OR_VALUE_TYPES.variable_and_function, null, null, null, true), sc);
|
|
|
+ var temp_exp = CodeParser.expressionParserCodeVisual(case_el.expression, function_obj);
|
|
|
+ var temp_commands = parseCommands(case_el.commands, function_obj);
|
|
|
+ var temp_case = new Models.SwitchCase(temp_exp[0], temp_commands);
|
|
|
+
|
|
|
+ sc.push(temp_case);
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ return new Models.Switch(
|
|
|
+ expression[0],
|
|
|
+ sc
|
|
|
+ );
|
|
|
}
|