mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-31 00:57:24 +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
|
@ -98,6 +98,16 @@ pub enum CalledVia {
|
|||
|
||||
/// This call is a result of lowering a reference to a module-params-extended def
|
||||
NakedParamsVar,
|
||||
|
||||
/// This call is the result of desugaring a `try` expression into an early return on Err
|
||||
/// e.g. `try parseDate input` becomes:
|
||||
///
|
||||
/// ```roc
|
||||
/// when parseDate input is
|
||||
/// Err err -> return Err err
|
||||
/// Ok value -> value
|
||||
/// ```
|
||||
Try,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue