Skip to content

Conversation

zx1239856
Copy link

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)

@Hoblovski Hoblovski added the bug Something isn't working label Jul 20, 2020
@Hoblovski
Copy link
Member

Hoblovski commented Jul 20, 2020

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?

@Hoblovski Hoblovski added question Further information is requested and removed bug Something isn't working labels Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants