Fix some line length and attempting issues.

This commit is contained in:
Richard Feldman 2019-09-07 09:43:19 -04:00
parent 2ad510ba77
commit dfd1d4bbb4
10 changed files with 430 additions and 271 deletions

View file

@ -4,13 +4,14 @@ pub mod parser;
pub mod problems;
pub mod string_literal;
use parse::ast::Expr;
use parse::ast::{Attempting, Expr};
use parse::number_literal::number_literal;
use parse::parser::Parser;
use parse::parser::{attempt, one_of2, Parser};
use parse::string_literal::string_literal;
pub fn expr<'a>() -> impl Parser<'a, Expr<'a>> {
parser::one_of2(string_literal(), number_literal())
attempt(
Attempting::Expression,
one_of2(number_literal(), string_literal()),
)
}
const KW_IF: &'static str = "if";