1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
dave 2004-02-23 21:41:14 +00:00
parent fe708e5bd7
commit 99b56d2165
2 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Tue Feb 24 06:40:14 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RubyLex::identify_identifier): Handle
class variables in code listings
Tue Feb 24 06:32:27 2004 Dave Thomas <dave@pragprog.com> Tue Feb 24 06:32:27 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_aliases): Handle * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_aliases): Handle

View file

@ -917,7 +917,7 @@ class RubyLex
end end
@OP.def_rule('@') do @OP.def_rule('@') do
if peek(0) =~ /[\w_]/ if peek(0) =~ /[@\w_]/
ungetc ungetc
identify_identifier identify_identifier
else else
@ -992,6 +992,8 @@ class RubyLex
def identify_identifier def identify_identifier
token = "" token = ""
token.concat getc if peek(0) =~ /[$@]/ token.concat getc if peek(0) =~ /[$@]/
token.concat getc if peek(0) == "@"
while (ch = getc) =~ /\w|_/ while (ch = getc) =~ /\w|_/
print ":", ch, ":" if RubyLex.debug? print ":", ch, ":" if RubyLex.debug?
token.concat ch token.concat ch
@ -1003,7 +1005,7 @@ class RubyLex
end end
# fix token # fix token
# puts "identifier - #{token}, state = #@lex_state" # $stderr.puts "identifier - #{token}, state = #@lex_state"
case token case token
when /^\$/ when /^\$/