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:

:nodoc:
We want to pretend that this is just an Array.
def ==(other) # :nodoc:
  @array == other
end

def event

The type of the token.
def event
  @array[1]
end

def initialize(array)

Create a new token object with the given ripper-compatible array.
def initialize(array)
  @array = array
end

def location

The location of the token in the source.
def location
  @array[0]
end

def method_missing(name, ...) # :nodoc:

:nodoc:
def method_missing(name, ...) # :nodoc:
  @array.send(name, ...)
end

def respond_to_missing?(name, include_private = false) # :nodoc:

:nodoc:
def respond_to_missing?(name, include_private = false) # :nodoc:
  @array.respond_to?(name, include_private)
end

def state

The state of the lexer when this token was produced.
def state
  @array[3]
end

def value

The slice of the source that this token represents.
def value
  @array[2]
end