Struct lib_ruby_parser::nodes::When [−][src]
#[repr(C)]pub struct When {
pub patterns: Vec<Node>,
pub body: Option<Box<Node>>,
pub keyword_l: Loc,
pub begin_l: Loc,
pub expression_l: Loc,
}Expand description
Represents a branch of the case statement (i.e. when foo)
Fields
patterns: Vec<Node>A list of values to compare/match against
body: Option<Box<Node>>Body of the when branch
keyword_l: LocLocation of the when keyword
case foo; when bar; end
~~~~begin_l: LocLocation of the then keyword
case foo; when bar then baz; end
~~~~then is optional, and so begin_l can be None
expression_l: LocLocation of the full expression
case foo; when bar then baz; end
~~~~~~~~~~~~~~~~~Implementations
Returns patterns field
Returns keyword_l field
Returns begin_l field
Returns expression_l field
Sets patterns field
Sets keyword_l field
Sets begin_l field
Sets expression_l field
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for When
impl UnwindSafe for When
Blanket Implementations
Mutably borrows from an owned value. Read more