Field
is always the child of an assignment. It represents assigning to a “field” on an object.
object.variable = valueAttributes
Const
| Ident
the name of the field being assigned
Op
| Period
the operator being used for the assignment
Node
the parent object that owns the field being assigned
def initialize(parent:, operator:, name:, location:) @parent = parent @operator = operator @name = name @location = location @comments = [] endPublic Instance Methods Source
def ===(other) other.is_a?(Field) && parent === other.parent && operator === other.operator && name === other.name endSource
def accept(visitor) visitor.visit_field(self) endSource
def child_nodes operator = self.operator [parent, (operator if operator != :"::"), name] endSource
def copy(parent: nil, operator: nil, name: nil, location: nil) node = Field.new( parent: parent || self.parent, operator: operator || self.operator, name: name || self.name, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node endSource
def deconstruct_keys(_keys) { parent: parent, operator: operator, name: name, location: location, comments: comments } endSource
def format(q) q.group do q.format(parent) q.format(CallOperatorFormatter.new(operator), stackable: false) q.format(name) 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