Class: Prism::LexCompat::Token
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Prism::LexCompat::Token
show all
- Defined in:
- lib/prism/lex_compat.rb
Overview
When we produce tokens, we produce the same arrays that Ripper does. However, we add a couple of convenience methods onto them to make them a little easier to work with. We delegate all other methods to the array.
Instance Method Summary
collapse
Instance Method Details
#event ⇒ Object
191
192
193
|
# File 'lib/prism/lex_compat.rb', line 191
def event
self[1]
end
|
#location ⇒ Object
187
188
189
|
# File 'lib/prism/lex_compat.rb', line 187
def location
self[0]
end
|
#state ⇒ Object
199
200
201
|
# File 'lib/prism/lex_compat.rb', line 199
def state
self[3]
end
|
#value ⇒ Object
195
196
197
|
# File 'lib/prism/lex_compat.rb', line 195
def value
self[2]
end
|