Skip to content

syntax: broaden heredoc closer candidate metadata - #799

Merged
ewhauser merged 2 commits into
mainfrom
ewhauser/heredoc-closer-candidate-metadata
Mar 30, 2026
Merged

ewhauser merged 2 commits into
mainfrom
ewhauser/heredoc-closer-candidate-metadata

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

  • add token-level CloseCandidate metadata for heredoc closer lines
  • preserve full close-line metadata for non-prefix candidates like EOF, x EOF, and quoted/raw-token mismatches
  • round-trip the new metadata through typedjson and document the public contract in SPEC.md

Why

The parser only kept heredoc closer metadata when the normalized line was a prefix match. That forced downstream lint consumers to rescan heredoc bodies to recover indented, later-in-line, or quote-mismatched closer candidates.

Impact

Downstream rules can consume parser metadata directly for SH-104, SH-330, SH-332, and SH-333 style diagnostics while existing matched-closer behavior stays intact.

Validation

  • go test ./shell/syntax
  • go test ./shell/syntax/typedjson
  • make lint

@ewhauser ewhauser changed the title [codex] syntax: broaden heredoc closer candidate metadata yntax: broaden heredoc closer candidate metadata Mar 30, 2026
@ewhauser ewhauser changed the title yntax: broaden heredoc closer candidate metadata syntax: broaden heredoc closer candidate metadata Mar 30, 2026
@ewhauser
ewhauser marked this pull request as ready for review March 30, 2026 13:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f4c9b926c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread shell/syntax/parser.go Resolved
@ewhauser
ewhauser merged commit 12eb402 into main Mar 30, 2026
16 checks passed
@ewhauser
ewhauser deleted the ewhauser/heredoc-closer-candidate-metadata branch March 30, 2026 14:30
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