keyword in record field

This commit is contained in:
Folkert 2021-02-08 22:39:12 +01:00
parent 860aa6d194
commit 0ccf17007e
6 changed files with 144 additions and 57 deletions

View file

@ -1,7 +1,9 @@
use crate::ast::Attempting;
use crate::keyword;
use crate::parser::Progress::{self, *};
use crate::parser::{peek_utf8_char, unexpected, ParseResult, Parser, State, SyntaxError};
use crate::parser::{
backtrackable, peek_utf8_char, unexpected, ParseResult, Parser, State, SyntaxError,
};
use bumpalo::collections::string::String;
use bumpalo::collections::vec::Vec;
use bumpalo::Bump;
@ -383,7 +385,7 @@ where
/// * A record field, e.g. "email" in `.email` or in `email:`
/// * A named pattern match, e.g. "foo" in `foo =` or `foo ->` or `\foo ->`
pub fn lowercase_ident<'a>() -> impl Parser<'a, &'a str, SyntaxError<'a>> {
move |arena, state| {
move |arena, state: State<'a>| {
let (progress, ident, state) =
global_tag_or_ident(|first_char| first_char.is_lowercase()).parse(arena, state)?;