Skip to content

align grammar with parser by introducing PipeElement - #82

Open
WindSoilder wants to merge 3 commits into
copilot/attributefrom
align_grammar
Open

WindSoilder wants to merge 3 commits into
copilot/attributefrom
align_grammar

Conversation

@WindSoilder

@WindSoilder WindSoilder commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

This PR aligns the parser implementation with contributing/grammar.md by
introducing PipeElement and making pipelines/redirections more explicit in
the AST.

This branch is stacked on top of #81.

Changes

  • introduce PipeElement { expr, redirection }
  • distinguish single expressions from multi-element pipelines
  • make pipeline require 2+ elements
  • add pipeline_or_expression / pipeline_or_expression_or_assignment
  • add explicit pipe nodes:
    • Pipe
    • ErrPipe
    • OutErrPipe
  • add explicit redirection nodes:
    • OutRedirect
    • ErrRedirect
    • OutErrRedirect
  • store pipeline connectors separately in Pipeline { nodes, nexts }
  • extend Call with:
    • has_caret
    • as_alias
  • reuse call(true) for alias parsing
  • refactor block parsing by splitting out statement_sequence

Grammar alignment

Notable grammar updates:

  • statement now routes through pipeline_or_expression_or_assignment
  • pipeline now means 2+ pipe_elements
  • let / mut accept pipeline_or_expression
  • postfix now works on simple_expression
  • simple_expression replaces the older broader primary role in this area

@WindSoilder
WindSoilder added this pull request to stack #80 September 23, 2026 23:09
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