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
.argsof theDefnode ((a, b, c = FIND_ME)) - enter its
.argslist(a, b, c = FIND_ME) - enter element
[2](c = FIND_ME) - enter
.defaultof theOptargnode (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 Patternimpl UnwindSafe for Pattern