class Prism::ImplicitNode
表示一个隐式添加到树中,但不直接对应于源代码中节点的节点。
{ foo: } ^^^^ { Foo: } ^^^^ foo in { bar: } ^^^^
属性
attr_reader value: LocalVariableReadNode
| CallNode
| ConstantReadNode
| LocalVariableTargetNode
公共类方法
初始化一个新的 ImplicitNode
节点。
# File prism/node.rb, line 8737 def initialize(source, node_id, location, flags, value) @source = source @node_id = node_id @location = location @flags = flags @value = value end
返回此节点类型的符号表示。请参阅 'Node::type'。
# File prism/node.rb, line 8792 def self.type :implicit_node end
公共实例方法
为节点实现 case-equality。这实际上是 ==,但不比较位置的值。仅检查位置是否存在。
# File prism/node.rb, line 8798 def ===(other) other.is_a?(ImplicitNode) && (value === other.value) end
def accept: (Visitor
visitor) -> void
# File prism/node.rb, line 8746 def accept(visitor) visitor.visit_implicit_node(self) end
def child_nodes
: () -> Array[nil | Node]
# File prism/node.rb, line 8751 def child_nodes [value] end
def comment_targets
: () -> Array[Node | Location]
# File prism/node.rb, line 8761 def comment_targets [value] #: Array[Prism::node | Location] end
def compact_child_nodes
: () -> Array
# File prism/node.rb, line 8756 def compact_child_nodes [value] end
def copy: (?node_id: Integer, ?location: Location
, ?flags: Integer, ?value: LocalVariableReadNode
| CallNode
| ConstantReadNode
| LocalVariableTargetNode
) -> ImplicitNode
# File prism/node.rb, line 8766 def copy(node_id: self.node_id, location: self.location, flags: self.flags, value: self.value) ImplicitNode.new(source, node_id, location, flags, value) end
def deconstruct_keys
: (Array keys) -> { node_id: Integer, location: Location
, value: LocalVariableReadNode
| CallNode
| ConstantReadNode
| LocalVariableTargetNode
}
# File prism/node.rb, line 8774 def deconstruct_keys(keys) { node_id: node_id, location: location, value: value } end
def inspect -> String
# File prism/node.rb, line 8782 def inspect InspectVisitor.compose(self) end
返回此节点类型的符号表示。请参阅 'Node#type'。
# File prism/node.rb, line 8787 def type :implicit_node end