apache / apache/cordova-node-xcode
Allow asterisks in comments
- Vorherrschende Sprache
- JavaScript
- Sterne
- 217
- Forks
- 102
- Ø Merge
- 2 T. 3 Std.
- Gemergte PRs (30 T.)
- 6
Beschreibung
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' }
```
Beitragsleitfaden
Rechercherichtung
Ermitteln Sie den Parser-Einstiegspunkt, der /*-Kommentare verarbeitet, und reproduzieren Sie den Fehler mit `/* Upload *.dSYM to Firebase */`. Verfolgen Sie, wie der Kommentartext gescannt wird, und überprüfen Sie anschließend, dass ein internes Sternchen akzeptiert wird, während das abschließende */ den Kommentar weiterhin ohne einen SyntaxError beendet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, nodejs
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100