Skip to content

syntax: expose IfClause kind metadata - #806

Merged
ewhauser merged 2 commits into
mainfrom
ewhauser/ifclause-kind-metadata
Mar 30, 2026
Merged

ewhauser merged 2 commits into
mainfrom
ewhauser/ifclause-kind-metadata

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

  • add explicit IfClause.Kind metadata with if, elif, and else constants on parsed syntax trees
  • populate branch kind metadata during parsing and preserve it through typedjson round-trips
  • cover the public API surface in syntax tests and document the new AST metadata in SPEC.md

Why

Callers had to inspect source text at IfClause.Position to distinguish if, elif, and else nodes. Exposing the branch kind directly makes AST consumers and analyzers simpler and less brittle.

Validation

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

@ewhauser
ewhauser merged commit b76f77c into main Mar 30, 2026
16 checks passed
@ewhauser
ewhauser deleted the ewhauser/ifclause-kind-metadata branch March 30, 2026 16:15
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