Struct ruby_prism::IfNode
source · pub struct IfNode<'pr> { /* private fields */ }
Expand description
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
^^^^^^^^^^^^^^^
Implementations§
source§impl<'pr> IfNode<'pr>
impl<'pr> IfNode<'pr>
sourcepub fn flags(&self) -> pm_node_flags_t
pub fn flags(&self) -> pm_node_flags_t
Returns the flags of this node.
sourcepub fn if_keyword_loc(&self) -> Option<Location<'pr>>
pub fn if_keyword_loc(&self) -> Option<Location<'pr>>
Returns the if_keyword_loc
param
sourcepub fn then_keyword_loc(&self) -> Option<Location<'pr>>
pub fn then_keyword_loc(&self) -> Option<Location<'pr>>
Returns the then_keyword_loc
param
sourcepub fn statements(&self) -> Option<StatementsNode<'pr>>
pub fn statements(&self) -> Option<StatementsNode<'pr>>
Returns the statements
param
sourcepub fn subsequent(&self) -> Option<Node<'pr>>
pub fn subsequent(&self) -> Option<Node<'pr>>
Returns the subsequent
param
sourcepub fn end_keyword_loc(&self) -> Option<Location<'pr>>
pub fn end_keyword_loc(&self) -> Option<Location<'pr>>
Returns the end_keyword_loc
param
Trait Implementations§
Auto Trait Implementations§
impl<'pr> RefUnwindSafe for IfNode<'pr>
impl<'pr> !Send for IfNode<'pr>
impl<'pr> !Sync for IfNode<'pr>
impl<'pr> Unpin for IfNode<'pr>
impl<'pr> !UnwindSafe for IfNode<'pr>
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