t a/lib/rdoc/ruby_lex.rb b/lib/rdoc/ruby_lex.rb
index e6e0b41..da17cd5 100644
--- a/lib/rdoc/ruby_lex.rb
+++ b/lib/rdoc/ruby_lex.rb
@@ -1028,6 +1028,8 @@ def identify_here_document
end
if output_heredoc then
+ raise Error, "Missing terminating #{quoted} for string" unless l
+
doc << l.chomp
else
doc << '"'
diff --git a/test/rdoc/test_rdoc_ruby_lex.rb b/test/rdoc/test_rdoc_ruby_lex.rb
index 0dcb425..56ddf60 100644
--- a/test/rdoc/test_rdoc_ruby_lex.rb
+++ b/test/rdoc/test_rdoc_ruby_lex.rb
@@ -162,6 +162,18 @@ def test_class_tokenize_heredoc_indent
assert_equal expected, tokens
end
+ def test_class_tokenize_heredoc_missing_end
+ e = assert_raises RDoc::RubyLex::Error do
+ RDoc::RubyLex.tokenize <<-'RUBY', nil
+>> string1 = <<-TXT
+>" That's swell
+>" TXT
+ RUBY
+ end
+
+ assert_equal 'Missing terminating TXT for string', e.message
+ end
+
def test_class_tokenize_heredoc_percent_N
tokens = RDoc::RubyLex.tokenize <<-'RUBY', nil
a b <<-U
--
1.8.4