From 99b56d216595b45dee1dbc19e2dbe9c437322ef8 Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 23 Feb 2004 21:41:14 +0000 Subject: Handle class vars in code listings git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/parsers/parse_rb.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/rdoc') diff --git a/lib/rdoc/parsers/parse_rb.rb b/lib/rdoc/parsers/parse_rb.rb index fd57ee2e4b..e3af27d3f7 100644 --- a/lib/rdoc/parsers/parse_rb.rb +++ b/lib/rdoc/parsers/parse_rb.rb @@ -917,7 +917,7 @@ class RubyLex end @OP.def_rule('@') do - if peek(0) =~ /[\w_]/ + if peek(0) =~ /[@\w_]/ ungetc identify_identifier else @@ -992,6 +992,8 @@ class RubyLex def identify_identifier token = "" token.concat getc if peek(0) =~ /[$@]/ + token.concat getc if peek(0) == "@" + while (ch = getc) =~ /\w|_/ print ":", ch, ":" if RubyLex.debug? token.concat ch @@ -1003,7 +1005,7 @@ class RubyLex end # fix token -# puts "identifier - #{token}, state = #@lex_state" + # $stderr.puts "identifier - #{token}, state = #@lex_state" case token when /^\$/ -- cgit v1.2.3