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 leading pipes for type aliases #1353

Closed

Conversation

jeffmo
Copy link
Contributor

@jeffmo jeffmo commented Feb 2, 2016

Ocaml allows this on pattern matches and it's convenient for larger unions that span one-per-line.

This adds support for this to the flow parser:

type Nodes = 
  | {type: "Identifier", ... }
  | {type: "Expression", ... }
  | {type: "Literal", ... }
  ...
;

Note that this adds leading-| support for type aliases only for now. We could easily expand to other annotations, but I figured it's most useful for type aliases of large unions -- so might as well start there and leave other things constrained for now. Should be easy to open this up to all annotations in the future if we have a good reason to.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants