NodePattern Debugger
Pattern
(send _receiver # send nodes, to any receiver ${:foo :puts :bar} # with one of these method calls $... # and any arguments )
not matched
matched
not tested
argument
Matches
Current location set!
Make Permalink
Ruby Code
def example puts :hello puts 'world' end
match
additional matches
closest non-match
Ruby AST
Quick
reference
(type child ...)
matches the type and the children of a node with the given patterns
$pat
captures the match
_
wildcard, matches anything
^pat
matches the pattern against the parent
_named
first is a wildcard, others must match
`pat
matches the pattern against the descendants
...
matches any number of children
predicate?(...)
calls `predicate?` on the element to match
int
calls `int_type?` on the element
#method(...)
calls `method` with element as first argument
pat* pat+ pat ?
matches a variable number of children
%1
matches sequential argument with `=== element`
<pat pat2>
matches the patterns in any order
%named_param
matches named argument with `=== element`
{pat pat2 | pat3}
matches either `pat pat2` or `pat 3`
%CONST
matches the constant with `=== element`
{pat pat2}
shortcut for "{pat | pat2}"
# comment
comment
[pat pat2]
matches all patterns