minor fixes

This commit is contained in:
Anton-4 2023-08-11 16:14:33 +02:00
parent 254226f067
commit 954f687666
No known key found for this signature in database
GPG key ID: 0971D718C0A9B937
3 changed files with 6 additions and 6 deletions

View file

@ -1286,7 +1286,7 @@ mod ability {
Exact(u32), Exact(u32),
} }
/// Parses an ability demand like `hash : a -> U64 | a implements Hash`, in the context of a larger /// Parses an ability demand like `hash : a -> U64 where a implements Hash`, in the context of a larger
/// ability definition. /// ability definition.
/// This is basically the same as parsing a free-floating annotation, but with stricter rules. /// This is basically the same as parsing a free-floating annotation, but with stricter rules.
pub fn parse_demand<'a>( pub fn parse_demand<'a>(

View file

@ -599,7 +599,7 @@ pub enum EType<'a> {
TEnd(Position), TEnd(Position),
TFunctionArgument(Position), TFunctionArgument(Position),
TWhereBar(Position), TWhereBar(Position),
THasClause(Position), TImplementsClause(Position),
TAbilityImpl(ETypeAbilityImpl<'a>, Position), TAbilityImpl(ETypeAbilityImpl<'a>, Position),
/// ///
TIndentStart(Position), TIndentStart(Position),

View file

@ -426,7 +426,7 @@ fn ability_chain<'a>() -> impl Parser<'a, Vec<'a, Loc<TypeAnnotation<'a>>>, ETyp
EType::TIndentEnd, EType::TIndentEnd,
), ),
zero_or_more!(skip_first!( zero_or_more!(skip_first!(
word1(b'&', EType::THasClause), word1(b'&', EType::TImplementsClause),
space0_before_optional_after( space0_before_optional_after(
specialize(EType::TApply, loc!(concrete_type())), specialize(EType::TApply, loc!(concrete_type())),
EType::TIndentStart, EType::TIndentStart,
@ -459,7 +459,7 @@ fn implements_clause<'a>() -> impl Parser<'a, Loc<ImplementsClause<'a>>, EType<'
), ),
skip_first!( skip_first!(
// Parse "implements"; we don't care about this keyword // Parse "implements"; we don't care about this keyword
word(crate::keyword::IMPLEMENTS, EType::THasClause), word(crate::keyword::IMPLEMENTS, EType::TImplementsClause),
// Parse "Hash & ..."; this may be qualified from another module like "Hash.Hash" // Parse "Hash & ..."; this may be qualified from another module like "Hash.Hash"
absolute_column_min_indent(ability_chain()) absolute_column_min_indent(ability_chain())
) )
@ -494,7 +494,7 @@ fn implements_clause_chain<'a>(
let (_, first_clause, state) = implements_clause().parse(arena, state, min_indent)?; let (_, first_clause, state) = implements_clause().parse(arena, state, min_indent)?;
let (_, mut clauses, state) = zero_or_more!(skip_first!( let (_, mut clauses, state) = zero_or_more!(skip_first!(
word1(b',', EType::THasClause), word1(b',', EType::TImplementsClause),
implements_clause() implements_clause()
)) ))
.parse(arena, state, min_indent)?; .parse(arena, state, min_indent)?;
@ -514,7 +514,7 @@ fn implements_clause_chain<'a>(
pub fn implements_abilities<'a>() -> impl Parser<'a, Loc<ImplementsAbilities<'a>>, EType<'a>> { pub fn implements_abilities<'a>() -> impl Parser<'a, Loc<ImplementsAbilities<'a>>, EType<'a>> {
increment_min_indent(skip_first!( increment_min_indent(skip_first!(
// Parse "implements"; we don't care about this keyword // Parse "implements"; we don't care about this keyword
word(crate::keyword::IMPLEMENTS, EType::THasClause), word(crate::keyword::IMPLEMENTS, EType::TImplementsClause),
// Parse "Hash"; this may be qualified from another module like "Hash.Hash" // Parse "Hash"; this may be qualified from another module like "Hash.Hash"
space0_before_e( space0_before_e(
loc!(map!( loc!(map!(