Class: SyntaxTree::RegexpBeg

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

Overview

RegexpBeg represents the start of a regular expression literal.

/.+/

In the example above, RegexpBeg represents the first / token. Regular expression literals can also be declared using the %r syntax, as in:

%r{.+}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value:, location:) ⇒ RegexpBeg

Returns a new instance of RegexpBeg.



9893
9894
9895
9896
# File 'lib/syntax_tree.rb', line 9893

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

Instance Attribute Details

#locationObject (readonly)

Location

the location of this node



9891
9892
9893
# File 'lib/syntax_tree.rb', line 9891

def location
  @location
end

#valueObject (readonly)

String

the beginning of the regular expression



9888
9889
9890
# File 'lib/syntax_tree.rb', line 9888

def value
  @value
end