Struct lib_ruby_parser::nodes::MatchCurrentLine [−][src]
Expand description
Represents implicit matching using if /regex/
if /.*/
puts 'true'
else
puts 'false'
end
Prints “false”.
Under the hood this construction matches regex against $_
, so the following works:
$_ = 'match_me'
if /match_me/
puts 'true'
else
puts 'false'
end
this code prints “true”.
Fields
re: Box<Node>
Given regex
expression_l: Loc
Location of the regex
if /re/; end
~~~~
Technically this location is redundant, but keeping it is the only way to have the same interface for all nodes.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for MatchCurrentLine
impl Send for MatchCurrentLine
impl Sync for MatchCurrentLine
impl Unpin for MatchCurrentLine
impl UnwindSafe for MatchCurrentLine
Blanket Implementations
Mutably borrows from an owned value. Read more