remove Attempting and more

This commit is contained in:
Folkert 2021-03-12 02:09:48 +01:00
parent 98024b2a21
commit 5e4db62c46
6 changed files with 46 additions and 136 deletions

View file

@ -7,8 +7,8 @@ use crate::header::{
use crate::ident::{lowercase_ident, unqualified_ident, uppercase_ident};
use crate::parser::Progress::{self, *};
use crate::parser::{
backtrackable, end_of_file, specialize, word1, Col, EEffects, EExposes, EHeader, EImports,
EPackages, EProvides, ERequires, ETypedIdent, Parser, Row, State, SyntaxError,
backtrackable, specialize, word1, Col, EEffects, EExposes, EHeader, EImports, EPackages,
EProvides, ERequires, ETypedIdent, Parser, Row, State, SyntaxError,
};
use crate::string_literal;
use crate::type_annotation;
@ -249,6 +249,16 @@ fn platform_header<'a>() -> impl Parser<'a, PlatformHeader<'a>, EHeader<'a>> {
}
}
fn end_of_file<'a>() -> impl Parser<'a, (), SyntaxError<'a>> {
|_arena, state: State<'a>| {
if state.has_reached_end() {
Ok((NoProgress, (), state))
} else {
Err((NoProgress, SyntaxError::ConditionFailed, state))
}
}
}
#[inline(always)]
pub fn module_defs<'a>() -> impl Parser<'a, Vec<'a, Located<Def<'a>>>, SyntaxError<'a>> {
use crate::parser::EExpr;