ruby_parser
Advanced tools
Sorry, the diff of this file is not supported yet
+10
-0
@@ -0,1 +1,11 @@ | ||
| === 2.0.6 / 2011-02-18 | ||
| * 1 minor enhancement: | ||
| * Switched to hoe's racc plugin to clean up rakefile and builds | ||
| * 1 bug fix: | ||
| * Fixed empty =begin/end. | ||
| === 2.0.5 / 2010-09-01 | ||
@@ -2,0 +12,0 @@ |
@@ -234,3 +234,3 @@ class RubyLexer | ||
| def lex_state= o | ||
| raise "wtf?" unless Symbol === o | ||
| raise "wtf\?" unless Symbol === o | ||
| @lex_state = o | ||
@@ -659,3 +659,3 @@ end | ||
| if c == '#' then | ||
| src.unread c # ok | ||
| src.pos -= 1 | ||
@@ -728,3 +728,3 @@ while src.scan(/\s*#.*(\n+|\z)/) do | ||
| return TOKENS[tok] | ||
| elsif src.was_begin_of_line and src.scan(/\=begin(?=\s)/) then | ||
| elsif src.scan(/\=begin(?=\s)/) then | ||
| # @comments << '=' << src.matched | ||
@@ -731,0 +731,0 @@ @comments << src.matched |
@@ -118,3 +118,3 @@ require 'stringio' | ||
| class RubyParser < Racc::Parser | ||
| VERSION = '2.0.5' unless constants.include? "VERSION" # SIGH | ||
| VERSION = '2.0.6' unless constants.include? "VERSION" # SIGH | ||
@@ -121,0 +121,0 @@ attr_accessor :lexer, :in_def, :in_single, :file |
+1
-0
@@ -10,2 +10,3 @@ .autotest | ||
| lib/ruby_parser.y | ||
| lib/ruby_parser.rb | ||
| lib/ruby_parser_extras.rb | ||
@@ -12,0 +13,0 @@ test/test_ruby_lexer.rb |
+3
-24
@@ -7,2 +7,3 @@ # -*- ruby -*- | ||
| Hoe.plugin :seattlerb | ||
| Hoe.plugin :racc | ||
@@ -13,3 +14,3 @@ Hoe.add_include_dirs("../../ParseTree/dev/test", | ||
| hoe = Hoe.spec 'ruby_parser' do | ||
| Hoe.spec 'ruby_parser' do | ||
| developer 'Ryan Davis', 'ryand-ruby@zenspider.com' | ||
@@ -21,27 +22,6 @@ | ||
| extra_deps << ['sexp_processor', '~> 3.0'] | ||
| end | ||
| hoe.spec.files += ['lib/ruby_parser.rb'] # jim.... cmon man | ||
| [:default, :multi, :test].each do |t| | ||
| task t => :parser | ||
| self.perforce_ignore << "lib/ruby_parser.rb" if plugin? :perforce | ||
| end | ||
| path = "pkg/ruby_parser-#{hoe.version}" | ||
| task path => :parser do | ||
| Dir.chdir path do | ||
| sh "rake parser" | ||
| end | ||
| end | ||
| desc "build the parser" | ||
| task :parser => ["lib/ruby_parser.rb"] | ||
| rule '.rb' => '.y' do |t| | ||
| # -v = verbose | ||
| # -t = debugging parser ~4% reduction in speed -- keep for now | ||
| # -l = no-line-convert | ||
| sh "racc -v -t -l -o #{t.name} #{t.source}" | ||
| end | ||
| task :clean do | ||
@@ -52,3 +32,2 @@ rm_rf(Dir["**/*~"] + | ||
| Dir["coverage"] + | ||
| Dir["lib/ruby_parser.rb"] + | ||
| Dir["lib/*.output"]) | ||
@@ -55,0 +34,0 @@ end |
@@ -178,2 +178,11 @@ #!/usr/local/bin/ruby | ||
| def test_bug_comment_eq_begin | ||
| rb = "\n\n#\n=begin\nblah\n=end\n\n" | ||
| pt = nil | ||
| exp = rb[2..-1] | ||
| assert_equal pt, @processor.parse(rb) | ||
| assert_equal exp, @processor.lexer.comments | ||
| end | ||
| def test_dstr_evstr | ||
@@ -180,0 +189,0 @@ rb = "\"#\{'a'}#\{b}\"" |
Sorry, the diff of this file is too big to display