diff --git a/crates/lang/src/parser.rs b/crates/lang/src/parser.rs index d2c98f1c..d0efa9dd 100644 --- a/crates/lang/src/parser.rs +++ b/crates/lang/src/parser.rs @@ -1333,7 +1333,7 @@ pub fn type_parser() -> impl Parser 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>) 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(), ), ) diff --git a/crates/lang/src/tests/parser.rs b/crates/lang/src/tests/parser.rs index 44227431..cbadcbf8 100644 --- a/crates/lang/src/tests/parser.rs +++ b/crates/lang/src/tests/parser.rs @@ -92,7 +92,7 @@ fn import_alias() { #[test] fn custom_type() { let code = indoc! {r#" - type Option(a) { + type Option { 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 "#}; 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 "#}; assert_definition(