quarkiverse / quarkus-bon-jova-rockstar

An implementation of Rockstar as a JVM language
https://codewithrockstar.com/
3 stars 2 forks source link

Operator precedence is incorrrect in chained mathematical expressions #114

Open holly-cummins opened 9 months ago

holly-cummins commented 9 months ago

Bon Jova does not yet support operator precedence. This is listed as a missing feature on the README.md, but it's a big enough omission that it also merits an issue. When operators are chained, there is no error, but the results can be incorrect according to normal mathematical rules.

Examples

Subtraction

Let the difference be love without your head
Let the summit be the difference plus x

is not the same as

Let the summit be love without your head plus x

Multiplication

Let product be a million times something times anything
Let anything be product plus y

is not the same as

Let anything be a million times something times anything plus y