mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-24 06:55:15 +00:00
add src and location to dbg
This commit is contained in:
parent
4587c4ebc5
commit
3966d63e2f
21 changed files with 385 additions and 119 deletions
|
@ -302,7 +302,7 @@ pub enum Expr<'a> {
|
|||
Expect(&'a Loc<Expr<'a>>, &'a Loc<Expr<'a>>),
|
||||
Dbg(&'a Loc<Expr<'a>>, &'a Loc<Expr<'a>>),
|
||||
// This form of debug is a desugared call to roc_dbg
|
||||
LowLevelDbg(&'a Loc<Expr<'a>>, &'a Loc<Expr<'a>>),
|
||||
LowLevelDbg(&'a str, &'a str, &'a Loc<Expr<'a>>, &'a Loc<Expr<'a>>),
|
||||
|
||||
// Application
|
||||
/// To apply by name, do Apply(Var(...), ...)
|
||||
|
@ -1537,7 +1537,7 @@ impl<'a> Malformed for Expr<'a> {
|
|||
Backpassing(args, call, body) => args.iter().any(|arg| arg.is_malformed()) || call.is_malformed() || body.is_malformed(),
|
||||
Expect(condition, continuation) |
|
||||
Dbg(condition, continuation) => condition.is_malformed() || continuation.is_malformed(),
|
||||
LowLevelDbg(condition, continuation) => condition.is_malformed() || continuation.is_malformed(),
|
||||
LowLevelDbg(_, _, condition, continuation) => condition.is_malformed() || continuation.is_malformed(),
|
||||
Apply(func, args, _) => func.is_malformed() || args.iter().any(|arg| arg.is_malformed()),
|
||||
BinOps(firsts, last) => firsts.iter().any(|(expr, _)| expr.is_malformed()) || last.is_malformed(),
|
||||
UnaryOp(expr, _) => expr.is_malformed(),
|
||||
|
|
|
@ -1933,7 +1933,7 @@ fn expr_to_pattern_help<'a>(arena: &'a Bump, expr: &Expr<'a>) -> Result<Pattern<
|
|||
| Expr::When(_, _)
|
||||
| Expr::Expect(_, _)
|
||||
| Expr::Dbg(_, _)
|
||||
| Expr::LowLevelDbg(_, _)
|
||||
| Expr::LowLevelDbg(_, _, _, _)
|
||||
| Expr::MalformedClosure
|
||||
| Expr::PrecedenceConflict { .. }
|
||||
| Expr::MultipleRecordBuilders { .. }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue