Class: Ripper::Lexer

Inherits:
Ripper show all
Defined in:
lib/ripper/lexer.rb

Overview

:nodoc: internal use only

Constant Summary

Constants inherited from Ripper

EVENTS, PARSER_EVENTS, SCANNER_EVENTS

Instance Method Summary collapse

Methods inherited from Ripper

lex, parse, sexp, sexp_raw, slice, token_match, tokenize

Instance Method Details

#lexObject


47
48
49
# File 'lib/ripper/lexer.rb', line 47

def lex
  parse().sort_by {|pos, event, tok| pos }
end

#parseObject


51
52
53
54
55
# File 'lib/ripper/lexer.rb', line 51

def parse
  @buf = []
  super
  @buf
end

#tokenizeObject


43
44
45
# File 'lib/ripper/lexer.rb', line 43

def tokenize
  lex().map {|pos, event, tok| tok }
end