Struct lib_ruby_parser::nodes::If
source · #[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§
impl StructuralPartialEq for If
Auto Trait Implementations§
impl Freeze for If
impl RefUnwindSafe for If
impl Send for If
impl Sync for If
impl Unpin for If
impl UnwindSafe for If
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more