Class: YARP::PreExecutionNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::PreExecutionNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents the use of the ‘BEGIN` keyword.
BEGIN { foo }
^^^^^^^^^^^^^
Instance Attribute Summary collapse
-
#closing_loc ⇒ Object
readonly
attr_reader closing_loc: Location.
-
#keyword_loc ⇒ Object
readonly
attr_reader keyword_loc: Location.
-
#opening_loc ⇒ Object
readonly
attr_reader opening_loc: Location.
-
#statements ⇒ Object
readonly
attr_reader statements: Node?.
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void.
-
#child_nodes ⇒ Object
(also: #deconstruct)
def child_nodes: () -> Array[nil | Node].
-
#closing ⇒ Object
def closing: () -> String.
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(statements, keyword_loc, opening_loc, closing_loc, location) ⇒ PreExecutionNode
constructor
def initialize: (statements: Node?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location) -> void.
-
#keyword ⇒ Object
def keyword: () -> String.
-
#opening ⇒ Object
def opening: () -> String.
Constructor Details
#initialize(statements, keyword_loc, opening_loc, closing_loc, location) ⇒ PreExecutionNode
def initialize: (statements: Node?, keyword_loc: Location, opening_loc: Location, closing_loc: Location, location: Location) -> void
4837 4838 4839 4840 4841 4842 4843 |
# File 'lib/yarp/node.rb', line 4837 def initialize(statements, keyword_loc, opening_loc, closing_loc, location) @statements = statements @keyword_loc = keyword_loc @opening_loc = opening_loc @closing_loc = closing_loc @location = location end |
Instance Attribute Details
#closing_loc ⇒ Object (readonly)
attr_reader closing_loc: Location
4834 4835 4836 |
# File 'lib/yarp/node.rb', line 4834 def closing_loc @closing_loc end |
#keyword_loc ⇒ Object (readonly)
attr_reader keyword_loc: Location
4828 4829 4830 |
# File 'lib/yarp/node.rb', line 4828 def keyword_loc @keyword_loc end |
#opening_loc ⇒ Object (readonly)
attr_reader opening_loc: Location
4831 4832 4833 |
# File 'lib/yarp/node.rb', line 4831 def opening_loc @opening_loc end |
#statements ⇒ Object (readonly)
attr_reader statements: Node?
4825 4826 4827 |
# File 'lib/yarp/node.rb', line 4825 def statements @statements end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
4846 4847 4848 |
# File 'lib/yarp/node.rb', line 4846 def accept(visitor) visitor.visit_pre_execution_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
4852 4853 4854 |
# File 'lib/yarp/node.rb', line 4852 def child_nodes [statements] end |
#closing ⇒ Object
def closing: () -> String
4875 4876 4877 |
# File 'lib/yarp/node.rb', line 4875 def closing closing_loc.slice end |
#deconstruct_keys(keys) ⇒ Object
4860 4861 4862 |
# File 'lib/yarp/node.rb', line 4860 def deconstruct_keys(keys) { statements: statements, keyword_loc: keyword_loc, opening_loc: opening_loc, closing_loc: closing_loc, location: location } end |
#keyword ⇒ Object
def keyword: () -> String
4865 4866 4867 |
# File 'lib/yarp/node.rb', line 4865 def keyword keyword_loc.slice end |
#opening ⇒ Object
def opening: () -> String
4870 4871 4872 |
# File 'lib/yarp/node.rb', line 4870 def opening opening_loc.slice end |