Parse basic expressions
This commit is contained in:
parent
274ed8b3ca
commit
13413702ed
1 changed files with 11 additions and 3 deletions
|
|
@ -194,7 +194,15 @@ fn table_constr(
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn parser() -> impl Parser<char, TableConstr, Error = Error> {
|
fn expr(
|
||||||
let expr = recursive(|expr| lit(expr).map(Expr::Lit));
|
expr: impl Parser<char, Expr, Error = Error> + Clone,
|
||||||
table_constr(expr).padded().then_ignore(end())
|
) -> impl Parser<char, Expr, Error = Error> {
|
||||||
|
let lit = lit(expr.clone()).map(Expr::Lit);
|
||||||
|
let table_constr = table_constr(expr.clone()).map(Expr::TableConstr);
|
||||||
|
|
||||||
|
lit.or(table_constr)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn parser() -> impl Parser<char, Expr, Error = Error> {
|
||||||
|
recursive(expr).padded().then_ignore(end())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue