apache / apache/cordova-node-xcode

Allow asterisks in comments

未关闭
#111 0 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
JavaScript
星标
217
派生
102
平均合并
2 天 3 小时
30 天内合并 PR
6

描述

Once the parser passes a `/*` token, it proceeds to search for a `*/` token, throwing a SyntaxError as soon as it encounter an asterisk not immediately followed by a slash. Comments can contain asterisks though. Many of these comments in project files are autogenerated, for example based on a file name which could have an asterisk in it.

Could the parser ignore `*` characters between `/*` and `*/`, continuing its search without issue until it finds the closing `*/`?

To reproduce the below, call the parser on any (file containing a) line such as `/* Upload *.dSYM to Firebase */`:

```
Thrown:
{ [SyntaxError: Expected "*/" or [^*] but "*" found.
]
message: 'Expected "*/" or [^*] but "*" found.',
expected:
[ { type: 'class',
parts: [Array],
inverted: true,
ignoreCase: false },
{ type: 'literal', text: '*/', ignoreCase: false },
{ type: 'class',
parts: [Array],
inverted: true,
ignoreCase: false },
{ type: 'literal', text: '*/', ignoreCase: false } ],
found: '*',
location:
{ start: { offset: 697, line: 13, column: 35 },
end: { offset: 698, line: 13, column: 36 } },
name: 'SyntaxError' }
```

贡献指南

打开贡献指南

调研方向

定位处理 /* 注释的 parser 入口点,并使用 `/* Upload *.dSYM to Firebase */` 重现该失败。跟踪注释正文的扫描方式,然后验证内部星号会被接受,同时结尾的 */ 仍会在不产生 SyntaxError 的情况下终止注释。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, nodejs
领域
tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。