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

#[repr(C)]pub struct If {
    pub cond: Ptr<Node>,
    pub if_true: MaybePtr<Node>,
    pub if_false: MaybePtr<Node>,
    pub keyword_l: LocPtr,
    pub begin_l: LocPtr,
    pub else_l: MaybeLocPtr,
    pub end_l: MaybeLocPtr,
    pub expression_l: LocPtr,
}

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

Fields

cond: Ptr<Node>

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

if_true: MaybePtr<Node>

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

if_false: MaybePtr<Node>

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

keyword_l: LocPtr

Location of the if keyword

if foo; end
~~
begin_l: LocPtr

Location of the then keyword

if foo then; end
       ~~~~

None if then keyword is omitted

else_l: MaybeLocPtr

Location of the else keyword

if foo; else; end
        ~~~~

None if there’s no else branch

end_l: MaybeLocPtr

Location of the end keyword

if foo; end
        ~~~
expression_l: LocPtr

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.