I like tour suggestion for the "?" character as the token to use. I'd
like to propose a coule variations on that to consider:
- If a tag has no identifier and no description then default to the
parsed identifier. E.g. the following would get "foobar" as the
identifier name:
/** @var */
var foobar = ...
/** @function {private} */
function foobar(...
- Allow the ? to be mixed with namespace paths. E.g. the following
would have an identifier of "Some.Namespace.foobar":
/** @function {private} Some.Namespace.? */
function foobar(...
In other news, I implemented a Java version of jgdlint. This includes
a "parseIdentifier" method that I believe meets your description above
for parsing a file line-by-line to locate and return an identifier.
Thus, I've opened an enhancement ticket for this feature, and attached
the jgdlint.java file there:
http://code.google.com/p/jgrousedoc/issues/detail?id=68
The usage for this is pretty much the same as before, "java jgdlint
[file1.js [file2.js [etc...]]]". The identifier and jgd tag parsing
logic are a bit smarter than the Bash version I posted previously.
But, of course, the jgd tag parsing code is just a placeholder in lieu
of what jGD actually does.
FWIW, I ran this on our codebase of 200 files. Of the 1127 tags it
checked, it found 45 errors where there were discrepencies between the
parsed identifier and the identifier declared in the comment. Of
those, all but one were legitimate mistakes in our documentation.
i.e. The parser has a ~.09% rate for false-positives (if you take into
account the caveat that it ignores namespace-level tags - @class/
@interface/@object/@struct - where it's false-positive rate is
significantly higher. But those aren't as important for the reasons I
mentioned previously.)
I also added a check for properties that look like they should be
private (i.e. are prefixed with a "_"), but that don't have a
'private' modifier. It found 133 of those.
(Anyhow we could _really_ use this feature, like, today. Those 45
errors? All of them were introduced in the last two weeks!)