Define and use IMPLEMENTS const in roc_parse::keyword

This commit is contained in:
Bryce Miller 2023-05-29 07:21:27 -04:00
parent 9640fcb6d4
commit e514d0cb83
No known key found for this signature in database
GPG key ID: F1E97BF8DF152350
12 changed files with 37 additions and 26 deletions

View file

@ -138,7 +138,7 @@ fn loc_tag_pattern_arg<'a>(
let Loc { region, value } = loc_pat;
if stop_on_has_kw && matches!(value, Pattern::Identifier("implements")) {
if stop_on_has_kw && matches!(value, Pattern::Identifier(crate::keyword::IMPLEMENTS)) {
Err((NoProgress, EPattern::End(original_state.pos())))
} else {
Ok((
@ -158,7 +158,10 @@ pub fn loc_implements_parser<'a>() -> impl Parser<'a, Loc<Implements<'a>>, EPatt
then(
loc_tag_pattern_arg(false),
|_arena, state, progress, pattern| {
if matches!(pattern.value, Pattern::Identifier("implements")) {
if matches!(
pattern.value,
Pattern::Identifier(crate::keyword::IMPLEMENTS)
) {
Ok((
progress,
Loc::at(pattern.region, Implements::Implements),