Class: YARP::RegularExpressionNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::RegularExpressionNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents a regular expression literal with no interpolation.
/foo/i
^^^^^^
Instance Attribute Summary collapse
-
#closing_loc ⇒ Object
readonly
attr_reader closing_loc: Location.
-
#content_loc ⇒ Object
readonly
attr_reader content_loc: Location.
-
#flags ⇒ Object
readonly
attr_reader flags: Integer.
-
#opening_loc ⇒ Object
readonly
attr_reader opening_loc: Location.
-
#unescaped ⇒ Object
readonly
attr_reader unescaped: String.
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.
-
#content ⇒ Object
def content: () -> String.
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(opening_loc, content_loc, closing_loc, unescaped, flags, location) ⇒ RegularExpressionNode
constructor
def initialize: (opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, flags: Integer, location: Location) -> void.
-
#opening ⇒ Object
def opening: () -> String.
Constructor Details
#initialize(opening_loc, content_loc, closing_loc, unescaped, flags, location) ⇒ RegularExpressionNode
def initialize: (opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, flags: Integer, location: Location) -> void
5054 5055 5056 5057 5058 5059 5060 5061 |
# File 'lib/yarp/node.rb', line 5054 def initialize(opening_loc, content_loc, closing_loc, unescaped, flags, location) @opening_loc = opening_loc @content_loc = content_loc @closing_loc = closing_loc @unescaped = unescaped @flags = flags @location = location end |
Instance Attribute Details
#closing_loc ⇒ Object (readonly)
attr_reader closing_loc: Location
5045 5046 5047 |
# File 'lib/yarp/node.rb', line 5045 def closing_loc @closing_loc end |
#content_loc ⇒ Object (readonly)
attr_reader content_loc: Location
5042 5043 5044 |
# File 'lib/yarp/node.rb', line 5042 def content_loc @content_loc end |
#flags ⇒ Object (readonly)
attr_reader flags: Integer
5051 5052 5053 |
# File 'lib/yarp/node.rb', line 5051 def flags @flags end |
#opening_loc ⇒ Object (readonly)
attr_reader opening_loc: Location
5039 5040 5041 |
# File 'lib/yarp/node.rb', line 5039 def opening_loc @opening_loc end |
#unescaped ⇒ Object (readonly)
attr_reader unescaped: String
5048 5049 5050 |
# File 'lib/yarp/node.rb', line 5048 def unescaped @unescaped end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
5064 5065 5066 |
# File 'lib/yarp/node.rb', line 5064 def accept(visitor) visitor.visit_regular_expression_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
5070 5071 5072 |
# File 'lib/yarp/node.rb', line 5070 def child_nodes [] end |
#closing ⇒ Object
def closing: () -> String
5093 5094 5095 |
# File 'lib/yarp/node.rb', line 5093 def closing closing_loc.slice end |
#content ⇒ Object
def content: () -> String
5088 5089 5090 |
# File 'lib/yarp/node.rb', line 5088 def content content_loc.slice end |
#deconstruct_keys(keys) ⇒ Object
5078 5079 5080 |
# File 'lib/yarp/node.rb', line 5078 def deconstruct_keys(keys) { opening_loc: opening_loc, content_loc: content_loc, closing_loc: closing_loc, unescaped: unescaped, flags: flags, location: location } end |
#opening ⇒ Object
def opening: () -> String
5083 5084 5085 |
# File 'lib/yarp/node.rb', line 5083 def opening opening_loc.slice end |