Class: Ripper::Lexer
Overview
:nodoc: internal use only
Defined Under Namespace
Classes: Elem
Constant Summary
Constants inherited from Ripper
EVENTS, PARSER_EVENTS, SCANNER_EVENTS, Version
Instance Method Summary collapse
Methods inherited from Ripper
#column, dedent_string, #encoding, #end_seen?, #error?, #filename, #initialize, lex, #lineno, parse, sexp, sexp_raw, slice, token_match, tokenize, #yydebug, #yydebug=
Constructor Details
This class inherits a constructor from Ripper
Instance Method Details
#lex ⇒ Object
54 55 56 |
# File 'lib/ripper/lexer.rb', line 54 def lex parse().sort_by(&:pos).map(&:to_a) end |
#parse ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/ripper/lexer.rb', line 58 def parse @buf = [] @stack = [] super @buf.flatten! @buf end |
#tokenize ⇒ Object
50 51 52 |
# File 'lib/ripper/lexer.rb', line 50 def tokenize parse().sort_by(&:pos).map(&:tok) end |