-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
Both of these below error with an unpaired brackets error:
/**
* @defaultValue `[`
*//**
* @defaultValue '['
*/In theory I think adding this to nameTokenizer would fix the error:
if (source.startsWith("`") || source.startsWith("'")) {
return spec;
}And I'd be happy to PR this but I wanted to check if this made sense first. The reason why " doesn't have these issues is because of this code:
const quotedGroups = source.split('"');
// if it starts with quoted group, assume it is a literal
if (
quotedGroups.length > 1 &&
quotedGroups[0] === '' &&
quotedGroups.length % 2 === 1
) {
spec.name = quotedGroups[1];
tokens.name = `"${quotedGroups[1]}"`;
[tokens.postName, tokens.description] = splitSpace(
source.slice(tokens.name.length)
);
return spec;
}Though admittedly I'm not sure I'd expect "[" to be the name. I understand it's a non-goal of comment-parser to deal with all possible ambiguities though.
Metadata
Metadata
Assignees
Labels
No labels