|
@@ -66,8 +66,6 @@ function parseParameter (parameter_obj) {
|
|
|
|
|
|
function parseFunction (function_obj) {
|
|
function parseFunction (function_obj) {
|
|
|
|
|
|
- console.log(function_obj)
|
|
|
|
-
|
|
|
|
const new_function = new Models.Function(
|
|
const new_function = new Models.Function(
|
|
function_obj.name,
|
|
function_obj.name,
|
|
function_obj.return_type,
|
|
function_obj.return_type,
|
|
@@ -94,6 +92,8 @@ function parseFunction (function_obj) {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ new_function.commands = parseCommands(function_obj.commands)
|
|
|
|
+
|
|
window.program_obj.addFunction(new_function);
|
|
window.program_obj.addFunction(new_function);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -111,4 +111,21 @@ export function parserCodeVisual (code_obj = null) {
|
|
window.program_obj.functions = [];
|
|
window.program_obj.functions = [];
|
|
code_obj.functions.forEach(parseFunction);
|
|
code_obj.functions.forEach(parseFunction);
|
|
|
|
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function parseCommands (commands_block) {
|
|
|
|
+
|
|
|
|
+ console.log('bloco', commands_block)
|
|
|
|
+
|
|
|
|
+ if (Array.isArray(commands_block)) {
|
|
|
|
+ var temp = [];
|
|
|
|
+ commands_block.forEach(function(command) {
|
|
|
|
+ temp.push(parseCommands(command));
|
|
|
|
+ });
|
|
|
|
+ return temp;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|