Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow asterisks in comments #111

Open
anywherepilot opened this issue Apr 28, 2020 · 0 comments
Open

Allow asterisks in comments #111

anywherepilot opened this issue Apr 28, 2020 · 0 comments
Labels

Comments

@anywherepilot
Copy link

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' }
@timbru31 timbru31 added the bug label Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants