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
I think it's clear that the whole "abc$(pwd)def" string should be a SINGLE argument in all cases. It is not working properly to generate it as a single argument (as a "concatenation" node) in the second case where backticks are used (without double quotes) to generate the command substitution. Note it is the only one that treesitter is parsing out to three arguments instead of the expected two.
I use this bash script to confirm the argument parsing that bash performs:
#!/bin/bash
ITERATION=1
while (( "$#" )); do
echo '$'"${ITERATION}: ${1}"
shift
(( ITERATION ++ ))
done
When replacing the echos with argshow above the output is as expected
I was considering doing something in my tool built on top of tree-sitter to auto-enumerate arguments and this is one wrinkle that would make it potentially incorrect. 😀
The text was updated successfully, but these errors were encountered:
unphased
changed the title
Is this a bug or not? String concatenation
Is this a bug or not? String concatenation of backtick command substitution generating spurious argument count
Sep 14, 2023
unphased
changed the title
Is this a bug or not? String concatenation of backtick command substitution generating spurious argument count
Is this a bug or not? String concatenation of backtick command substitution generating extra arguments
Sep 14, 2023
unphased
changed the title
Is this a bug or not? String concatenation of backtick command substitution generating extra arguments
Is this a bug or not? String concatenation of backtick command substitution generating extra argument splits
Sep 14, 2023
This code:
Parses out to (this is a copy of TSPlayground output):
I think it's clear that the whole "abc$(pwd)def" string should be a SINGLE argument in all cases. It is not working properly to generate it as a single argument (as a "concatenation" node) in the second case where backticks are used (without double quotes) to generate the command substitution. Note it is the only one that treesitter is parsing out to three arguments instead of the expected two.
I use this bash script to confirm the argument parsing that bash performs:
When replacing the
echo
s withargshow
above the output is as expectedI was considering doing something in my tool built on top of tree-sitter to auto-enumerate arguments and this is one wrinkle that would make it potentially incorrect. 😀
The text was updated successfully, but these errors were encountered: