From 1325437297539bf433904b64db63a3186e62177e Mon Sep 17 00:00:00 2001 From: drbrain Date: Sat, 10 Apr 2010 06:36:13 +0000 Subject: * lib/rdoc: Import RDoc 2.5.2 * lib/rdoc/parser/ruby.rb (RDoc::Parser::Ruby): Don't parse rdoc files, reverts r24976 in favor of include directive support in C parser. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/ruby_lex.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/rdoc/ruby_lex.rb') diff --git a/lib/rdoc/ruby_lex.rb b/lib/rdoc/ruby_lex.rb index 59de6cc762..ab5f32ba42 100644 --- a/lib/rdoc/ruby_lex.rb +++ b/lib/rdoc/ruby_lex.rb @@ -359,6 +359,8 @@ class RDoc::RubyLex "(" => ")" } + PERCENT_PAREN_REV = PERCENT_PAREN.invert + Ltype2Token = { "\'" => TkSTRING, "\"" => TkSTRING, @@ -1120,7 +1122,12 @@ class RDoc::RubyLex def identify_string(ltype, quoted = ltype) @ltype = ltype @quoted = quoted - str = @ltype.dup + + str = if ltype == quoted then + ltype.dup + else + "%#{PERCENT_PAREN_REV[quoted]}" + end subtype = nil begin @@ -1136,6 +1143,7 @@ class RDoc::RubyLex subtype = true if ch == "{" then str << ch << skip_inner_expression + next else ungetc end @@ -1179,7 +1187,7 @@ class RDoc::RubyLex def skip_inner_expression res = "" nest = 0 - while (ch = getc) + while ch = getc res << ch if ch == '}' break if nest.zero? -- cgit v1.2.3