Version
v0.25.1 (commit a06c2e4)
Minimal reproduction
This parses correctly (no spaces in quoted string):
if [[ "${tmp}" = *"AB"* ]]; then
echo "ok"
fi
This fails (space in quoted string):
if [[ "${tmp}" = *"A B"* ]]; then
echo "ok"
fi
Expected behavior
Both should parse as a valid if_statement with a test_command containing a binary_expression.
Actual behavior
The second example produces an ERROR node spanning the entire if statement:
(program [0, 0] - [3, 0]
(ERROR [0, 0] - [2, 2]
(ERROR [0, 6] - [0, 20]
Real-world example
This pattern is common for checking certificate contents:
if [[ "${tmp}" = *"-----BEGIN CERTIFICATE-----"* ]]; then
# ...
fi
The space in "BEGIN CERTIFICATE" triggers the parse failure, causing syntax highlighting to break for everything inside the function.
Notes
- Without glob stars,
"A B" parses fine: [[ "${tmp}" = "A B" ]] ✓
- Without spaces, glob pattern parses fine:
[[ "${tmp}" = *"AB"* ]] ✓
- The combination
*"string with space"* fails
Version
v0.25.1 (commit a06c2e4)
Minimal reproduction
This parses correctly (no spaces in quoted string):
This fails (space in quoted string):
Expected behavior
Both should parse as a valid
if_statementwith atest_commandcontaining abinary_expression.Actual behavior
The second example produces an ERROR node spanning the entire if statement:
Real-world example
This pattern is common for checking certificate contents:
The space in "BEGIN CERTIFICATE" triggers the parse failure, causing syntax highlighting to break for everything inside the function.
Notes
"A B"parses fine:[[ "${tmp}" = "A B" ]]✓[[ "${tmp}" = *"AB"* ]]✓*"string with space"*fails