|
@@ -1337,6 +1337,51 @@ function getVariable (function_obj, search) {
|
|
Models.EXPRESSION_TYPES.exp_arithmetic,
|
|
Models.EXPRESSION_TYPES.exp_arithmetic,
|
|
Models.ARITHMETIC_TYPES.module);
|
|
Models.ARITHMETIC_TYPES.module);
|
|
break;
|
|
break;
|
|
|
|
+ case '>':
|
|
|
|
+ obj = new Models.ExpressionOperator(
|
|
|
|
+ Models.EXPRESSION_TYPES.exp_conditional,
|
|
|
|
+ Models.ARITHMETIC_COMPARISON.greater_than);
|
|
|
|
+ break;
|
|
|
|
+ case '<':
|
|
|
|
+ obj = new Models.ExpressionOperator(
|
|
|
|
+ Models.EXPRESSION_TYPES.exp_conditional,
|
|
|
|
+ Models.ARITHMETIC_COMPARISON.less_than);
|
|
|
|
+ break;
|
|
|
|
+ case '>=':
|
|
|
|
+ obj = new Models.ExpressionOperator(
|
|
|
|
+ Models.EXPRESSION_TYPES.exp_conditional,
|
|
|
|
+ Models.ARITHMETIC_COMPARISON.greater_than_or_equals_to);
|
|
|
|
+ break;
|
|
|
|
+ case '<=':
|
|
|
|
+ obj = new Models.ExpressionOperator(
|
|
|
|
+ Models.EXPRESSION_TYPES.exp_conditional,
|
|
|
|
+ Models.ARITHMETIC_COMPARISON.less_than_or_equals_to);
|
|
|
|
+ break;
|
|
|
|
+ case '==':
|
|
|
|
+ obj = new Models.ExpressionOperator(
|
|
|
|
+ Models.EXPRESSION_TYPES.exp_conditional,
|
|
|
|
+ Models.ARITHMETIC_COMPARISON.equals_to);
|
|
|
|
+ break;
|
|
|
|
+ case '!=':
|
|
|
|
+ obj = new Models.ExpressionOperator(
|
|
|
|
+ Models.EXPRESSION_TYPES.exp_conditional,
|
|
|
|
+ Models.ARITHMETIC_COMPARISON.not_equals_to);
|
|
|
|
+ break;
|
|
|
|
+ case 'and':
|
|
|
|
+ obj = new Models.ExpressionOperator(
|
|
|
|
+ Models.EXPRESSION_TYPES.exp_logic,
|
|
|
|
+ Models.LOGIC_COMPARISON.and);
|
|
|
|
+ break;
|
|
|
|
+ case 'or':
|
|
|
|
+ obj = new Models.ExpressionOperator(
|
|
|
|
+ Models.EXPRESSION_TYPES.exp_logic,
|
|
|
|
+ Models.LOGIC_COMPARISON.or);
|
|
|
|
+ break;
|
|
|
|
+ case 'not':
|
|
|
|
+ obj = new Models.ExpressionOperator(
|
|
|
|
+ Models.EXPRESSION_TYPES.exp_logic,
|
|
|
|
+ Models.LOGIC_COMPARISON.not);
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
return obj;
|
|
return obj;
|
|
}
|
|
}
|
|
@@ -1372,7 +1417,6 @@ function getVariable (function_obj, search) {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-<<<<<<< HEAD
|
|
|
|
|
|
|
|
// 3. Procurar na lista de parâmetros:
|
|
// 3. Procurar na lista de parâmetros:
|
|
if (!variavel)
|
|
if (!variavel)
|
|
@@ -1382,8 +1426,6 @@ function getVariable (function_obj, search) {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-=======
|
|
|
|
->>>>>>> 4987846b7aa9a436f8051a02f172c75b5a6fafc0
|
|
|
|
}
|
|
}
|
|
|
|
|
|
if (search.instance == "expression"
|
|
if (search.instance == "expression"
|
|
@@ -1403,7 +1445,6 @@ function getVariable (function_obj, search) {
|
|
if (search.instance == "expression"
|
|
if (search.instance == "expression"
|
|
&& search.type == "var"
|
|
&& search.type == "var"
|
|
&& search.class == "vector") {
|
|
&& search.class == "vector") {
|
|
-<<<<<<< HEAD
|
|
|
|
|
|
|
|
var obj = new Models.VariableValueMenu(
|
|
var obj = new Models.VariableValueMenu(
|
|
VariableValueMenuManagement.VAR_OR_VALUE_TYPES.all,
|
|
VariableValueMenuManagement.VAR_OR_VALUE_TYPES.all,
|
|
@@ -1430,27 +1471,13 @@ function getVariable (function_obj, search) {
|
|
|
|
|
|
if (search.instance == "expression"
|
|
if (search.instance == "expression"
|
|
&& search.type == "function") {
|
|
&& search.type == "function") {
|
|
- var obj = new Models.VariableValueMenu(
|
|
|
|
- VariableValueMenuManagement.VAR_OR_VALUE_TYPES.all,
|
|
|
|
- null,
|
|
|
|
-=======
|
|
|
|
- /*
|
|
|
|
- variable_and_value = 7,
|
|
|
|
- content = null,
|
|
|
|
- row = null,
|
|
|
|
- column = null,
|
|
|
|
- include_constant = true,
|
|
|
|
- dimensions = 0
|
|
|
|
- */
|
|
|
|
var obj = new Models.VariableValueMenu(
|
|
var obj = new Models.VariableValueMenu(
|
|
VariableValueMenuManagement.VAR_OR_VALUE_TYPES.all,
|
|
VariableValueMenuManagement.VAR_OR_VALUE_TYPES.all,
|
|
variavel,
|
|
variavel,
|
|
->>>>>>> 4987846b7aa9a436f8051a02f172c75b5a6fafc0
|
|
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
true
|
|
true
|
|
);
|
|
);
|
|
-<<<<<<< HEAD
|
|
|
|
// Procurar a função para referência:
|
|
// Procurar a função para referência:
|
|
for (var i = 0; i < program_obj.functions.length; i++) {
|
|
for (var i = 0; i < program_obj.functions.length; i++) {
|
|
if (program_obj.functions[i].name == search.value) {
|
|
if (program_obj.functions[i].name == search.value) {
|
|
@@ -1463,14 +1490,10 @@ function getVariable (function_obj, search) {
|
|
obj.parameters_list.push(getVariable(function_obj,search.params[i][0]));
|
|
obj.parameters_list.push(getVariable(function_obj,search.params[i][0]));
|
|
}
|
|
}
|
|
return obj;
|
|
return obj;
|
|
-=======
|
|
|
|
-
|
|
|
|
->>>>>>> 4987846b7aa9a436f8051a02f172c75b5a6fafc0
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
export function expressionParserToVisual (text, function_obj, input_field) {
|
|
export function expressionParserToVisual (text, function_obj, input_field) {
|
|
-<<<<<<< HEAD
|
|
|
|
|
|
|
|
if (text.trim().length == 0) {
|
|
if (text.trim().length == 0) {
|
|
return [new Models.VariableValueMenu(
|
|
return [new Models.VariableValueMenu(
|
|
@@ -1484,9 +1507,6 @@ export function expressionParserToVisual (text, function_obj, input_field) {
|
|
|
|
|
|
var var_not_found = [];
|
|
var var_not_found = [];
|
|
var fun_not_found = [];
|
|
var fun_not_found = [];
|
|
-=======
|
|
|
|
- var var_not_found = [];
|
|
|
|
->>>>>>> 4987846b7aa9a436f8051a02f172c75b5a6fafc0
|
|
|
|
var parsed;
|
|
var parsed;
|
|
try {
|
|
try {
|
|
parsed = ivprogCore.parseExpression(text);
|
|
parsed = ivprogCore.parseExpression(text);
|
|
@@ -1507,11 +1527,7 @@ export function expressionParserToVisual (text, function_obj, input_field) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-<<<<<<< HEAD
|
|
|
|
// 2. Procurar a variável nas globais:
|
|
// 2. Procurar a variável nas globais:
|
|
-=======
|
|
|
|
- // 2. Procurar a variável nas gloais:
|
|
|
|
->>>>>>> 4987846b7aa9a436f8051a02f172c75b5a6fafc0
|
|
|
|
if (!variavel)
|
|
if (!variavel)
|
|
for (var j = 0; j < program_obj.globals.length; j++) {
|
|
for (var j = 0; j < program_obj.globals.length; j++) {
|
|
if (program_obj.globals[j].name == parsed[i].value) {
|
|
if (program_obj.globals[j].name == parsed[i].value) {
|
|
@@ -1519,7 +1535,6 @@ export function expressionParserToVisual (text, function_obj, input_field) {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-<<<<<<< HEAD
|
|
|
|
|
|
|
|
// 3. Procurar a variável nos parâmetros:
|
|
// 3. Procurar a variável nos parâmetros:
|
|
if (!variavel)
|
|
if (!variavel)
|
|
@@ -1529,13 +1544,10 @@ export function expressionParserToVisual (text, function_obj, input_field) {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-=======
|
|
|
|
->>>>>>> 4987846b7aa9a436f8051a02f172c75b5a6fafc0
|
|
|
|
|
|
|
|
if (!variavel)
|
|
if (!variavel)
|
|
var_not_found.push(parsed[i].value);
|
|
var_not_found.push(parsed[i].value);
|
|
}
|
|
}
|
|
-<<<<<<< HEAD
|
|
|
|
|
|
|
|
var funcao;
|
|
var funcao;
|
|
if (parsed[i].instance == "expression"
|
|
if (parsed[i].instance == "expression"
|
|
@@ -1558,8 +1570,6 @@ export function expressionParserToVisual (text, function_obj, input_field) {
|
|
let uniqueWords = [...new Set(fun_not_found)];
|
|
let uniqueWords = [...new Set(fun_not_found)];
|
|
Utils.renderErrorMessage(input_field, LocalizedStrings.getUI('expression_undeclared_function') + " " + uniqueWords.join(", "));
|
|
Utils.renderErrorMessage(input_field, LocalizedStrings.getUI('expression_undeclared_function') + " " + uniqueWords.join(", "));
|
|
return null;
|
|
return null;
|
|
-=======
|
|
|
|
->>>>>>> 4987846b7aa9a436f8051a02f172c75b5a6fafc0
|
|
|
|
}
|
|
}
|
|
|
|
|
|
if (var_not_found.length > 0) {
|
|
if (var_not_found.length > 0) {
|