Most of the ECE logic is referenced from js-slang.
Due to the limitation of the java-parser library used, expressions such as 1 + 2 * 3 are not parsed with the appropriate precedence of multiplicative operations over additive operations. Hence, some post-processing is done to encode the appropriate precedence. As a result, both types of expression such as 1 + 2 * 3 and 1 + (2 * 3) are evaluated correctly.
Most of the ECE logic is referenced from js-slang.
Due to the limitation of the java-parser library used, expressions such as
1 + 2 * 3
are not parsed with the appropriate precedence of multiplicative operations over additive operations. Hence, some post-processing is done to encode the appropriate precedence. As a result, both types of expression such as1 + 2 * 3
and1 + (2 * 3)
are evaluated correctly.