pm_unless_node_t

Type Alias pm_unless_node_t 

Source
pub type pm_unless_node_t = pm_unless_node;
Expand description

UnlessNode

Represents the use of the unless keyword, either in the block form or the modifier form.

 bar unless foo
 ^^^^^^^^^^^^^^
 unless foo then bar end
 ^^^^^^^^^^^^^^^^^^^^^^^

Type: ::PM_UNLESS_NODE

@extends pm_node_t

Aliased Type§

#[repr(C)]
pub struct pm_unless_node_t { pub base: pm_node, pub keyword_loc: pm_location_t, pub predicate: *mut pm_node, pub then_keyword_loc: pm_location_t, pub statements: *mut pm_statements_node, pub else_clause: *mut pm_else_node, pub end_keyword_loc: pm_location_t, }

Fields§

§base: pm_node

The embedded base node.

§keyword_loc: pm_location_t

UnlessNode#keyword_loc

The location of the unless keyword.

 unless cond then bar end
 ^^^^^^
 bar unless cond
     ^^^^^^
§predicate: *mut pm_node

UnlessNode#predicate

The condition to be evaluated for the unless expression. It can be any non-void expression.

 unless cond then bar end
        ^^^^
 bar unless cond
            ^^^^
§then_keyword_loc: pm_location_t

UnlessNode#then_keyword_loc

The location of the then keyword, if present.

 unless cond then bar end
             ^^^^
§statements: *mut pm_statements_node

UnlessNode#statements

The body of statements that will executed if the unless condition is falsey. Will be nil if no body is provided.

 unless cond then bar end
                  ^^^
§else_clause: *mut pm_else_node

UnlessNode#else_clause

The else clause of the unless expression, if present.

 unless cond then bar else baz end
                      ^^^^^^^^
§end_keyword_loc: pm_location_t

UnlessNode#end_keyword_loc

The location of the end keyword, if present.

 unless cond then bar end
                      ^^^