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.
-
#ascii_8bit? ⇒ Boolean
def ascii_8bit?: () -> bool.
-
#child_nodes ⇒ Object
(also: #deconstruct)
def child_nodes: () -> Array[nil | Node].
-
#closing ⇒ Object
def closing: () -> String.
- #deconstruct_keys(keys) ⇒ Object
-
#euc_jp? ⇒ Boolean
def euc_jp?: () -> bool.
-
#extended? ⇒ Boolean
def extended?: () -> bool.
-
#ignore_case? ⇒ Boolean
def ignore_case?: () -> bool.
-
#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.
-
#multi_line? ⇒ Boolean
def multi_line?: () -> bool.
-
#once? ⇒ Boolean
def once?: () -> bool.
-
#opening ⇒ Object
def opening: () -> String.
- #set_newline_flag(newline_marked) ⇒ Object
-
#utf_8? ⇒ Boolean
def utf_8?: () -> bool.
-
#windows_31j? ⇒ Boolean
def windows_31j?: () -> bool.
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
3372 3373 3374 3375 3376 3377 3378 |
# File 'lib/yarp/node.rb', line 3372 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
3366 3367 3368 |
# File 'lib/yarp/node.rb', line 3366 def closing_loc @closing_loc end |
#flags ⇒ Object (readonly)
attr_reader flags: Integer
3369 3370 3371 |
# File 'lib/yarp/node.rb', line 3369 def flags @flags end |
#opening_loc ⇒ Object (readonly)
attr_reader opening_loc: Location
3360 3361 3362 |
# File 'lib/yarp/node.rb', line 3360 def opening_loc @opening_loc end |
#parts ⇒ Object (readonly)
attr_reader parts: Array
3363 3364 3365 |
# File 'lib/yarp/node.rb', line 3363 def parts @parts end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
3381 3382 3383 |
# File 'lib/yarp/node.rb', line 3381 def accept(visitor) visitor.visit_interpolated_regular_expression_node(self) end |
#ascii_8bit? ⇒ Boolean
def ascii_8bit?: () -> bool
3434 3435 3436 |
# File 'lib/yarp/node.rb', line 3434 def ascii_8bit? flags.anybits?(RegularExpressionFlags::ASCII_8BIT) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
3391 3392 3393 |
# File 'lib/yarp/node.rb', line 3391 def child_nodes [*parts] end |
#closing ⇒ Object
def closing: () -> String
3409 3410 3411 |
# File 'lib/yarp/node.rb', line 3409 def closing closing_loc.slice end |
#deconstruct_keys(keys) ⇒ Object
3399 3400 3401 |
# File 'lib/yarp/node.rb', line 3399 def deconstruct_keys(keys) { opening_loc: opening_loc, parts: parts, closing_loc: closing_loc, flags: flags, location: location } end |
#euc_jp? ⇒ Boolean
def euc_jp?: () -> bool
3429 3430 3431 |
# File 'lib/yarp/node.rb', line 3429 def euc_jp? flags.anybits?(RegularExpressionFlags::EUC_JP) end |
#extended? ⇒ Boolean
def extended?: () -> bool
3424 3425 3426 |
# File 'lib/yarp/node.rb', line 3424 def extended? flags.anybits?(RegularExpressionFlags::EXTENDED) end |
#ignore_case? ⇒ Boolean
def ignore_case?: () -> bool
3414 3415 3416 |
# File 'lib/yarp/node.rb', line 3414 def ignore_case? flags.anybits?(RegularExpressionFlags::IGNORE_CASE) end |
#multi_line? ⇒ Boolean
def multi_line?: () -> bool
3419 3420 3421 |
# File 'lib/yarp/node.rb', line 3419 def multi_line? flags.anybits?(RegularExpressionFlags::MULTI_LINE) end |
#once? ⇒ Boolean
def once?: () -> bool
3449 3450 3451 |
# File 'lib/yarp/node.rb', line 3449 def once? flags.anybits?(RegularExpressionFlags::ONCE) end |
#opening ⇒ Object
def opening: () -> String
3404 3405 3406 |
# File 'lib/yarp/node.rb', line 3404 def opening opening_loc.slice end |
#set_newline_flag(newline_marked) ⇒ Object
3385 3386 3387 3388 |
# File 'lib/yarp/node.rb', line 3385 def set_newline_flag(newline_marked) first = parts.first first.set_newline_flag(newline_marked) if first end |
#utf_8? ⇒ Boolean
def utf_8?: () -> bool
3444 3445 3446 |
# File 'lib/yarp/node.rb', line 3444 def utf_8? flags.anybits?(RegularExpressionFlags::UTF_8) end |
#windows_31j? ⇒ Boolean
def windows_31j?: () -> bool
3439 3440 3441 |
# File 'lib/yarp/node.rb', line 3439 def windows_31j? flags.anybits?(RegularExpressionFlags::WINDOWS_31J) end |