From 74d704c2635484a12a47aeb2fbcf4c5f48cdbebd Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 23 Feb 2004 21:10:42 +0000 Subject: Fix constant value extraction. Escape HTML in constant values git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/parsers/parse_rb.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/rdoc/parsers/parse_rb.rb') diff --git a/lib/rdoc/parsers/parse_rb.rb b/lib/rdoc/parsers/parse_rb.rb index 413167a39a..fd57ee2e4b 100644 --- a/lib/rdoc/parsers/parse_rb.rb +++ b/lib/rdoc/parsers/parse_rb.rb @@ -1510,6 +1510,10 @@ module RDoc read end + def peek_read + @read.join('') + end + NORMAL = "::" SINGLE = "<<" @@ -1814,6 +1818,10 @@ module RDoc return end + + nest = 0 + get_tkread + tk = get_tk if tk.kind_of? TkGT unget_tk(tk) @@ -1821,11 +1829,10 @@ module RDoc return end - nest = 0 - get_tkread loop do puts("Param: #{tk}, #{@scanner.continue} " + "#{@scanner.lex_state} #{nest}") if $DEBUG + case tk when TkSEMICOLON break @@ -1846,6 +1853,7 @@ module RDoc end tk = get_tk end + res = get_tkread.tr("\n", " ").strip res = "" if res == ";" con = Constant.new(name, res, comment) -- cgit v1.2.3