lib-ruby-parser (C++ bindings)  4.0.1+ruby-3.1.1
C++ bindings for lib-ruby-parser library
lib_ruby_parser::Procarg0 Class Reference

#include <nodes.hpp>

Public Attributes

NodeList args
 
MaybeLoc begin_l
 
MaybeLoc end_l
 
Loc expression_l
 

Detailed 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).

Member Data Documentation

◆ args

NodeList lib_ruby_parser::Procarg0::args

Parts of the sole block argument.

proc { |(a, b)| } also counts as a sole argument, so this list may contain:

  1. A single Arg node (for proc { |a| } case)
  2. Multiple Arg nodes (for proc { |(a, b, c)| } case)

◆ begin_l

MaybeLoc lib_ruby_parser::Procarg0::begin_l

Location of the open parenthesis

proc { |(foo, bar)| }
^

None if there's only one argument

◆ end_l

MaybeLoc lib_ruby_parser::Procarg0::end_l

Location of the open parenthesis

proc { |(foo, bar)| }
^

None if there's only one argument

◆ expression_l

Loc lib_ruby_parser::Procarg0::expression_l

Location of the full expression

proc { |(foo, bar)| }
^^^^^^^^^^

The documentation for this class was generated from the following file: