We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 53f146a + e2fa6a8 commit 2772846Copy full SHA for 2772846
lib/rdoc/ruby_lex.rb
@@ -1250,8 +1250,8 @@ def identify_string(ltype, quoted = ltype, type = nil)
1250
break
1251
elsif @ltype != "'" && @ltype != "]" && @ltype != ":" and ch == "#"
1252
ch = getc
1253
- subtype = true
1254
if ch == "{" then
+ subtype = true
1255
str << ch << skip_inner_expression
1256
next
1257
else
test/test_rdoc_parser_ruby.rb
@@ -2063,7 +2063,7 @@ def test_parse_statements_class_nested
2063
end
2064
2065
def test_parse_statements_def_percent_string_pound
2066
- util_parser "class C\ndef a\n%r{#}\nend\ndef b() end\nend"
+ util_parser "class C\ndef a\n%r{#}\n%r{\#{}}\nend\ndef b() end\nend"
2067
2068
@parser.parse_statements @top_level, RDoc::Parser::Ruby::NORMAL
2069
@@ -2080,9 +2080,11 @@ def test_parse_statements_def_percent_string_pound
2080
tk(:SPACE, 11, 2, 3, nil, ' '),
2081
tk(:IDENTIFIER, 12, 2, 4, 'a', 'a'),
2082
tk(:NL, 13, 2, 5, nil, "\n"),
2083
- tk(:DREGEXP, 14, 3, 0, nil, '%r{#}'),
+ tk(:REGEXP, 14, 3, 0, nil, '%r{#}'),
2084
tk(:NL, 19, 3, 5, nil, "\n"),
2085
- tk(:END, 20, 4, 0, 'end', 'end'),
+ tk(:DREGEXP, 20, 4, 0, nil, '%r{#{}}'),
2086
+ tk(:NL, 27, 4, 7, nil, "\n"),
2087
+ tk(:END, 28, 5, 0, 'end', 'end'),
2088
]
2089
2090
assert_equal expected, a.token_stream
0 commit comments