robhagemans / pcbasic

PC-BASIC - A free, cross-platform emulator for the GW-BASIC family of interpreters
http://www.pc-basic.org
Other
396 stars 48 forks source link

Fix operator precedence for unary + and - #150

Closed rbergen closed 2 years ago

rbergen commented 2 years ago

This fixes #132. It does this by including the arity of an operator in the precedence dictionary and lookup.

Interestingly enough, the existing comment

# key is tuple (token, nargs)

above the PRECEDENCE dictionary seems to indicate that the operator arity was included in the dictionary key at some point in the past?

robhagemans commented 2 years ago

Merged