Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

Ruby::Prism.lex_compat

lex_compat(source, **options) → LexCompat::Result

Returns a parse result whose value is an array of tokens that closely resembles the return value of Ripper.lex.

For supported options, see Ruby::Prism.parse.

: (String source, **untyped options) -> LexCompat::Result

See also .find .load .scope