tree-sitter.tree-sitter/test/fixtures
Sjoerd Langkemper 0900f84eab fix(generate): honor right associativity despite a lower-precedence shift
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>
2026-07-27 02:06:35 -04:00
..
error_corpus chore: update javascript error trees 2024-02-02 03:06:38 -05:00
grammars Rename spec -> test 2017-03-09 20:40:01 -08:00
template_corpus Add tests that randomly edit files with disjoint included ranges 2022-11-14 16:04:37 -08:00
test_grammars fix(generate): honor right associativity despite a lower-precedence shift 2026-07-27 02:06:35 -04:00
fixtures.json test: bump c test fixture to v0.24.2 2026-04-23 03:31:00 -04:00