Description
Backslash line continuation (\ at end of line) fails to parse in certain contexts, causing expected 'then' or expected 'fi' errors for valid bash scripts.
Reproduction
# Multi-line if condition (fails)
if [ -z "$A" ] || [ -z "$B" ] || \
[ -z "$C" ]; then
echo "missing"
fi
# parse error at line 1, column N: expected 'then'
# Multi-line command with continuation (fails)
az cognitiveservices model list --location "eastus" \
--query "foo" \
--output table
# parse error: expected 'fi' (when inside if block)
Source: skills.sh scripts
Found while running real-world skill scripts through bashkit parser:
microsoft-foundry/generate_deployment_url.sh line 67: multi-line if [ ] || \ condition
microsoft-foundry/query_capacity.sh lines 26-28: multi-line az command with \ continuation
microsoft-foundry/discover_and_rank.sh lines 20-23, 26-30: multi-line az rest calls
Cross-ref: specs/015-skills-analysis.md, tests/skills_tests.rs (parse tests pass after removing continuations)
Current behavior
The lexer has line continuation handling at lexer.rs:343, lexer.rs:489, lexer.rs:625 but it doesn't work in all token contexts. Continuation inside if conditions and inside $() command substitution appears broken.
Workaround
Join multi-line commands onto a single line (remove \ + newline). All tests pass after this transformation.
Description
Backslash line continuation (
\at end of line) fails to parse in certain contexts, causingexpected 'then'orexpected 'fi'errors for valid bash scripts.Reproduction
Source: skills.sh scripts
Found while running real-world skill scripts through bashkit parser:
microsoft-foundry/generate_deployment_url.shline 67: multi-lineif [ ] || \conditionmicrosoft-foundry/query_capacity.shlines 26-28: multi-lineazcommand with\continuationmicrosoft-foundry/discover_and_rank.shlines 20-23, 26-30: multi-lineaz restcallsCross-ref:
specs/015-skills-analysis.md,tests/skills_tests.rs(parse tests pass after removing continuations)Current behavior
The lexer has line continuation handling at
lexer.rs:343,lexer.rs:489,lexer.rs:625but it doesn't work in all token contexts. Continuation insideifconditions and inside$()command substitution appears broken.Workaround
Join multi-line commands onto a single line (remove
\+ newline). All tests pass after this transformation.