mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Implement the try
keyword with desugaring
This commit is contained in:
parent
69dd8d77f3
commit
308defac46
9 changed files with 196 additions and 10 deletions
|
@ -48,7 +48,8 @@ impl<'a> Formattable for Expr<'a> {
|
|||
| Tag(_)
|
||||
| OpaqueRef(_)
|
||||
| Crash
|
||||
| Dbg => false,
|
||||
| Dbg
|
||||
| Try => false,
|
||||
|
||||
RecordAccess(inner, _) | TupleAccess(inner, _) | TrySuffix { expr: inner, .. } => {
|
||||
inner.is_multiline()
|
||||
|
@ -199,6 +200,10 @@ impl<'a> Formattable for Expr<'a> {
|
|||
buf.indent(indent);
|
||||
buf.push_str("crash");
|
||||
}
|
||||
Try => {
|
||||
buf.indent(indent);
|
||||
buf.push_str("try");
|
||||
}
|
||||
Apply(loc_expr, loc_args, _) => {
|
||||
// Sadly this assertion fails in practice. The fact that the parser produces code like this is going to
|
||||
// confuse the formatter, because it depends on being able to "see" spaces that logically come before the inner
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue