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
~~~~~~~~~~~~~~~~~
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Whenimpl UnwindSafe for WhenBlanket Implementations
Mutably borrows from an owned value. Read more