Skip to content

syntax: type stray closing keyword parse errors - #801

Merged
ewhauser merged 1 commit into
mainfrom
ewhauser/typed-stray-closing-keyword-metadata
Mar 30, 2026
Merged

ewhauser merged 1 commit into
mainfrom
ewhauser/typed-stray-closing-keyword-metadata

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

  • populate ParseError metadata for stray closing keywords and stray } tokens
  • preserve the existing parser and bash-compatible error text while adding typed Construct and Unexpected fields
  • add parser and public API regression tests for these stray-closer cases

Root cause

Stray closing keywords were reaching parser error paths that only populated ParseError.Text, which left callers without structured construct metadata for these diagnostics.

Impact

Callers inspecting parser failures can now distinguish stray if/loop/case/block closers through typed parse error metadata instead of string matching.

Validation

  • make lint
  • go test ./shell/syntax

@ewhauser
ewhauser merged commit 116f3b0 into main Mar 30, 2026
16 checks passed
@ewhauser
ewhauser deleted the ewhauser/typed-stray-closing-keyword-metadata branch March 30, 2026 15:45
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