You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Punctuation-separated variable expansions mis-parsed as concatenation with "$" #315
The expansion of non-braced variable names is incorrectly parsed when separated by punctuation. I think this is a minimal example... Bash will expand the following to foo/bar/ if FOO=foo and BAR=bar:
$FOO/$BAR/
but instead of two variable expansions, the term is parsed as (informally):
The tree below is from the playground, with anonymous nodes enabled to illustrate
Found using tree-sitter-bash 0.25.1; tree-sitter 0.25.2.
Equivalent parses are obtained in more realistic contexts, e.g. echo $FOO/$BAR/ and $FOO/$BAR/executable
The same occurs if the / characters are swapped for different (combinations of) punctuation, as long as they don't create a different statement type. E.g. the same parse is obtained with {., ?, -, :}, but not with characters that parse a list, redirected_statement, pipeline, etc, such as {&, >, ;}.
Activity