ruby-syntax-tree / syntax_tree

Interact with the Ruby syntax tree
https://ruby-syntax-tree.github.io/syntax_tree/
MIT License
563 stars 54 forks source link

CapturePatternNode #354

Closed kddnewton closed 1 year ago

kddnewton commented 1 year ago

Right now, when you capture an expression into a variable in pattern matching, we get a binary node. For example,

case foo
in Bar => baz
end

Instead, we should create a new node to represent this pattern. YARP calls this AsPatternNode but I don't like the name and am going to rename it to CapturePatternNode to be more clear.