comment_parser icon indicating copy to clipboard operation
comment_parser copied to clipboard

Javascript parsing fails with quoted path.

Open cmalcom opened this issue 3 years ago • 0 comments

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

cmalcom avatar Aug 09 '22 19:08 cmalcom