core-lang / core

The Core Programming Language
https://core-lang.dev
MIT License
45 stars 1 forks source link

fix unary operator precedence #60

Open soc opened 1 year ago

soc commented 1 year ago

Currently we are forced to parenthesize -1 like ...

(-1).plus(2) == 1

... as otherwise the unary - would be applied last, meaning that ...

-1.plus(2)

... and ...

-1 + 2

return different results.

In the context of #6/#81 this means treating - as part of the number literal.