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

support Java @param annotations #127

Open
pmlopes opened this issue Oct 4, 2013 · 6 comments
Open

support Java @param annotations #127

pmlopes opened this issue Oct 4, 2013 · 6 comments

Comments

@pmlopes
Copy link

pmlopes commented Oct 4, 2013

In java the format is:

@param varname text

there is no type data, this breaks groc with:

! Failed to parse doc tags /home/.../Engine.java: Cannot read property '1' of null
   TypeError: Cannot read property '1' of null
      at Object.module.exports.DOC_TAGS.param.parseValue (/home/paulo/Projects/oss/groc/lib/doc_tags.coffee:125:31)
      at Object.module.exports.Utils.parseDocTags (/home/paulo/Projects/oss/groc/lib/utils.coffee:472:41)
      at Default.module.exports.Base.renderFile (/home/paulo/Projects/oss/groc/lib/styles/base.coffee:31:20)
      at /home/paulo/Projects/oss/groc/lib/project.coffee:74:24
      at fs.js:266:14
      at Object.oncomplete (fs.js:107:15)

The issue is that there is no {type} and the regex seems to always expect it... can it be optional? the reason behind it is that forcing to add {type} to existing javadoc will break javadoc...

@pampul
Copy link

pampul commented Oct 10, 2013

+1

@pmlopes
Copy link
Author

pmlopes commented Oct 10, 2013

I did some further tests and this also requires changes to:

@return
Where i get a similar exception

@sevanspace
Copy link

+1

@sjorek
Copy link
Contributor

sjorek commented Nov 26, 2013

Could you please test if my fork works for you: https://github.com/sjorek/groc … I appreciate any feedback …

😄

@sevanspace
Copy link

@sjorek Hm, I couldn't get your fork to solve this issue.

@sjorek
Copy link
Contributor

sjorek commented Nov 27, 2013

… sorry, to hear; I guess the problem isn't changing the corresponding regular expressions (esp. making the type optional is really easy). It is more the lack of a proper code-structure to collect all the differences in doctag-implementations in a clean and maintainable way. My fork does is a first attempt to collect these diversities. If you take a look at the language definition file lib/languages.coffee you will notice, that some language definitions have a doc_tags entry, and some don't … so in order to make it run NOW with Java-doctags, you could fork my version, duplicate lib/doc_tags.coffee, alter the new file accordingly, and add this new entry to the Java-Registration in either your own language-definition file or in the original language definition file. I promise to take care of these changes, if you offer a pull-request back to me and I'll try to push it further into the original implementation.

Well, I have to admit, that this only works, if one of you is willing to do so … 😃

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

No branches or pull requests

4 participants