[][src]Struct lib_ruby_parser::nodes::MatchCurrentLine

pub struct MatchCurrentLine {
    pub re: Node,
    pub expression_l: Range,
}

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: Node

Given regex

expression_l: Range

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

impl Clone for MatchCurrentLine[src]

impl Debug for MatchCurrentLine[src]

impl PartialEq<MatchCurrentLine> for MatchCurrentLine[src]

impl StructuralPartialEq for MatchCurrentLine[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.