[][src]Struct lib_ruby_parser::nodes::If

pub struct If {
    pub cond: Box<Node>,
    pub if_true: Option<Box<Node>>,
    pub if_false: Option<Box<Node>>,
    pub keyword_l: Range,
    pub begin_l: Range,
    pub else_l: Option<Range>,
    pub end_l: Option<Range>,
    pub expression_l: Range,
}

Represents an if statement (i.e. if foo; bar; else; baz; end)

Fields

cond: Box<Node>

Condition given to the if statement, Lvar("a") for if a; b; else; c; end

if_true: Option<Box<Node>>

True-branch of the if statement, Lvar("b") for if a; b; else; c; end

if_false: Option<Box<Node>>

False-branch of the if statement, Lvar("c") for if a; b; else; c; end

keyword_l: Range

Location of the if keyword

if foo; end
~~
begin_l: Range

Location of the then keyword

if foo then; end
       ~~~~

None if then keyword is omitted

else_l: Option<Range>

Location of the else keyword

if foo; else; end
        ~~~~

None if there's no else branch

end_l: Option<Range>

Location of the end keyword

if foo; end
        ~~~
expression_l: Range

Location of the full expression

if a then; b; else; c end
~~~~~~~~~~~~~~~~~~~~~~~~~

Trait Implementations

impl Clone for If[src]

impl Debug for If[src]

impl PartialEq<If> for If[src]

impl StructuralPartialEq for If[src]

Auto Trait Implementations

impl !RefUnwindSafe for If

impl !Send for If

impl !Sync for If

impl Unpin for If

impl UnwindSafe for If

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.