precedence of operators reversed to treesitter #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If you parse
i < c + 1, you will get an AST that looks like this:I'm expecting the CompareOp to have a lower precedence than the ArithOp. Looking at tree-sitter grammar, this is indeed the case,
ADDhas a higher precedence thanREL.In the grammar here, you will first notice that the order is reversed (which could have caused some confusion), and it looks like that compare now has a higher precedence than addition.
github.com/lezer-parser/java@d89968838c/src/java.grammar (L1-L20)Can somebody recheck the precedence here? Thank you!
Yes, those were looking very confused. Attached patch fixes them.