Description
RDoc's generated RD parsers contain a complete embedded copy of the Racc
runtime:
lib/rdoc/rd/block_parser.rb
lib/rdoc/rd/inline_parser.rb
In both files, the embedded section is delimited by:
###### racc/parser.rb begin
and:
###### racc/parser.rb end
RDoc parses this embedded implementation as if it were part of RDoc's public
API. As a result, generating RDoc's own documentation creates a Racc module
page.
The embedded comments also contain this reference:
rdoc-ref:lib/racc/rdoc/grammar.en.rdoc
It produces two unresolved-reference warnings, one from each generated
parser:
classes/Racc.html: `rdoc-ref:lib/racc/rdoc/grammar.en.rdoc` can't be resolved
classes/Racc.html: `rdoc-ref:lib/racc/rdoc/grammar.en.rdoc` can't be resolved
Relevant generated files:
https://github.com/ruby/rdoc/blob/v8.0.0/lib/rdoc/rd/block_parser.rb
https://github.com/ruby/rdoc/blob/v8.0.0/lib/rdoc/rd/inline_parser.rb
Expected behavior
The embedded Racc runtime is an implementation detail of the RD parsers. It
should not create Racc, Racc::Parser, or related pages in RDoc's API
documentation.
The actual RDoc classes defined after the embedded section, such as
RDoc::RD, must remain documentable.
Suggested fix
Wrap the embedded runtime in RDoc exclusion directives:
# :stopdoc:
###### racc/parser.rb begin
# Embedded Racc runtime
###### racc/parser.rb end
# :startdoc:
This must be integrated into parser generation or its post-processing, since
the generated .rb files are committed and regenerated from the .ry
sources.
I tested these directive positions:
Racc is no longer added to the documentation store;
RDoc::RD remains documented;
- the two unresolved references disappear.
A regression test could parse both generated files and assert:
refute store.find_class_or_module("Racc")
assert store.find_class_or_module("RDoc::RD")
Description
RDoc's generated RD parsers contain a complete embedded copy of the Racc
runtime:
In both files, the embedded section is delimited by:
###### racc/parser.rb beginand:
###### racc/parser.rb endRDoc parses this embedded implementation as if it were part of RDoc's public
API. As a result, generating RDoc's own documentation creates a
Raccmodulepage.
The embedded comments also contain this reference:
It produces two unresolved-reference warnings, one from each generated
parser:
Relevant generated files:
https://github.com/ruby/rdoc/blob/v8.0.0/lib/rdoc/rd/block_parser.rb
https://github.com/ruby/rdoc/blob/v8.0.0/lib/rdoc/rd/inline_parser.rb
Expected behavior
The embedded Racc runtime is an implementation detail of the RD parsers. It
should not create
Racc,Racc::Parser, or related pages in RDoc's APIdocumentation.
The actual RDoc classes defined after the embedded section, such as
RDoc::RD, must remain documentable.Suggested fix
Wrap the embedded runtime in RDoc exclusion directives:
This must be integrated into parser generation or its post-processing, since
the generated
.rbfiles are committed and regenerated from the.rysources.
I tested these directive positions:
Raccis no longer added to the documentation store;RDoc::RDremains documented;A regression test could parse both generated files and assert: