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.



10005
10006
10007
10008
# File 'lib/syntax_tree.rb', line 10005

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

Instance Attribute Details

#locationObject (readonly)

Location

the location of this node



10003
10004
10005
# File 'lib/syntax_tree.rb', line 10003

def location
  @location
end

#valueObject (readonly)

String

the end of the regular expression



10000
10001
10002
# File 'lib/syntax_tree.rb', line 10000

def value
  @value
end