nomemory / andreinc-site

My personal blog
10 stars 4 forks source link

Shunting-yard SUBTRACTION operator associativity #1

Closed gaborkolozsy closed 2 years ago

gaborkolozsy commented 3 years ago

The Operator enum SUBTRACTION has RIGHT associativity. I think this is false by ie. 2 - 3 - 4 It's returns with 2, 3, 4, -, - which is wrong. Expected: 2, 3, -, 4, -

Change SUBTRACTION associativity to LEFT will be ok.

nomemory commented 2 years ago

@gaborkolozsy thanks for noticing this. I will do the change.