class YARP::ParenthesesNode
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/yarp/node.rbs class YARP::ParenthesesNode < YARP::Node def initialize: (YARP::StatementsNode body, YARP::Location opening_loc, YARP::Location closing_loc, YARP::Location location) -> void end
^^^^^^^^^
(10 + 34)
Represents a parenthesized expression
def accept(visitor)
def accept(visitor) visitor.visit_parentheses_node(self) end
def child_nodes
def child_nodes [body] end
def closing
def closing closing_loc.slice end
def comment_targets
def comment_targets [*body, opening_loc, closing_loc] end
def copy(**params)
def copy(**params) ParenthesesNode.new( params.fetch(:body) { body }, params.fetch(:opening_loc) { opening_loc }, params.fetch(:closing_loc) { closing_loc }, params.fetch(:location) { location }, ) end
def deconstruct_keys(keys)
def deconstruct_keys(keys) { body: body, opening_loc: opening_loc, closing_loc: closing_loc, location: location } end
def initialize(body, opening_loc, closing_loc, location)
Experimental RBS support (using type sampling data from the type_fusion
project).
def initialize: (YARP::StatementsNode body, YARP::Location opening_loc, YARP::Location closing_loc, YARP::Location location) -> void
This signature was generated using 1 sample from 1 application.
def initialize(body, opening_loc, closing_loc, location) @body = body @opening_loc = opening_loc @closing_loc = closing_loc @location = location end
def inspect(inspector = NodeInspector.new)
def inspect(inspector = NodeInspector.new) inspector << inspector.header(self) if (body = self.body).nil? inspector << "├── body: ∅\n" else inspector << "├── body:\n" inspector << body.inspect(inspector.child_inspector("│ ")).delete_prefix(inspector.prefix) end inspector << "├── opening_loc: #{inspector.location(opening_loc)}\n" inspector << "└── closing_loc: #{inspector.location(closing_loc)}\n" inspector.to_str end
def opening
def opening opening_loc.slice end
def set_newline_flag(newline_marked)
def set_newline_flag(newline_marked) # Never mark ParenthesesNode with a newline flag, mark children instead end