2
0
forked from Wavyzz/dolibarr

Fix syntax

This commit is contained in:
Laurent Destailleur
2020-07-03 00:36:56 +02:00
parent b45bfd258d
commit fd617658ef

View File

@@ -270,10 +270,11 @@ class EvalMath
// ===============
} elseif ($op == ')' and $expecting_op) { // ready to close a parenthesis?
while (($o2 = $stack->pop()) != '(') { // pop off the stack back to the last (
if (is_null($o2))
if (is_null($o2)) {
return $this->trigger(5, "unexpected ')'", ")");
else
} else {
$output[] = $o2;
}
}
if (preg_match("/^([a-z]\w*)\($/", $stack->last(2), $matches)) { // did we just close a function?
$fnn = $matches[1]; // get the function name
@@ -293,10 +294,11 @@ class EvalMath
// ===============
} elseif ($op == ',' and $expecting_op) { // did we just finish a function argument?
while (($o2 = $stack->pop()) != '(') {
if (is_null($o2))
if (is_null($o2)) {
return $this->trigger(5, "unexpected ','", ","); // oops, never had a (
else
} else {
$output[] = $o2; // pop the argument expression stuff and push onto the output
}
}
// make sure there was a function
if (!preg_match("/^([a-z]\w*)\($/", $stack->last(2), $matches))