ArgParen
represents wrapping arguments to a method inside a set of parentheses.
method(argument)
In
the example above, there would be an ArgParen
node around the Args
node that represents the set of arguments being sent to the method method. The argument child node can be nil
if no arguments were passed, as in:
method()Attributes Public Class Methods Source
def initialize(arguments:, location:) @arguments = arguments @location = location @comments = [] endPublic Instance Methods Source
def ===(other) other.is_a?(ArgParen) && arguments === other.arguments endSource
def accept(visitor) visitor.visit_arg_paren(self) endSource
def arity arguments&.arity || 0 endSource
def child_nodes [arguments] endSource
def copy(arguments: nil, location: nil) node = ArgParen.new( arguments: arguments || self.arguments, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node endSource
def deconstruct_keys(_keys) { arguments: arguments, location: location, comments: comments } endSource
def format(q) unless arguments q.text("()") return end q.text("(") q.group do q.indent do q.breakable_empty q.format(arguments) q.if_break { q.text(",") } if q.trailing_comma? && trailing_comma? end q.breakable_empty end q.text(")") end
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4