just panics on new lines again now

This commit is contained in:
LunarAkai 2025-08-07 21:13:46 +02:00
commit 783955d671
3 changed files with 13 additions and 17 deletions

View file

@ -64,21 +64,19 @@ where
add_sub
});
let decl = recursive(|decl| {
let r#var = just(Token::Var)
//let decl = recursive(|decl| {
let var = just(Token::Var)
.ignore_then(ident)
.then_ignore(just(Token::Assign))
.then(expr.clone())
.then_ignore(just(Token::NewLine).or_not())
.then(decl)
.map(|(name, rhs)| Expr::Assignment {
target: Box::new(Expr::Ident(name.0)),
target: Box::new(Expr::Ident(name)),
value: Box::new(rhs),
});
r#var.or(expr)
});
decl.then_ignore(end())
var.or(expr)
//});
//decl.then_ignore(end())
}