qe-compiler icon indicating copy to clipboard operation
qe-compiler copied to clipboard

Add support for operation precedance in expression

Open taalexander opened this issue 1 year ago • 0 comments

#263 adds support for binary/unary expressions on integers and floats to the compiler. However, currently these are evaluated with left-right infix ordering. This means that if parentheses aren't added expressions like a * b ** c will be evaluated as (a * b) ** c) which disobeys standard arithmetic operation precedence. The qe-qasm parser has a ASTOperatorPrecdeanceController that can be used to build the correct expressions.

taalexander avatar Feb 23 '24 22:02 taalexander