mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:26:23 -04:00
A SHIFT/REDUCE conflict can bundle several shift interpretations with different precedences against a single reduce. `handle_conflict` weighed them with only `shift_is_less` and `shift_is_more`, so a lone lower-precedence shift set `shift_is_less` and the REDUCE won outright, even when another interpretation tied the REDUCE in precedence and the REDUCE was declared right-associative. That tie's associativity should have won by shifting, so a right-associative rule silently became left-associative as soon as an unrelated lower-precedence rule was added to the grammar. Track the equal-precedence case explicitly, and in the reduce-wins branch shift instead when a tying interpretation exists and the reduce actions are purely right-associative. Co-authored-by: Will Lillis <will.lillis24@gmail.com> |
||
|---|---|---|
| .. | ||
| error_corpus | ||
| grammars | ||
| template_corpus | ||
| test_grammars | ||
| fixtures.json | ||