Class: YARP::UntilNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::UntilNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents the use of the ‘until` keyword, either in the block form or the modifier form.
until foo
^^^^^^^^^^^^^
until foo do end
^^^^^^^^^^^^^^^^^^^^
Instance Attribute Summary collapse
-
#flags ⇒ Object
readonly
attr_reader flags: Integer.
-
#keyword_loc ⇒ Object
readonly
attr_reader keyword_loc: Location.
-
#predicate ⇒ Object
readonly
attr_reader predicate: Node.
-
#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].
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(keyword_loc, predicate, statements, flags, location) ⇒ UntilNode
constructor
def initialize: (keyword_loc: Location, predicate: Node, statements: Node?, flags: Integer, location: Location) -> void.
-
#keyword ⇒ Object
def keyword: () -> String.
- #set_newline_flag(newline_marked) ⇒ Object
Constructor Details
#initialize(keyword_loc, predicate, statements, flags, location) ⇒ UntilNode
def initialize: (keyword_loc: Location, predicate: Node, statements: Node?, flags: Integer, location: Location) -> void
6096 6097 6098 6099 6100 6101 6102 |
# File 'lib/yarp/node.rb', line 6096 def initialize(keyword_loc, predicate, statements, flags, location) @keyword_loc = keyword_loc @predicate = predicate @statements = statements @flags = flags @location = location end |
Instance Attribute Details
#flags ⇒ Object (readonly)
attr_reader flags: Integer
6093 6094 6095 |
# File 'lib/yarp/node.rb', line 6093 def flags @flags end |
#keyword_loc ⇒ Object (readonly)
attr_reader keyword_loc: Location
6084 6085 6086 |
# File 'lib/yarp/node.rb', line 6084 def keyword_loc @keyword_loc end |
#predicate ⇒ Object (readonly)
attr_reader predicate: Node
6087 6088 6089 |
# File 'lib/yarp/node.rb', line 6087 def predicate @predicate end |
#statements ⇒ Object (readonly)
attr_reader statements: Node?
6090 6091 6092 |
# File 'lib/yarp/node.rb', line 6090 def statements @statements end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
6105 6106 6107 |
# File 'lib/yarp/node.rb', line 6105 def accept(visitor) visitor.visit_until_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
6114 6115 6116 |
# File 'lib/yarp/node.rb', line 6114 def child_nodes [predicate, statements] end |
#deconstruct_keys(keys) ⇒ Object
6122 6123 6124 |
# File 'lib/yarp/node.rb', line 6122 def deconstruct_keys(keys) { keyword_loc: keyword_loc, predicate: predicate, statements: statements, flags: flags, location: location } end |
#keyword ⇒ Object
def keyword: () -> String
6127 6128 6129 |
# File 'lib/yarp/node.rb', line 6127 def keyword keyword_loc.slice end |
#set_newline_flag(newline_marked) ⇒ Object
6109 6110 6111 |
# File 'lib/yarp/node.rb', line 6109 def set_newline_flag(newline_marked) predicate.set_newline_flag(newline_marked) end |