Skip to content

syntax: add exact parameter expansion feature spans - #804

Merged
ewhauser merged 1 commit into
mainfrom
ewhauser/param-expansion-feature-spans
Mar 30, 2026
Merged

ewhauser merged 1 commit into
mainfrom
ewhauser/param-expansion-feature-spans

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

  • add an End span to syntax.LangError so variant-gated parameter-expansion diagnostics can report exact trigger spans
  • anchor parameter-expansion feature diagnostics to the full triggering token sequence for flags, prefix operators, and nested expansions
  • shift LangError spans through chunked parsing and lock the behavior in parser/interpreter tests

Why

Parameter-expansion feature diagnostics were using interior parser positions instead of the exact token sequence that triggered the extension. That made editor-facing spans point inside ${...} instead of at the actual ${, ${", or ${( trigger.

Impact

Consumers of shell/syntax now get precise trigger spans for these feature-gated parameter-expansion diagnostics, and chunked execution preserves those spans when errors are re-based onto the full script.

Validation

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

@ewhauser
ewhauser merged commit d4c3bc0 into main Mar 30, 2026
16 checks passed
@ewhauser
ewhauser deleted the ewhauser/param-expansion-feature-spans branch March 30, 2026 15:51
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