class Prism::LexCompat
This class is responsible for lexing the source using prism and then converting those tokens to be compatible with Ripper. In the vast majority of cases, this is a one-to-one mapping of the token type. Everything else generally lines up. However, there are a few cases that require special handling.
Constants
- BOM_FLUSHED
-
In previous versions of
Ruby,Ripperwouldn’t flush the bom before the first token, so we had to have a hack in place to account for that. - RIPPER
-
This is a mapping of prism token types to
Rippertoken types. This is a many-to-one mapping because we split up our token types, whereasRippertends to group them.
Attributes
options
[R]
Hash[Symbol, untyped]
Public Class Methods
Public Instance Methods
(Array[lex_compat_token] tokens, Source source, Location? data_loc, bool bom, Token? eof_token) → Array[lex_compat_token]
Source
# File vendor/bundle/ruby/4.0.0/gems/prism-2.1.0-x86_64-linux-gnu/sig/generated/prism/lex_compat.rbs, line 164
def post_process_tokens: (Array[lex_compat_token] tokens, Source source, Location? data_loc, bool bom, Token? eof_token) -> Array[lex_compat_token]