Class: YARP::LexCompat::Token

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/yarp/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

#eventObject



190
191
192
# File 'lib/yarp/lex_compat.rb', line 190

def event
  self[1]
end

#locationObject



186
187
188
# File 'lib/yarp/lex_compat.rb', line 186

def location
  self[0]
end

#stateObject



198
199
200
# File 'lib/yarp/lex_compat.rb', line 198

def state
  self[3]
end

#valueObject



194
195
196
# File 'lib/yarp/lex_compat.rb', line 194

def value
  self[2]
end