Commit bc8ee588743e7b954bd5de2c046b6f9312617850
1 parent
9dbbc3b0
Exists in
master
and in
66 other branches
Fix expression parsing when some brackets are added for operators priority (this…
… commit replace the previous one)
Showing
1 changed file
with
4 additions
and
3 deletions
Show diff stats
src/InputOutput/IHMImpl/Tools/IHMExpressionParserClass.php
... | ... | @@ -477,14 +477,15 @@ class IHMExpressionParserClass |
477 | 477 | $elements = $els; |
478 | 478 | |
479 | 479 | //add brackets for operators priority |
480 | + //Obsolete cf. https://projects.irap.omp.eu/issues/5239 | |
480 | 481 | |
481 | - $els = array(); | |
482 | + /*$els = array(); | |
482 | 483 | $i = 0; |
483 | 484 | for ($i; $i < count($elements)-2; ++$i) |
484 | 485 | { |
485 | 486 | if ($elements[$i+1] == "*" || $elements[$i+1] == "/" || $elements[$i+1] == "^" || $elements[$i+1] == "<" || $elements[$i+1] == ">") |
486 | 487 | { |
487 | - if ($elements[$i] != ")" && ($this->isDecimal($elements[$i+1]) || $this->isInteger($elements[$i+1]))) | |
488 | + if ($elements[$i] != ")" && ($this->isDecimal($elements[$i+2]) || $this->isInteger($elements[$i+2]))) | |
488 | 489 | { |
489 | 490 | $els[] = "("; |
490 | 491 | $els[] = $elements[$i]; |
... | ... | @@ -500,7 +501,7 @@ class IHMExpressionParserClass |
500 | 501 | $els[] = $elements[$i]; |
501 | 502 | } |
502 | 503 | for ($j = $i; $j < count($elements); ++$j) |
503 | - $els[] = $elements[$j]; | |
504 | + $els[] = $elements[$j];*/ | |
504 | 505 | |
505 | 506 | //split parameters and components |
506 | 507 | $elements = $els; | ... | ... |