From a717102810a6256784126008525b2cdb74206713 Mon Sep 17 00:00:00 2001 From: Brenton 'B-Train' Fletcher Date: Tue, 4 Dec 2012 14:33:29 +1100 Subject: [PATCH 1/3] Fix for 'class Xyz::Abc' --- bin/rtags | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/rtags b/bin/rtags index 96f8b8a..c8782ba 100755 --- a/bin/rtags +++ b/bin/rtags @@ -372,7 +372,7 @@ module RTAGS if peek_tk.kind_of? TkCOLON2 get_tk # skip the :: namespaced_name_token = get_tk - rest = parse_full_constant(namespaced_name_token) + rest = parse_full_constant_name(namespaced_name_token) name += '::' + rest unless rest.nil? end From 4e40439e4f5d219bdb10fd42876d5978d2487d09 Mon Sep 17 00:00:00 2001 From: Brenton 'B-Train' Fletcher Date: Tue, 4 Dec 2012 14:36:01 +1100 Subject: [PATCH 2/3] Fixes a bug in RubyLex (apparently standing for 12 years) where if you have '=end' as the last line of a file and the file has no final '\n', RubyLex loops forever. --- bin/rtags | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/bin/rtags b/bin/rtags index c8782ba..f2eb3f5 100755 --- a/bin/rtags +++ b/bin/rtags @@ -110,6 +110,8 @@ require "tracer" require "irb/ruby-lex" require "irb/ruby-token" +require "stringio" + module RTAGS @RCS_ID='-rtags.rb 0.95 -' @@ -246,13 +248,13 @@ module RTAGS def scan(&block) print "\nParsing #{@input_file_name}..." if (!$options.quiet && !$options.xref) - File.open(@input_file_name) do |input| - @tokens = [] - @unget_readed = [] - @readed = [] - @scanner.set_input(input) - parse_statements(&block) - end + + input = StringIO.new(File.read(@input_file_name) + "\n") + @tokens = [] + @unget_readed = [] + @readed = [] + @scanner.set_input(input) + parse_statements(&block) end # get the next token - fetching it from the temporary +@tokens+ From fbd273d3ea5306ec11717c23c9fe850809dc128d Mon Sep 17 00:00:00 2001 From: Brenton 'B-Train' Fletcher Date: Tue, 18 Dec 2012 18:20:03 +1100 Subject: [PATCH 3/3] Add monkeypatch from https://github.com/pbogdan/rtags/commit/3bbde0872af08f71f99cef5a02999f24b34eb5cf --- bin/rtags | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/rtags b/bin/rtags index f2eb3f5..3c5ff9e 100755 --- a/bin/rtags +++ b/bin/rtags @@ -110,6 +110,11 @@ require "tracer" require "irb/ruby-lex" require "irb/ruby-token" +class RubyLex + def identify_string_dvar + end +end + require "stringio" module RTAGS