Skip to content

fix: recovery for redirections missing destinations - #320

Open
notJoon wants to merge 1 commit into
tree-sitter:masterfrom
notJoon:fix/recover-from-missing-redirect-dests
Open

fix: recovery for redirections missing destinations#320
notJoon wants to merge 1 commit into
tree-sitter:masterfrom
notJoon:fix/recover-from-missing-redirect-dests

Conversation

@notJoon

@notJoon notJoon commented Feb 4, 2026

Copy link
Copy Markdown

Description

closes #319

Angle bracket placeholders like <path> are common in docs and injected code. In bash tree-sitter, this is invalid and currently produces a MISSING word node that can disrupt parsing for subsequent lines. This change keeps the syntax error but adds a recovery node so the tree reamins no issues.

Changes

  • add incomplete_redirect rule and allow it in redirected statements
  • keep redirected_statement restricted to file/heredoc redirects to avoid regressions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Angle brackets in arguments parsed as redirections, causing MISSING node and broken highlighting

1 participant