Struct lib_ruby_parser::nodes::If [−][src]
#[repr(C)]pub struct If { pub cond: Box<Node>, pub if_true: Option<Box<Node>>, pub if_false: Option<Box<Node>>, pub keyword_l: Loc, pub begin_l: Loc, pub else_l: Option<Loc>, pub end_l: Option<Loc>, pub expression_l: Loc, }
Expand description
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: Loc
Location of the if
keyword
if foo; end
~~
begin_l: Loc
Location of the then
keyword
if foo then; end
~~~~
None
if then
keyword is omitted
else_l: Option<Loc>
Location of the else
keyword
if foo; else; end
~~~~
None
if there’s no else
branch
end_l: Option<Loc>
Location of the end
keyword
if foo; end
~~~
expression_l: Loc
Location of the full expression
if a then; b; else; c end
~~~~~~~~~~~~~~~~~~~~~~~~~
Trait Implementations
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more