Skip to content

syntax: classify ${~foo} as typed zsh feature - #803

Merged
ewhauser merged 4 commits into
mainfrom
ewhauser/typed-zsh-glob-subst-feature
Mar 30, 2026
Merged

ewhauser merged 4 commits into
mainfrom
ewhauser/typed-zsh-glob-subst-feature

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

  • classify non-zsh ${~foo} parsing as a typed syntax.LangError with a stable feature ID instead of a generic invalid parameter name parse error
  • preserve the ${~foo} prefix in the zsh AST/printer and add syntax regression coverage for both metadata and file tests
  • keep zsh ${~foo} expansion explicitly unsupported for now so parsing does not silently degrade into plain ${foo} behavior

Why

${~foo} was being rejected before the variant-gated feature-reporting path ran, so callers only saw a generic parse error and could not match a stable FeatureID/FeatureDetail.

Impact

Analyzers and tooling can now reliably classify this zsh-only parameter-expansion prefix through syntax.LangError.FeatureID, FeatureDetail, and Category().

Validation

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

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

ℹ️ 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/lang_features.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: 118570bbdc

ℹ️ 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
Comment thread shell/syntax/parser.go Resolved
@ewhauser
ewhauser force-pushed the ewhauser/typed-zsh-glob-subst-feature branch from 118570b to fca3b34 Compare March 30, 2026 16:14
@ewhauser
ewhauser merged commit e89dd67 into main Mar 30, 2026
16 checks passed
@ewhauser
ewhauser deleted the ewhauser/typed-zsh-glob-subst-feature branch March 30, 2026 16:21
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