RDoc and preprocessor generated functions

L

leon breedt

Hi,

An extension I'm documenting has several functions and Ruby classes
that are generated by the preprocessor.

Is there any way to generate RDoc for a C function, without it trying
to validate that the function exists? I have several Document-method
calls for generated methods, but none of the methods even show up.

Document-class and Document-method don't quite seem to work as I'd
expect either.

The first Document-class: Some::Generated::Class in the file is used
for the "module" comment, even if I explicitly put Document-class:
Module::Name in front of the Init() method.

I'd prefer not to have to do actual source code modifications outside
of comments to achieve this...

Thanks :)
Leon
 
L

leon breedt

The first Document-class: Some::Generated::Class in the file is used
for the "module" comment, even if I explicitly put Document-class:
Module::Name in front of the Init() method.
This would appear because the module of Some::Generated::Class's is
the same as that of Module::Name.

In other words, the Document-class: regexp in C_Parser#find_comment in
parse_c.rb is too greedy:

elsif @body =~ %r{Document-(class|module):\s#{class_name}.*?\n((?>.*?\*/))}m

The .* after #{class_name} seems to be causing the problem.

For example, if you placed a comment containing Document-class:
Module::Class before a comment containing Document-class: Module, the
first comment would always be used regardless (1.8.2).

Leon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top