Struct lib_ruby_parser::nodes::If [−][src]
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
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,