Struct lib_ruby_parser::nodes::Procarg0
source · #[repr(C)]pub struct Procarg0 {
pub args: Vec<Node>,
pub begin_l: Option<Loc>,
pub end_l: Option<Loc>,
pub expression_l: Loc,
}
Expand description
Represents a sole block argument (e.g. |foo|
)
Block that takes a single array argument automatically expands it.
Adding trailing comma after block argument disables this behavior (and then the only argument is emitted as Arg
).
Fields§
§args: Vec<Node>
Parts of the sole block argument.
proc { |(a, b)| }
also counts as a sole argument, so this list may contain:
- A single
Arg
node (forproc { |a| }
case) - Multiple
Arg
nodes (forproc { |(a, b, c)| }
case)
begin_l: Option<Loc>
Location of the open parenthesis
proc { |(foo, bar)| }
~
None
if there’s only one argument
end_l: Option<Loc>
Location of the open parenthesis
proc { |(foo, bar)| }
~
None
if there’s only one argument
expression_l: Loc
Location of the full expression
proc { |(foo, bar)| }
~~~~~~~~~~
Trait Implementations§
source§impl PartialEq for Procarg0
impl PartialEq for Procarg0
impl StructuralPartialEq for Procarg0
Auto Trait Implementations§
impl Freeze for Procarg0
impl RefUnwindSafe for Procarg0
impl Send for Procarg0
impl Sync for Procarg0
impl Unpin for Procarg0
impl UnwindSafe for Procarg0
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