Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various improvements to c_parser #369

Closed
wants to merge 3 commits into from
Closed

various improvements to c_parser #369

wants to merge 3 commits into from

Conversation

tobijk
Copy link
Contributor

@tobijk tobijk commented Jul 11, 2011

Hi,

while generating documentation for libarchive-rs.rubyforge.org, I found the following issues:

  • Some C return types, such as (un)signed short|int|... were not mapped as I would have expected.
  • Override comments for constructors in C were not recognized.
  • The parser couldn't handle nested braces while scanning for the function body.

It would be nice if these patches could make their way into Yard.

Thanks for a great doc tool. The HTML generated by Yard looks awesome.

Cheers,
Tobias

tobijk added 3 commits July 12, 2011 08:43
* handle keyword (un)signed for Integers
* handle class names as return types
* recognize C++ 'bool'
* treat return types starting with 'char' as String

Signed-off-by: Tobias Koch <tobias.koch@gmail.com>
Signed-off-by: Tobias Koch <tobias.koch@gmail.com>
Signed-off-by: Tobias Koch <tobias.koch@gmail.com>
@tobijk
Copy link
Contributor Author

tobijk commented Jul 23, 2011

Btw, 50d3546 will make yard slower, especially with Ruby 1.9, due to expensive use of string indexes. I tried another solution that collected parts of the function piece by piece using regular expressions and stitching those back together with a join at the end. But it required a copy of 'content' to be made upfront, which is just as expensive, since content contains always the rest of the source file.

So you might not want to merge this, even though the problem persists.

@lsegal
Copy link
Owner

lsegal commented Oct 1, 2011

I've merged the 2 other commits not including the nested braces issue. Unless there is someone having this specific problem with C docs, I'd rather not drop perf. Until then, maybe we can find a better way to solve the problem.

Thanks!

@lsegal lsegal closed this Oct 1, 2011
@tobijk
Copy link
Contributor Author

tobijk commented Oct 1, 2011

Awesome. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants