summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/ripper/lib/ripper/lexer.rb12
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 <aamine@loveruby.net>
+
+ * ext/ripper/lib/ripper/lexer.rb: last Lexer fix was incomplete;
+ test all green.
+
Fri Feb 4 14:33:25 2005 Minero Aoki <aamine@loveruby.net>
* 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