Class: YARP::InterpolatedRegularExpressionNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::InterpolatedRegularExpressionNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents a regular expression literal that contains interpolation.
/foo #{bar} baz/
^^^^^^^^^^^^^^^^
Instance Attribute Summary collapse
-
#closing_loc ⇒ Object
readonly
attr_reader closing_loc: Location.
-
#flags ⇒ Object
readonly
attr_reader flags: Integer.
-
#opening_loc ⇒ Object
readonly
attr_reader opening_loc: Location.
-
#parts ⇒ Object
readonly
attr_reader parts: Array.
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(opening_loc, parts, closing_loc, flags, location) ⇒ InterpolatedRegularExpressionNode
constructor
def initialize: (opening_loc: Location, parts: Array, closing_loc: Location, flags: Integer, location: Location) -> void.
-
#opening ⇒ Object
def opening: () -> String.
- #set_newline_flag(newline_marked) ⇒ Object
Constructor Details
#initialize(opening_loc, parts, closing_loc, flags, location) ⇒ InterpolatedRegularExpressionNode
def initialize: (opening_loc: Location, parts: Array, closing_loc: Location, flags: Integer, location: Location) -> void
3371 3372 3373 3374 3375 3376 3377 |
# File 'lib/yarp/node.rb', line 3371 def initialize(opening_loc, parts, closing_loc, flags, location) @opening_loc = opening_loc @parts = parts @closing_loc = closing_loc @flags = flags @location = location end |
Instance Attribute Details
#closing_loc ⇒ Object (readonly)
attr_reader closing_loc: Location
3365 3366 3367 |
# File 'lib/yarp/node.rb', line 3365 def closing_loc @closing_loc end |
#flags ⇒ Object (readonly)
attr_reader flags: Integer
3368 3369 3370 |
# File 'lib/yarp/node.rb', line 3368 def flags @flags end |
#opening_loc ⇒ Object (readonly)
attr_reader opening_loc: Location
3359 3360 3361 |
# File 'lib/yarp/node.rb', line 3359 def opening_loc @opening_loc end |
#parts ⇒ Object (readonly)
attr_reader parts: Array
3362 3363 3364 |
# File 'lib/yarp/node.rb', line 3362 def parts @parts end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
3380 3381 3382 |
# File 'lib/yarp/node.rb', line 3380 def accept(visitor) visitor.visit_interpolated_regular_expression_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
3390 3391 3392 |
# File 'lib/yarp/node.rb', line 3390 def child_nodes [*parts] end |
#closing ⇒ Object
def closing: () -> String
3408 3409 3410 |
# File 'lib/yarp/node.rb', line 3408 def closing closing_loc.slice end |
#deconstruct_keys(keys) ⇒ Object
3398 3399 3400 |
# File 'lib/yarp/node.rb', line 3398 def deconstruct_keys(keys) { opening_loc: opening_loc, parts: parts, closing_loc: closing_loc, flags: flags, location: location } end |
#opening ⇒ Object
def opening: () -> String
3403 3404 3405 |
# File 'lib/yarp/node.rb', line 3403 def opening opening_loc.slice end |
#set_newline_flag(newline_marked) ⇒ Object
3384 3385 3386 3387 |
# File 'lib/yarp/node.rb', line 3384 def set_newline_flag(newline_marked) first = parts.first first.set_newline_flag(newline_marked) if first end |