Merge pull request #4567 from joshuawarner32/tuple-type-annotation

Implement tuple type parsing
This commit is contained in:
Ayaz 2022-11-24 14:42:11 -06:00 committed by GitHub
commit 848c18f996
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 721 additions and 69 deletions

View file

@ -533,6 +533,13 @@ pub enum TypeAnnotation<'a> {
ext: Option<&'a Loc<TypeAnnotation<'a>>>,
},
Tuple {
fields: Collection<'a, Loc<TypeAnnotation<'a>>>,
/// The row type variable in an open record, e.g. the `r` in `{ name: Str }r`.
/// This is None if it's a closed record annotation like `{ name: Str }`.
ext: Option<&'a Loc<TypeAnnotation<'a>>>,
},
/// A tag union, e.g. `[
TagUnion {
/// The row type variable in an open tag union, e.g. the `a` in `[Foo, Bar]a`.