diff options
| author | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-23 21:41:14 +0000 |
|---|---|---|
| committer | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-23 21:41:14 +0000 |
| commit | 3ce6e0e089466ad52cfb2b617e40f996bdc14c71 (patch) | |
| tree | 8282da8c9857cf19f80cbf3e00b1925bb510af44 /lib/rdoc | |
| parent | d4f258eac834cc7b2980fe036969a2291d1ddb0e (diff) | |
| download | ruby-3ce6e0e089466ad52cfb2b617e40f996bdc14c71.tar.gz ruby-3ce6e0e089466ad52cfb2b617e40f996bdc14c71.tar.xz ruby-3ce6e0e089466ad52cfb2b617e40f996bdc14c71.zip | |
Handle class vars in code listings
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc')
| -rw-r--r-- | lib/rdoc/parsers/parse_rb.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/rdoc/parsers/parse_rb.rb b/lib/rdoc/parsers/parse_rb.rb index fd57ee2e4..e3af27d3f 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 /^\$/ |
