Skip to content

Parser: Introduce RubyParameterNode and support block arguments#1585

Merged
marcoroth merged 1 commit intomainfrom
RubyParameterNode
Apr 3, 2026
Merged

Parser: Introduce RubyParameterNode and support block arguments#1585
marcoroth merged 1 commit intomainfrom
RubyParameterNode

Conversation

@marcoroth
Copy link
Copy Markdown
Owner

@marcoroth marcoroth commented Apr 2, 2026

This pull request adds block argument extraction to both ERBBlockNode and ERBRenderNode, refactors the render node structure, and unifies parameter representation across the parser.

We renamed RubyStrictLocalNodeRubyParameterNode to we can reuase the existing nodes from the strict locals for both ERBBlockNode and ERBRenderNode.

Now shared by both strict locals and block arguments. Added keyword, splat, and block booleans to distinguish all parameter types:

@ RubyParameterNode
├── name: "component"
├── default_value: 
├── kind: "positional"
└── required: true
<% items.each_with_index do |item, index| %>
  <%= item %>
<% end %>
@ ERBBlockNode
├── content: " items.each_with_index do |item, index| "
├── body: [...]
├── block_arguments: (2 items)
   ├── @ RubyParameterNode (name: "item", required: true)
   └── @ RubyParameterNode (name: "index", required: true)
└── end_node: ...

Follow up on #1583

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 2, 2026

npx https://pkg.pr.new/@herb-tools/formatter@1585
npx https://pkg.pr.new/@herb-tools/language-server@1585
npx https://pkg.pr.new/@herb-tools/linter@1585

commit: 642d0a8

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

🌿 Interactive Playground and Documentation Preview

A preview deployment has been built for this pull request. Try out the changes live in the interactive playground:


🌱 Grown from commit 642d0a8


✅ Preview deployment has been cleaned up.

@marcoroth marcoroth force-pushed the RubyParameterNode branch from 7bf60b9 to 642d0a8 Compare April 2, 2026 23:52
@marcoroth marcoroth merged commit 7f95faf into main Apr 3, 2026
32 checks passed
@marcoroth marcoroth deleted the RubyParameterNode branch April 3, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant