LambdaVar
represents the parameters being declared for a lambda. Effectively this node is everything contained within the parentheses. This includes all of the various parameter types, as well as block-local variable declarations.
-> (positional, optional = value, keyword:, █ local) do endAttributes
Ident
]
the list of block-local variable declarations
Params
the parameters being declared with the block
def initialize(params:, locals:, location:) @params = params @locals = locals @location = location @comments = [] endPublic Instance Methods Source
def ===(other) other.is_a?(LambdaVar) && params === other.params && ArrayMatch.call(locals, other.locals) endSource
def accept(visitor) visitor.visit_lambda_var(self) endSource
def child_nodes [params, *locals] endSource
def copy(params: nil, locals: nil, location: nil) node = LambdaVar.new( params: params || self.params, locals: locals || self.locals, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node endSource
def deconstruct_keys(_keys) { params: params, locals: locals, location: location, comments: comments } endSource
def empty? params.empty? && locals.empty? endSource
def format(q) q.format(params) if locals.any? q.text("; ") q.seplist(locals, BlockVar::SEPARATOR) { |local| q.format(local) } end 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