comment_parser
comment_parser copied to clipboard
Javascript parsing fails with quoted path.
If there is a quoted path that contains a * the parser fails with UnterminatedCommentError(). I found this when parsing a file with CDK having a policy statement like:
new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
actions: [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
resources: [`arn:aws:logs:${environment.region}:${environment.account}:log-group/*`]
})
Would be nice if the quotes were tracked so you would know if the /* was a string rather than comment