aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc/ruby_lex.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-10 06:36:13 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-10 06:36:13 +0000
commit1325437297539bf433904b64db63a3186e62177e (patch)
tree01608a107ec3939b1013152d961b6407a5ba9c25 /lib/rdoc/ruby_lex.rb
parentce2b574017cacc2c3f2b0e92f82a7f250639fc34 (diff)
downloadruby-1325437297539bf433904b64db63a3186e62177e.tar.gz
* 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
Diffstat (limited to 'lib/rdoc/ruby_lex.rb')
-rw-r--r--lib/rdoc/ruby_lex.rb12
1 files changed, 10 insertions, 2 deletions
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?