groc
groc copied to clipboard
support Java @param annotations
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...
+1
I did some further tests and this also requires changes to:
@return Where i get a similar exception
+1
Could you please test if my fork works for you: https://github.com/sjorek/groc … I appreciate any feedback …
:smile:
@sjorek Hm, I couldn't get your fork to solve this issue.
… 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 … :smiley: