Class: SyntaxTree::RegexpEnd

Inherits:
Object
  • Object
show all
Defined in:
lib/syntax_tree.rb

Overview

RegexpEnd represents the end of a regular expression literal.

/.+/m

In the example above, the RegexpEnd event represents the /m at the end of the regular expression literal. You can also declare regular expression literals using %r, as in:

%r{.+}m

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value:, location:) ⇒ RegexpEnd

Returns a new instance of RegexpEnd.



9496
9497
9498
9499
# File 'lib/syntax_tree.rb', line 9496

def initialize(value:, location:)
  @value = value
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Location

the location of this node



9494
9495
9496
# File 'lib/syntax_tree.rb', line 9494

def location
  @location
end

#valueObject (readonly)

String

the end of the regular expression



9491
9492
9493
# File 'lib/syntax_tree.rb', line 9491

def value
  @value
end