class Prism::LexCompat::Token
little easier to work with. We delegate all other methods to the array.
However, we add a couple of convenience methods onto them to make them a
When we produce tokens, we produce the same arrays that Ripper does.
def ==(other) # :nodoc:
We want to pretend that this is just an Array.
def ==(other) # :nodoc: @array == other end
def event
def event @array[1] end
def initialize(array)
def initialize(array) @array = array end
def location
def location @array[0] end
def method_missing(name, ...) # :nodoc:
def method_missing(name, ...) # :nodoc: @array.send(name, ...) end
def respond_to_missing?(name, include_private = false) # :nodoc:
def respond_to_missing?(name, include_private = false) # :nodoc: @array.respond_to?(name, include_private) end
def state
def state @array[3] end
def value
def value @array[2] end