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

hmenzagh opened this issue Jul 14, 2019 · 3 comments


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
/* : */
/* ::: */

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

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


This comment has been minimized.

Copy link

@goodmind goodmind commented Jul 14, 2019

This is special syntax


This comment has been minimized.

Copy link

@jcready jcready commented Jul 15, 2019


This comment has been minimized.

Copy link

@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
None yet
4 participants
You can’t perform that action at this time.