Accepts a list of prism tokens and converts them into the expected format for the parser gem.

Constants

The direct translating of types between the two lexers.

These constants represent flags in our lex state. We really, really don’t want to be using them and we really, really don’t want to be exposing them as part of our public API. Unfortunately, we don’t have another way of matching the exact tokens that the parser gem expects without them. We should find another way to do this, but in the meantime we’ll hide them from the documentation and mark them as private constants.

No documentation available
No documentation available
Attributes

The Parser::Source::Buffer that the tokens were lexed from.

Read

An array of tuples that contain prism tokens and their associated lex state when they were lexed.

A hash that maps offsets in bytes to offsets in characters.

Class Methods

Initialize the lexer with the given source buffer, prism tokens, and offset cache.

Instance Methods

Parse a complex from the string representation.

Parse a float from the string representation.

Parse an integer from the string representation.

Parse a rational from the string representation.

Convert the prism tokens into the expected format for the parser gem.