Struct lib_ruby_parser::nodes::MatchCurrentLine
source · [−]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
sourceimpl Clone for MatchCurrentLine
impl Clone for MatchCurrentLine
sourcefn clone(&self) -> MatchCurrentLine
fn clone(&self) -> MatchCurrentLine
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for MatchCurrentLine
impl Debug for MatchCurrentLine
sourceimpl PartialEq<MatchCurrentLine> for MatchCurrentLine
impl PartialEq<MatchCurrentLine> for MatchCurrentLine
sourcefn eq(&self, other: &MatchCurrentLine) -> bool
fn eq(&self, other: &MatchCurrentLine) -> bool
impl StructuralPartialEq for MatchCurrentLine
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more