class Prism::SplatNode
Repräsentiert die Verwendung des Splat-Operators.
[*a] ^^
Attribute
attr_reader expression: Prism::node?
Öffentliche Klassenmethoden
Source
# File lib/prism/node.rb, line 16911 def initialize(source, node_id, location, flags, operator_loc, expression) @source = source @node_id = node_id @location = location @flags = flags @operator_loc = operator_loc @expression = expression end
Initialisiert einen neuen SplatNode-Knoten.
Source
# File lib/prism/node.rb, line 16987 def self.type :splat_node end
Gibt eine symbolische Darstellung dieses Knotentyps zurück. Siehe Node::type.
Öffentliche Instanzmethoden
Source
# File lib/prism/node.rb, line 16993 def ===(other) other.is_a?(SplatNode) && (operator_loc.nil? == other.operator_loc.nil?) && (expression === other.expression) end
Implementiert die Fallgleichheit für den Knoten. Dies ist effektiv ==, aber ohne den Wert von Standorten zu vergleichen. Standorte werden nur auf Anwesenheit geprüft.
Source
# File lib/prism/node.rb, line 16921 def accept(visitor) visitor.visit_splat_node(self) end
def accept: (Visitor visitor) -> void
Source
# File lib/prism/node.rb, line 16926 def child_nodes [expression] end
def child_nodes: () -> Array
Source
# File lib/prism/node.rb, line 16938 def comment_targets [operator_loc, *expression] #: Array[Prism::node | Location] end
def comment_targets: () -> Array[Node | Location]
Source
# File lib/prism/node.rb, line 16931 def compact_child_nodes compact = [] #: Array[Prism::node] compact << expression if expression compact end
def compact_child_nodes: () -> Array
Source
# File lib/prism/node.rb, line 16943 def copy(node_id: self.node_id, location: self.location, flags: self.flags, operator_loc: self.operator_loc, expression: self.expression) SplatNode.new(source, node_id, location, flags, operator_loc, expression) end
Source
# File lib/prism/node.rb, line 16951 def deconstruct_keys(keys) { node_id: node_id, location: location, operator_loc: operator_loc, expression: expression } end
def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location, operator_loc: Location, expression: Prism::node? }
Source
# File lib/prism/node.rb, line 16977 def inspect InspectVisitor.compose(self) end
def inspect -> String
Source
# File lib/prism/node.rb, line 16972 def operator operator_loc.slice end
def operator: () -> String
Source
# File lib/prism/node.rb, line 16956 def operator_loc location = @operator_loc return location if location.is_a?(Location) @operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF) end
attr_reader operator_loc: Location
Source
# File lib/prism/node.rb, line 16964 def save_operator_loc(repository) repository.enter(node_id, :operator_loc) end
Speichert die Position von operator_loc unter Verwendung der angegebenen gespeicherten Quelle, damit sie später abgerufen werden kann.