Fix double-wrapping of spaces before implements opaque keyword by making them distinct

This commit is contained in:
Joshua Warner 2025-01-03 18:47:21 -08:00
parent 8955f3e124
commit 6edfc0aa90
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
15 changed files with 313 additions and 251 deletions

View file

@ -1158,20 +1158,17 @@ fn alias_signature<'a>() -> impl Parser<'a, Loc<TypeAnnotation<'a>>, EExpr<'a>>
increment_min_indent(specialize_err(EExpr::Type, type_annotation::located(false)))
}
fn opaque_signature<'a>() -> impl Parser<
'a,
(
Loc<TypeAnnotation<'a>>,
Option<Loc<ImplementsAbilities<'a>>>,
),
EExpr<'a>,
> {
fn opaque_signature<'a>(
) -> impl Parser<'a, (Loc<TypeAnnotation<'a>>, Option<&'a ImplementsAbilities<'a>>), EExpr<'a>> {
and(
specialize_err(EExpr::Type, type_annotation::located_opaque_signature(true)),
optional(backtrackable(specialize_err(
EExpr::Type,
space0_before_e(type_annotation::implements_abilities(), EType::TIndentStart),
))),
optional(map_with_arena(
backtrackable(specialize_err(
EExpr::Type,
type_annotation::implements_abilities(),
)),
|arena, item| &*arena.alloc(item),
)),
)
}