summaryrefslogtreecommitdiff
path: root/lib/rdoc/class_module.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/class_module.rb')
-rw-r--r--lib/rdoc/class_module.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/rdoc/class_module.rb b/lib/rdoc/class_module.rb
index 5881d6cf24..fdd56e236b 100644
--- a/lib/rdoc/class_module.rb
+++ b/lib/rdoc/class_module.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
##
# ClassModule is the base class for objects representing either a class or a
# module.
@@ -136,7 +136,9 @@ class RDoc::ClassModule < RDoc::Context
normalize_comment comment
end
- @comment_location.delete_if { |(_, l)| l == location }
+ if location.parser == RDoc::Parser::C
+ @comment_location.delete_if { |(_, l)| l == location }
+ end
@comment_location << [comment, location]