mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
Update to use new square brace formatting
This commit is contained in:
parent
0fae5b0bac
commit
4eec34becf
120 changed files with 1149 additions and 1155 deletions
|
@ -392,7 +392,7 @@ pub struct HasClause<'a> {
|
|||
|
||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||
pub enum Derived<'a> {
|
||||
/// `has [ Eq, Hash ]`
|
||||
/// `has [Eq, Hash]`
|
||||
Has(Collection<'a, AbilityName<'a>>),
|
||||
|
||||
// We preserve this for the formatter; canonicalization ignores it.
|
||||
|
@ -429,7 +429,7 @@ pub enum TypeAnnotation<'a> {
|
|||
/// A bound type variable, e.g. `a` in `(a -> a)`
|
||||
BoundVariable(&'a str),
|
||||
|
||||
/// Inline type alias, e.g. `as List a` in `[ Cons a (List a), Nil ] as List a`
|
||||
/// Inline type alias, e.g. `as List a` in `[Cons a (List a), Nil] as List a`
|
||||
As(
|
||||
&'a Loc<TypeAnnotation<'a>>,
|
||||
&'a [CommentOrNewline<'a>],
|
||||
|
@ -445,8 +445,8 @@ pub enum 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`.
|
||||
/// This is None if it's a closed tag union like `[ Foo, Bar]`.
|
||||
/// The row type variable in an open tag union, e.g. the `a` in `[Foo, Bar]a`.
|
||||
/// This is None if it's a closed tag union like `[Foo, Bar]`.
|
||||
ext: Option<&'a Loc<TypeAnnotation<'a>>>,
|
||||
tags: Collection<'a, Loc<Tag<'a>>>,
|
||||
},
|
||||
|
|
|
@ -600,7 +600,7 @@ fn append_body_definition<'a>(
|
|||
}),
|
||||
)) => {
|
||||
// This is a case like
|
||||
// UserId x : [ UserId Int ]
|
||||
// UserId x : [UserId Int]
|
||||
// UserId x = UserId 42
|
||||
// We optimistically parsed the first line as an alias; we now turn it
|
||||
// into an annotation.
|
||||
|
|
|
@ -48,7 +48,7 @@ fn tag_union_type<'a>(
|
|||
)
|
||||
.parse(arena, state)?;
|
||||
|
||||
// This could be an open tag union, e.g. `[ Foo, Bar ]a`
|
||||
// This could be an open tag union, e.g. `[Foo, Bar]a`
|
||||
let (_, ext, state) = optional(allocated(specialize_ref(
|
||||
ETypeTagUnion::Type,
|
||||
term(min_indent, stop_at_surface_has),
|
||||
|
@ -135,7 +135,7 @@ fn term<'a>(
|
|||
loc!(parse_type_variable(stop_at_surface_has)),
|
||||
fail_type_start(),
|
||||
),
|
||||
// Inline alias notation, e.g. [ Nil, Cons a (List a) ] as List a
|
||||
// Inline alias notation, e.g. [Nil, Cons a (List a)] as List a
|
||||
one_of![
|
||||
map!(
|
||||
and!(
|
||||
|
@ -478,7 +478,7 @@ fn has_clause_chain<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
/// Parse a has-derived clause, e.g. `has [ Eq, Hash ]`.
|
||||
/// Parse a has-derived clause, e.g. `has [Eq, Hash]`.
|
||||
pub fn has_derived<'a>(min_indent: u32) -> impl Parser<'a, Loc<Derived<'a>>, EType<'a>> {
|
||||
skip_first!(
|
||||
// Parse "has"; we don't care about this keyword
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue