Repository navigation
Fix associativity resolution with mixed shift precedences - #5796
Merged
Merged
Conversation
…hift 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 <[email protected]> (cherry picked from commit 0900f84)
2 tasks done
1 task
social4hyq
pushed a commit
to social4hyq/homebrew-core
that referenced
this pull request
Sep 20, 2026
tree-sitter 0.26.12 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## What's Changed * fix(generate): fold case-insensitive patterns ourselves by @WillLillis in tree-sitter/tree-sitter#5761 * fix(query): keep the trailing anchor when a zero-matched quantifier is anchored on both sides by @tree-sitter-ci-bot[bot] in tree-sitter/tree-sitter#5764 * fix(templates): add C source files to Python sdist by @WillLillis in tree-sitter/tree-sitter#5765 * fix(init): don't lowercase repository url by @tree-sitter-ci-bot[bot] in tree-sitter/tree-sitter#5768 * fix(highlight): use `std::sync::OnceCell` for various loader fields by @WillLillis in tree-sitter/tree-sitter#5785 * fix(parser): restart recovery for invalid tokens in the error state by @tree-sitter-ci-bot[bot] in tree-sitter/tree-sitter#5792 * Fix associativity resolution with mixed shift precedences by @tree-sitter-ci-bot[bot] in tree-sitter/tree-sitter#5796 * fix(parser): fix parsing bug repeat operator by @tree-sitter-ci-bot[bot] in tree-sitter/tree-sitter#5829 * release v0.26.12 by @clason in tree-sitter/tree-sitter#5831 **Full Changelog**: https://github.com/tree-sitter/tree-sitter/compare/v0.26.11...v0.26.12</pre> <p>View the full release notes at <a href="/web-api/iframe-proxy?url=https://github.comhttps://github.com/tree-sitter/tree-sitter/releases/tag/v0.26.12">https://github.com/tree-sitter/tree-sitter/releases/tag/v0.26.12</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!16260
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #5782 to
release-0.26.