summaryrefslogtreecommitdiff
path: root/lib/rdoc/parser/ripper_state_lex.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/parser/ripper_state_lex.rb')
-rw-r--r--lib/rdoc/parser/ripper_state_lex.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rdoc/parser/ripper_state_lex.rb b/lib/rdoc/parser/ripper_state_lex.rb
index cc7a87976c..5492f08726 100644
--- a/lib/rdoc/parser/ripper_state_lex.rb
+++ b/lib/rdoc/parser/ripper_state_lex.rb
@@ -494,7 +494,8 @@ class RDoc::Parser::RipperStateLex
private def heredoc_end?(name, indent, tk)
result = false
if :on_heredoc_end == tk[:kind] then
- tk_name = (indent ? tk[:text].gsub(/^ *(.+)\n?$/, '\1') : tk[:text].gsub(/\n\z/, ''))
+ tk_name = tk[:text].chomp
+ tk_name.lstrip! if indent
if name == tk_name
result = true
end