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.



9929
9930
9931
9932
# File 'lib/syntax_tree.rb', line 9929

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

Instance Attribute Details

#locationObject (readonly)

Location

the location of this node



9927
9928
9929
# File 'lib/syntax_tree.rb', line 9927

def location
  @location
end

#valueObject (readonly)

String

the end of the regular expression



9924
9925
9926
# File 'lib/syntax_tree.rb', line 9924

def value
  @value
end