Closed legacy-backtick command substitutions currently turn an incomplete compound command inside the substitution into an eager parse failure for the entire outer script.
Reproduction:
printf 'BEFORE\n'; value=`if`; code=$?; printf 'STATUS:%s VALUE:<%s>\n' "$code" "$value"; printf 'AFTER\n'
Current behavior: parseShell throws ShellSyntaxError: Expected nonempty compound list, and Shell.exec exits 2 before the outer script runs.
GNU Bash 5.2.37 behavior: the closed substitution reports its own unexpected-EOF diagnostic and status 2, while the outer script continues:
BEFORE
STATUS:2 VALUE:<>
AFTER
This was reproduced in the trace-shell compatibility work with both MemoryFS and mock S3. The behavioral RED had 9 focused failures: simple and nested legacy backticks, diagnostic line context, both filesystem backends, and substitution-depth preservation.
The fix should defer only positively identified compound-list EOF errors inside a closed ordinary backtick. It must keep top-level input, $() substitutions, unclosed backticks, unrelated syntax errors, heredoc behavior, and nesting/substitution limits unchanged. Add parser and runtime regression coverage for simple and nested cases on MemoryFS and mock S3.
A pending local candidate passes the focused compatibility checks but is not on origin/main or released.
Closed legacy-backtick command substitutions currently turn an incomplete compound command inside the substitution into an eager parse failure for the entire outer script.
Reproduction:
Current behavior:
parseShellthrowsShellSyntaxError: Expected nonempty compound list, andShell.execexits 2 before the outer script runs.GNU Bash 5.2.37 behavior: the closed substitution reports its own unexpected-EOF diagnostic and status 2, while the outer script continues:
This was reproduced in the trace-shell compatibility work with both MemoryFS and mock S3. The behavioral RED had 9 focused failures: simple and nested legacy backticks, diagnostic line context, both filesystem backends, and substitution-depth preservation.
The fix should defer only positively identified compound-list EOF errors inside a closed ordinary backtick. It must keep top-level input,
$()substitutions, unclosed backticks, unrelated syntax errors, heredoc behavior, and nesting/substitution limits unchanged. Add parser and runtime regression coverage for simple and nested cases on MemoryFS and mock S3.A pending local candidate passes the focused compatibility checks but is not on
origin/mainor released.