NodePattern Debugger
Pattern
(send nil? :enum (hash <(pair (sym :_prefix) true) ...>))
not matched
matched
not tested
argument
Matches
Current location set!
Make Permalink
Ruby Code
def example enum bla: { active: 0, not_active: 1 }, _prefix:true 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