feat: switch generic type args to be delimited by chevrons
This commit is contained in:
parent
51d1dce180
commit
dfc57b347a
|
@ -1333,7 +1333,7 @@ pub fn type_parser() -> impl Parser<Token, ast::Annotation, Error = ParseError>
|
||||||
r.clone()
|
r.clone()
|
||||||
.separated_by(just(Token::Comma))
|
.separated_by(just(Token::Comma))
|
||||||
.allow_trailing()
|
.allow_trailing()
|
||||||
.delimited_by(just(Token::LeftParen), just(Token::RightParen))
|
.delimited_by(just(Token::Less), just(Token::Greater))
|
||||||
.or_not(),
|
.or_not(),
|
||||||
)
|
)
|
||||||
.map_with_span(|(name, arguments), span| ast::Annotation::Constructor {
|
.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}
|
select! {Token::Name { name } => name}
|
||||||
.separated_by(just(Token::Comma))
|
.separated_by(just(Token::Comma))
|
||||||
.allow_trailing()
|
.allow_trailing()
|
||||||
.delimited_by(just(Token::LeftParen), just(Token::RightParen))
|
.delimited_by(just(Token::Less), just(Token::Greater))
|
||||||
.or_not(),
|
.or_not(),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
@ -92,7 +92,7 @@ fn import_alias() {
|
||||||
#[test]
|
#[test]
|
||||||
fn custom_type() {
|
fn custom_type() {
|
||||||
let code = indoc! {r#"
|
let code = indoc! {r#"
|
||||||
type Option(a) {
|
type Option<a> {
|
||||||
Some(a, Int)
|
Some(a, Int)
|
||||||
None
|
None
|
||||||
Wow { name: Int, age: Int }
|
Wow { name: Int, age: Int }
|
||||||
|
@ -225,7 +225,7 @@ fn opaque_type() {
|
||||||
#[test]
|
#[test]
|
||||||
fn type_alias() {
|
fn type_alias() {
|
||||||
let code = indoc! {r#"
|
let code = indoc! {r#"
|
||||||
type Thing = Option(Int)
|
type Thing = Option<Int>
|
||||||
"#};
|
"#};
|
||||||
|
|
||||||
assert_definition(
|
assert_definition(
|
||||||
|
@ -255,7 +255,7 @@ fn type_alias() {
|
||||||
#[test]
|
#[test]
|
||||||
fn pub_type_alias() {
|
fn pub_type_alias() {
|
||||||
let code = indoc! {r#"
|
let code = indoc! {r#"
|
||||||
pub type Me = Option(String)
|
pub type Me = Option<String>
|
||||||
"#};
|
"#};
|
||||||
|
|
||||||
assert_definition(
|
assert_definition(
|
||||||
|
|
Loading…
Reference in New Issue