decaf
decaf copied to clipboard
Fix non-associativity of non-eq comparison ops in LL1 grammar
Non-equal comparison operators such as <, >, ge, le come without associativity, yet current LL(1) grammar treats them as left associative, which can bring about erroneous parsing output when handling a < b < c
(this form should have triggered a syntax error)
This patch only fixes PA1B.
Although PA1A specifies that '<=' is nonassoc, we can still write a<b<c
and the parser is happy.
Maybe we just accept that, and let the subsequent semantic analysis do the job?