diff --git a/lib/rdoc/ruby_lex.rb b/lib/rdoc/ruby_lex.rb index 7488b80773..fd26a0945d 100644 --- a/lib/rdoc/ruby_lex.rb +++ b/lib/rdoc/ruby_lex.rb @@ -1235,7 +1235,7 @@ def identify_string(ltype, quoted = ltype, type = nil) elsif ch == '\\' if %w[' /].include? @ltype then case ch = getc - when "\\", "\n", "'" + when "\n", "'" when @ltype str << ch else diff --git a/test/test_rdoc_ruby_lex.rb b/test/test_rdoc_ruby_lex.rb index 5ded86fd8c..15367c17a0 100644 --- a/test/test_rdoc_ruby_lex.rb +++ b/test/test_rdoc_ruby_lex.rb @@ -339,6 +339,17 @@ def test_class_tokenize_regexp_escape assert_equal expected, tokens end + def test_class_tokenize_regexp_continuing_backslash + tokens = RDoc::RubyLex.tokenize "/(?