Skip to content

shell/syntax: recover glued test-like words - #812

Merged
ewhauser merged 5 commits into
mainfrom
ewhauser/glued-testlike-split
Mar 30, 2026
Merged

ewhauser merged 5 commits into
mainfrom
ewhauser/glued-testlike-split

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

  • add Word.TestLikeSplit() and TestLikeSplit so analyzers can recover glued comparison-like operators from a single parsed word
  • preserve operator positions and left/right word fragments without changing existing [[ ]] or test parse semantics
  • add parser-shape, quote-fidelity, and typedjson round-trip coverage for glued comparison-like words

Why

gbash currently flattens inputs like foo=bar into generic Word or CondWord nodes. Downstream linters then have to rescan source text to recover the operator and operands. This change moves that recovery into shell/syntax so tooling can consume typed AST-derived metadata instead.

Impact

  • external shell/syntax consumers can inspect glued test-like operands without reparsing source text
  • existing parser, printer, walker, simplifier, and runtime behavior remain unchanged
  • SPEC.md now documents the new public helper alongside the existing parse-fidelity helpers

Validation

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

@ewhauser ewhauser changed the title [codex] shell/syntax: recover glued test-like words shell/syntax: recover glued test-like words Mar 30, 2026
@ewhauser
ewhauser marked this pull request as ready for review March 30, 2026 20:47

@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: b29fe8b3cb

ℹ️ 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/testlike_split.go Resolved
@ewhauser
ewhauser force-pushed the ewhauser/glued-testlike-split branch from b29fe8b to a4a66a9 Compare March 30, 2026 21:01

@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: a4a66a96eb

ℹ️ 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/testlike_split.go Resolved

@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: 31c1ae0d60

ℹ️ 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/testlike_split.go Resolved

@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: 9a8cd48291

ℹ️ 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/testlike_split.go Resolved
@ewhauser
ewhauser merged commit a75d542 into main Mar 30, 2026
16 checks passed
@ewhauser
ewhauser deleted the ewhauser/glued-testlike-split branch March 30, 2026 21:55
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