Skip to content

syntax: stop after heredoc body parse errors - #796

Merged
ewhauser merged 1 commit into
mainfrom
ewhauser/heredoc-parse-stop
Mar 30, 2026
Merged

ewhauser merged 1 commit into
mainfrom
ewhauser/heredoc-parse-stop

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

  • stop statement iteration after yielding a fatal heredoc parse error
  • keep the errored heredoc statement in the AST so closer metadata is still available
  • add a regression test for a heredoc body parse failure followed by later script text

Root Cause

getStmt now returns a statement when a heredoc body parse fails so the statement can carry HdocDelim metadata. stmts only stopped when getStmt returned nil, so parsing could continue and append later statements from the same input after an unrecoverable heredoc error.

Validation

  • go test ./shell/syntax
  • make lint

@ewhauser ewhauser changed the title [codex] syntax: stop after heredoc body parse errors syntax: stop after heredoc body parse errors Mar 30, 2026
@ewhauser
ewhauser marked this pull request as ready for review March 30, 2026 03:30
@ewhauser
ewhauser merged commit b42d51b into main Mar 30, 2026
16 checks passed
@ewhauser
ewhauser deleted the ewhauser/heredoc-parse-stop branch March 30, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant