feat: switch generic type args to be delimited by chevrons

This commit is contained in:
rvcas 2022-12-12 18:27:44 -05:00 committed by Lucas
parent 51d1dce180
commit dfc57b347a
2 changed files with 5 additions and 5 deletions

View File

@ -1333,7 +1333,7 @@ pub fn type_parser() -> impl Parser<Token, ast::Annotation, Error = ParseError>
r.clone()
.separated_by(just(Token::Comma))
.allow_trailing()
.delimited_by(just(Token::LeftParen), just(Token::RightParen))
.delimited_by(just(Token::Less), just(Token::Greater))
.or_not(),
)
.map_with_span(|(name, arguments), span| ast::Annotation::Constructor {
@ -1399,7 +1399,7 @@ pub fn type_name_with_args() -> impl Parser<Token, (String, Option<Vec<String>>)
select! {Token::Name { name } => name}
.separated_by(just(Token::Comma))
.allow_trailing()
.delimited_by(just(Token::LeftParen), just(Token::RightParen))
.delimited_by(just(Token::Less), just(Token::Greater))
.or_not(),
),
)

View File

@ -92,7 +92,7 @@ fn import_alias() {
#[test]
fn custom_type() {
let code = indoc! {r#"
type Option(a) {
type Option<a> {
Some(a, Int)
None
Wow { name: Int, age: Int }
@ -225,7 +225,7 @@ fn opaque_type() {
#[test]
fn type_alias() {
let code = indoc! {r#"
type Thing = Option(Int)
type Thing = Option<Int>
"#};
assert_definition(
@ -255,7 +255,7 @@ fn type_alias() {
#[test]
fn pub_type_alias() {
let code = indoc! {r#"
pub type Me = Option(String)
pub type Me = Option<String>
"#};
assert_definition(