Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow leading pipes for type aliases of unions
Summary: 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: ```javascript 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. Closes #1353 Reviewed By: samwgoldman Differential Revision: D2897790 Pulled By: jeffmo fb-gh-sync-id: edef99adca2876747ea330fa9478b2ed5be36506
- Loading branch information