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

Error when parsing colons in a comment #7928

Closed
hmenzagh opened this issue Jul 14, 2019 · 3 comments
Labels

Comments

@hmenzagh
Copy link

@hmenzagh hmenzagh commented Jul 14, 2019

Flow version: 0.102

Expected behavior

No error or warning

Actual behavior

Throws a Unexpected token :Flow(ParseError)

When parsing
/* : */
or
/* ::: */

but not when there is two :
/* :: */

if other characters are present in the string (before the first colon) the error vanishes

@goodmind

This comment has been minimized.

Copy link
Collaborator

@goodmind goodmind commented Jul 14, 2019

This is special syntax

@jcready

This comment has been minimized.

Copy link
Contributor

@jcready jcready commented Jul 15, 2019

@mroch

This comment has been minimized.

Copy link
Contributor

@mroch mroch commented Jul 15, 2019

This should only apply when the file has the // @flow pragma. enabling Flow on a file changes the semantics of this, and one other construct -- a<b>(c) becomes a type argument, rather than ((a < b) > c). all our other syntax extensions are otherwise invalid JS, as far as I know.

So, this is working as intended (reopen if it's happening without @flow). If anything, we could probably use better documentation about the semantics changes vs normal JS.

@mroch mroch closed this Jul 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.