|
@@ -1337,6 +1337,51 @@ function getVariable (function_obj, search) {
|
|
|
Models.EXPRESSION_TYPES.exp_arithmetic,
|
|
|
Models.ARITHMETIC_TYPES.module);
|
|
|
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;
|
|
|
}
|
|
@@ -1372,7 +1417,6 @@ function getVariable (function_obj, search) {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
|
// 3. Procurar na lista de parâmetros:
|
|
|
if (!variavel)
|
|
@@ -1382,8 +1426,6 @@ function getVariable (function_obj, search) {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-=======
|
|
|
->>>>>>> 4987846b7aa9a436f8051a02f172c75b5a6fafc0
|
|
|
}
|
|
|
|
|
|
if (search.instance == "expression"
|
|
@@ -1403,7 +1445,6 @@ function getVariable (function_obj, search) {
|
|
|
if (search.instance == "expression"
|
|
|
&& search.type == "var"
|
|
|
&& search.class == "vector") {
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
|
var obj = new Models.VariableValueMenu(
|
|
|
VariableValueMenuManagement.VAR_OR_VALUE_TYPES.all,
|
|
@@ -1430,27 +1471,13 @@ function getVariable (function_obj, search) {
|
|
|
|
|
|
if (search.instance == "expression"
|
|
|
&& 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(
|
|
|
VariableValueMenuManagement.VAR_OR_VALUE_TYPES.all,
|
|
|
variavel,
|
|
|
->>>>>>> 4987846b7aa9a436f8051a02f172c75b5a6fafc0
|
|
|
null,
|
|
|
null,
|
|
|
true
|
|
|
);
|
|
|
-<<<<<<< HEAD
|
|
|
// Procurar a função para referência:
|
|
|
for (var i = 0; i < program_obj.functions.length; i++) {
|
|
|
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]));
|
|
|
}
|
|
|
return obj;
|
|
|
-=======
|
|
|
-
|
|
|
->>>>>>> 4987846b7aa9a436f8051a02f172c75b5a6fafc0
|
|
|
}
|
|
|
}
|
|
|
|
|
|
export function expressionParserToVisual (text, function_obj, input_field) {
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
|
if (text.trim().length == 0) {
|
|
|
return [new Models.VariableValueMenu(
|
|
@@ -1484,9 +1507,6 @@ export function expressionParserToVisual (text, function_obj, input_field) {
|
|
|
|
|
|
var var_not_found = [];
|
|
|
var fun_not_found = [];
|
|
|
-=======
|
|
|
- var var_not_found = [];
|
|
|
->>>>>>> 4987846b7aa9a436f8051a02f172c75b5a6fafc0
|
|
|
var parsed;
|
|
|
try {
|
|
|
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 gloais:
|
|
|
->>>>>>> 4987846b7aa9a436f8051a02f172c75b5a6fafc0
|
|
|
if (!variavel)
|
|
|
for (var j = 0; j < program_obj.globals.length; j++) {
|
|
|
if (program_obj.globals[j].name == parsed[i].value) {
|
|
@@ -1519,7 +1535,6 @@ export function expressionParserToVisual (text, function_obj, input_field) {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
|
// 3. Procurar a variável nos parâmetros:
|
|
|
if (!variavel)
|
|
@@ -1529,13 +1544,10 @@ export function expressionParserToVisual (text, function_obj, input_field) {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-=======
|
|
|
->>>>>>> 4987846b7aa9a436f8051a02f172c75b5a6fafc0
|
|
|
|
|
|
if (!variavel)
|
|
|
var_not_found.push(parsed[i].value);
|
|
|
}
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
|
var funcao;
|
|
|
if (parsed[i].instance == "expression"
|
|
@@ -1558,8 +1570,6 @@ export function expressionParserToVisual (text, function_obj, input_field) {
|
|
|
let uniqueWords = [...new Set(fun_not_found)];
|
|
|
Utils.renderErrorMessage(input_field, LocalizedStrings.getUI('expression_undeclared_function') + " " + uniqueWords.join(", "));
|
|
|
return null;
|
|
|
-=======
|
|
|
->>>>>>> 4987846b7aa9a436f8051a02f172c75b5a6fafc0
|
|
|
}
|
|
|
|
|
|
if (var_not_found.length > 0) {
|