mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/ripper/lib/ripper/filter.rb: ripper/tokenizer -> ripper/lexer. [ruby-dev:25632]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
73a9963ddf
commit
6a24d7ed9b
2 changed files with 9 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
Fri Feb 4 14:33:25 2005 Minero Aoki <aamine@loveruby.net>
|
||||
|
||||
* ext/ripper/lib/ripper/filter.rb: ripper/tokenizer ->
|
||||
ripper/lexer. [ruby-dev:25632]
|
||||
|
||||
Fri Feb 4 00:24:15 2005 Kouhei Sutou <kou@cozmixng.org>
|
||||
|
||||
* lib/rss: supported Image module.
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
# For details of Ruby License, see ruby/COPYING.
|
||||
#
|
||||
|
||||
require 'ripper/tokenizer'
|
||||
require 'ripper/lexer'
|
||||
|
||||
class Ripper
|
||||
|
||||
|
@ -17,14 +17,14 @@ class Ripper
|
|||
class Filter
|
||||
|
||||
def initialize(src, filename = '-', lineno = 1)
|
||||
@__parser = Tokenizer.new(src, filename, lineno)
|
||||
@__lexer = Lexer.new(src, filename, lineno)
|
||||
@__line = nil
|
||||
@__col = nil
|
||||
end
|
||||
|
||||
# The file name of the input.
|
||||
def filename
|
||||
@__parser.filename
|
||||
@__lexer.filename
|
||||
end
|
||||
|
||||
# The line number of the current token.
|
||||
|
@ -45,7 +45,7 @@ class Ripper
|
|||
# It is passed to the next event handler (as of Enumerable#inject).
|
||||
def parse(init = nil)
|
||||
data = init
|
||||
@__parser.parse.each do |pos, event, tok|
|
||||
@__lexer.lex.each do |pos, event, tok|
|
||||
@__line, @__col = *pos
|
||||
data = if respond_to?(event, true)
|
||||
then __send__(event, tok, data)
|
||||
|
|
Loading…
Reference in a new issue