Skip to content

tree-sitter-bash gaps covered by unbash #6

Open

Description

@webpro

Compared with tree-sitter-bash v0.25.1 (published Dec 2, 2025), unbash handles valid Bash cases that remain open in its upstream tracker. Rechecked October 14, 2026 with unbash v6 against the 0.25.1 grammar through both the native binding and web-tree-sitter 0.27.1, which produce identical trees; every linked issue was open on that date:

  • Bash 5.3 ${ command; } and ${| command; } substitutions (#301)
  • Command boundaries after assignment-only lines, negated assignment-only conditions, a newline after a multi-stage pipeline, consecutive if statements after a redirected pipeline, and single-bracket tests around redirects (#342, #318, #228, #295, #347, #304, #316)
  • Heredocs before a command, empty heredoc delimiters, heredoc headers followed by ; or by a redirect and a pipe, herestrings after file redirects, numbered-file-descriptor herestrings, <> read-write redirects, redirects after a list or pipeline owned by the last command, and arithmetic expansions inside heredoc bodies (#305, #283, #346, #350, #282, #232, #226, #352, #345, #325)
  • Stable word boundaries around escaped whitespace and #, line continuations before #, adjacent and punctuation-separated expansions, positional parameters, locale strings, backtick substitutions adjacent to quoted strings or containing comments, leading spaces or escaped quotes, and $(( opening a command substitution (#68, #284, #354, #315, #180, #306, #258, #116, #278, #215, #214)
  • Structured parameter and array expansions with ternary slice expressions, concatenated associative-array indexes, unquoted pipes, ] in patterns, escaped } in patterns, nested indexes, semicolons, punctuation in operands, and substring replacement and quoted nested patterns (#317, #268, #290, #285, #274, #259, #272, #267, #280, #279, #254)
  • Extglobs when Bash's extglob option is active, extglobs after *, ?, . or quoted prefixes in [[ ]], leading-hyphen case patterns, [[ ]] glob and regex operands containing quoted spaces, single-bracket escaped groups, and base-prefixed arithmetic operands such as 10#$n (#313, #246, #336, #321, #275, #269, #351)
  • The five constructs of #349: compound while conditions ending right before do, ) inside bracket expressions in case and [[ ]] patterns, case patterns mixing * with quoted strings, a bare - operand in [ ], and heredoc body lines that merely begin with the delimiter

Struck entries were listed before: #254 and #275 parse correctly in 0.25.1, and #336 parses with correct boundaries and only mislabels the node kind of the first pattern.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions