#[repr(C)]pub struct pm_if_node {
pub base: pm_node_t,
pub if_keyword_loc: pm_location_t,
pub predicate: *mut pm_node,
pub then_keyword_loc: pm_location_t,
pub statements: *mut pm_statements_node,
pub subsequent: *mut pm_node,
pub end_keyword_loc: pm_location_t,
}Expand description
IfNode
Represents the use of the if keyword, either in the block form or the modifier form, or a ternary expression.
bar if foo
^^^^^^^^^^ if foo then bar end
^^^^^^^^^^^^^^^^^^^ foo ? bar : baz
^^^^^^^^^^^^^^^Type: ::PM_IF_NODE
@extends pm_node_t
Fields§
§base: pm_node_tThe embedded base node.
if_keyword_loc: pm_location_tIfNode#if_keyword_loc
The location of the if keyword if present.
bar if foo
^^The if_keyword_loc field will be nil when the IfNode represents a ternary expression.
predicate: *mut pm_nodeIfNode#predicate
The node for the condition the IfNode is testing.
if foo
^^^
bar
end bar if foo
^^^ foo ? bar : baz
^^^then_keyword_loc: pm_location_tIfNode#then_keyword_loc
The location of the then keyword (if present) or the ? in a ternary expression, nil otherwise.
if foo then bar end
^^^^ a ? b : c
^statements: *mut pm_statements_nodeIfNode#statements
Represents the body of statements that will be executed when the predicate is evaluated as truthy. Will be nil when no body is provided.
if foo
bar
^^^
baz
^^^
endsubsequent: *mut pm_nodeIfNode#subsequent
Represents an ElseNode or an IfNode when there is an else or an elsif in the if statement.
if foo
bar
elsif baz
^^^^^^^^^
qux
^^^
end
^^^ if foo then bar else baz end
^^^^^^^^^^^^end_keyword_loc: pm_location_tIfNode#end_keyword_loc
The location of the end keyword if present, nil otherwise.
if foo
bar
end
^^^Trait Implementations§
Source§impl Clone for pm_if_node
impl Clone for pm_if_node
Source§fn clone(&self) -> pm_if_node
fn clone(&self) -> pm_if_node
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for pm_if_node
impl Debug for pm_if_node
Source§impl Default for pm_if_node
impl Default for pm_if_node
impl Copy for pm_if_node
Auto Trait Implementations§
impl Freeze for pm_if_node
impl RefUnwindSafe for pm_if_node
impl !Send for pm_if_node
impl !Sync for pm_if_node
impl Unpin for pm_if_node
impl UnwindSafe for pm_if_node
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)