apache / apache/cordova-node-xcode

Allow asterisks in comments

Ouverte
#111 0 commentaires 3 réactions 0 personnes assignées Voir sur GitHub
bug
Langage dominant
JavaScript
Étoiles
217
Forks
102
Merge moyen
2 j 3 h
PR mergées (30 j)
6

Description

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' }
```

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Localisez le point d’entrée du parseur qui gère les commentaires /* et reproduisez l’échec avec `/* Upload *.dSYM to Firebase */`. Suivez la manière dont le corps du commentaire est analysé, puis vérifiez qu’un astérisque interne est accepté tandis que le */ fermant termine toujours le commentaire sans SyntaxError.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, nodejs
Domaine
tooling
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.