mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
add basic Dbg desugaring and LowLevelDbg
This commit is contained in:
parent
3f276b6018
commit
b7f72eff86
12 changed files with 84 additions and 30 deletions
|
@ -62,6 +62,9 @@ impl<'a> Formattable for Expr<'a> {
|
|||
condition.is_multiline() || continuation.is_multiline()
|
||||
}
|
||||
Dbg(condition, continuation) => condition.is_multiline() || continuation.is_multiline(),
|
||||
LowLevelDbg(condition, continuation) => {
|
||||
condition.is_multiline() || continuation.is_multiline()
|
||||
}
|
||||
|
||||
If(branches, final_else) => {
|
||||
final_else.is_multiline()
|
||||
|
@ -435,6 +438,9 @@ impl<'a> Formattable for Expr<'a> {
|
|||
Dbg(condition, continuation) => {
|
||||
fmt_dbg(buf, condition, continuation, self.is_multiline(), indent);
|
||||
}
|
||||
LowLevelDbg(_, _) => unreachable!(
|
||||
"LowLevelDbg should only exist after desugaring, not during formatting"
|
||||
),
|
||||
If(branches, final_else) => {
|
||||
fmt_if(buf, branches, final_else, self.is_multiline(), indent);
|
||||
}
|
||||
|
|
|
@ -726,6 +726,10 @@ impl<'a> RemoveSpaces<'a> for Expr<'a> {
|
|||
arena.alloc(a.remove_spaces(arena)),
|
||||
arena.alloc(b.remove_spaces(arena)),
|
||||
),
|
||||
Expr::LowLevelDbg(a, b) => Expr::LowLevelDbg(
|
||||
arena.alloc(a.remove_spaces(arena)),
|
||||
arena.alloc(b.remove_spaces(arena)),
|
||||
),
|
||||
Expr::Apply(a, b, c) => Expr::Apply(
|
||||
arena.alloc(a.remove_spaces(arena)),
|
||||
b.remove_spaces(arena),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue