summaryrefslogtreecommitdiff
path: root/ext/ripper/lib
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-20 07:59:30 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-09-20 07:59:30 +0000
commitb2a700f13eb406145983ff2f2308ce0f6b1ebbe5 (patch)
treec22c02a0c7bf687e952da4055502f0b6c34870ff /ext/ripper/lib
parent273d0344a8c25e2f14129d78df4cc7242762f507 (diff)
* parse.y [ripper]: do not delay dispatching.
* ext/ripper/lib/ripper/tokenizer.rb: sort tokens by right order. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/ripper/lib')
-rw-r--r--ext/ripper/lib/ripper/tokenizer.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/ripper/lib/ripper/tokenizer.rb b/ext/ripper/lib/ripper/tokenizer.rb
index 0bd966e..134de9d 100644
--- a/ext/ripper/lib/ripper/tokenizer.rb
+++ b/ext/ripper/lib/ripper/tokenizer.rb
@@ -24,11 +24,13 @@ class Ripper
def tokenize
@tokens = []
parse
- @tokens
+ @tokens.sort_by {|tok, pos| pos }.map {|tok,| tok }
end
+ private
+
def on__scan(type, tok)
- @tokens.push tok
+ @tokens.push [tok, [lineno(),column()]]
end
end