-
Notifications
You must be signed in to change notification settings - Fork 11
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
Error parsing {string[]=} array with GCC optional notation #110
Comments
This comment has been minimized.
This comment has been minimized.
The docs at https://github.com/google/closure-compiler/wiki/Types-in-the-Closure-Type-System#optional do not speak to the issue of whether parentheses are required. I don't think the format of |
@yvele : While I am waiting a reply from https://stackoverflow.com/questions/60578125/does-closure-support-jsdoc-array-syntax-like-string , in looking at var jsdocType = 'string[]'; // Closure Compiler expects Array.<string> And indeed when I test it on Runkit, Catharsis will complain about this unless I add the "jsdoc" option mode. I don't know if this could be out-of-date, though, so if I don't hear back on Stackoverflow, maybe we can file an issue with Closure. As far as the optional var catharsis = require("catharsis")
catharsis.parse('(string[])=', {jsdoc: true}); ...since if you change this to remove the parentheses, an error will be thrown instead of the parsed result that is returned here. (If you like, there is also the grammar source for Catharsis: https://github.com/hegemonic/catharsis/blob/master/lib/parser.pegjs ) |
Following gajus/eslint-plugin-jsdoc#494
Parsing
{string[]=}
throws an error:Note that as a workaround one can wrap the type with parenthesis
{(string[])=}
but it looks very unnecessary 🤷♂The text was updated successfully, but these errors were encountered: