-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR changes `TypeInfo::Union` and `TypeInfo::Intersection` to both use a separate struct: `TypeUnion` and `TypeIntersection`. It also changes the structure of these types from being linked lists into `Vec`s (using `Punctuated`). This also results in some new visitor methods: `visit_type_union`, `visit_type_union_end`, `visit_type_intersection`, and `visit_type_intersection_end`. This PR also adds the ability to parse leading `|` and `&` in types, such as: ```luau type T = | "A" | "B" | "C" ``` This involved adding a `leading` field to the `TypeUnion` and `TypeIntersection` structs, which contains an optional `TokenReference`. Tests were updated to accommodate the changes, and leading `|` and `&` was added to the `types` test. --------- Co-authored-by: Chris Chang <[email protected]> Co-authored-by: boyned//Kampfkarren <[email protected]>
- Loading branch information
1 parent
ef8564e
commit 4bb43f2
Showing
13 changed files
with
5,977 additions
and
4,951 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.