Class: YARP::NextNode

Inherits:
YARPNode
  • Object
show all
Defined in:
lib/yarp/node.rb,
ext/yarp/api_node.c

Overview

Represents the use of the ‘next` keyword.

next 1
^^^^^^

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arguments, keyword_loc, location) ⇒ NextNode

def initialize: (arguments: Node?, keyword_loc: Location, location: Location) -> void



4294
4295
4296
4297
4298
# File 'lib/yarp/node.rb', line 4294

def initialize(arguments, keyword_loc, location)
  @arguments = arguments
  @keyword_loc = keyword_loc
  @location = location
end

Instance Attribute Details

#argumentsObject (readonly)

attr_reader arguments: Node?



4288
4289
4290
# File 'lib/yarp/node.rb', line 4288

def arguments
  @arguments
end

#keyword_locObject (readonly)

attr_reader keyword_loc: Location



4291
4292
4293
# File 'lib/yarp/node.rb', line 4291

def keyword_loc
  @keyword_loc
end

Instance Method Details

#accept(visitor) ⇒ Object

def accept: (visitor: Visitor) -> void



4301
4302
4303
# File 'lib/yarp/node.rb', line 4301

def accept(visitor)
  visitor.visit_next_node(self)
end

#child_nodesObject Also known as: deconstruct

def child_nodes: () -> Array[nil | Node]



4307
4308
4309
# File 'lib/yarp/node.rb', line 4307

def child_nodes
  [arguments]
end

#deconstruct_keys(keys) ⇒ Object

def deconstruct_keys: (keys: Array) -> Hash[Symbol, nil | Node | Array | String | Token | Array | Location]



4315
4316
4317
# File 'lib/yarp/node.rb', line 4315

def deconstruct_keys(keys)
  { arguments: arguments, keyword_loc: keyword_loc, location: location }
end

#keywordObject

def keyword: () -> String



4320
4321
4322
# File 'lib/yarp/node.rb', line 4320

def keyword
  keyword_loc.slice
end