From 889ca023e33ae35c259d02912187ac31be4f5362 Mon Sep 17 00:00:00 2001 From: aamine Date: Fri, 4 Feb 2005 09:46:18 +0000 Subject: [PATCH] * ext/ripper/lib/ripper/lexer.rb: last Lexer fix was incomplete; test all green. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/ripper/lib/ripper/lexer.rb | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f7f5642e2..b76467cb8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Feb 4 18:44:35 2005 Minero Aoki + + * ext/ripper/lib/ripper/lexer.rb: last Lexer fix was incomplete; + test all green. + Fri Feb 4 14:33:25 2005 Minero Aoki * ext/ripper/lib/ripper/filter.rb: ripper/tokenizer -> diff --git a/ext/ripper/lib/ripper/lexer.rb b/ext/ripper/lib/ripper/lexer.rb index 35074acbf4..20436f6f49 100644 --- a/ext/ripper/lib/ripper/lexer.rb +++ b/ext/ripper/lib/ripper/lexer.rb @@ -41,19 +41,23 @@ class Ripper class Lexer < ::Ripper #:nodoc: internal use only def tokenize - parse().map {|pos, event, tok| tok } + lex().map {|pos, event, tok| tok } end def lex + parse().sort_by {|pos, event, tok| pos } + end + + def parse @buf = [] - parse - @buf.sort_by {|pos, event, tok| pos } + super + @buf end private SCANNER_EVENTS.each do |event| - module_eval(<<-End) + module_eval(<<-End, __FILE__+'/module_eval', __LINE__ + 1) def on_#{event}(tok) @buf.push [[lineno(), column()], :on_#{event}, tok] end