Struct lib_ruby_parser::traverse::finder::Pattern [−][src]
pub struct Pattern { /* fields omitted */ }
Expand description
Pattern that is used for matching.
Consists of multiple finder::Item
elements
For example the following pattern:
Pattern::new("args -> arglist -> 2 -> default")
can find a node that represents constant FIND_ME
in the following code:
def foo(a, b, c = FIND_ME)
end
It means:
- enter
.args
of theDef
node ((a, b, c = FIND_ME
)) - enter its
.argslist
(a, b, c = FIND_ME
) - enter element
[2]
(c = FIND_ME
) - enter
.default
of theOptarg
node (FIND_ME
)
Implementations
Constructs a pattern from a string, returns an error on the first sub-pattern error
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Pattern
impl UnwindSafe for Pattern