Skip to content

Commit fe0159d

Browse files
committed
Non-RD part feature has not been imported to RDoc
1 parent 0b9dde5 commit fe0159d

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

lib/rdoc/rd/block_parser.ry

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,15 +339,19 @@ def next_token # :nodoc:
339339
# non-RD part begin
340340
when /^=begin\s+(\w+)/
341341
part = $1
342+
=begin # not imported to RDoc
342343
if @in_part # if in non-RD part
343344
@part_content.push(line)
344345
else
345346
@in_part = part if @tree.filter[part] # if filter exists
346347
# p "BEGIN_PART: #{@in_part}" # DEBUG
347348
end
349+
=end
350+
@in_part = part
348351
# non-RD part end
349352
when /^=end/
350353
if @in_part # if in non-RD part
354+
=begin # not imported to RDoc
351355
# p "END_PART: #{@in_part}" # DEBUG
352356
# make Part-in object
353357
part = RDoc::RD::Part.new(@part_content.join(""), @tree, "r")
@@ -366,11 +370,14 @@ def next_token # :nodoc:
366370
end
367371
@in_part = nil
368372
return [:SUBTREE, subtree]
373+
=end
369374
end
370375
else
376+
=begin # not imported to RDoc
371377
if @in_part # if in non-RD part
372378
@part_content.push(line)
373379
end
380+
=end
374381
end
375382
end
376383

test/rdoc/test_rdoc_rd_block_parser.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,27 @@ def test_parse_include_subtree
168168
tf.close!
169169
end
170170

171+
=begin
172+
def test_parse_include_other_format
173+
@block_parser.include_path = [Dir.tmpdir]
174+
175+
expected =
176+
doc(
177+
blank_line,
178+
para("include ((*worked*))"),
179+
blank_line,
180+
blank_line)
181+
182+
str = <<~STR
183+
=begin nonrd
184+
<<< worked
185+
=end
186+
STR
187+
188+
assert_equal(expected, @block_parser.parse str.lines.to_a)
189+
end
190+
=end
191+
171192
def test_parse_heading
172193
assert_equal doc(head(1, "H")), parse("= H")
173194
assert_equal doc(head(2, "H")), parse("== H")

0 commit comments

Comments
 (0)