add suffixed:u8 to Expr::Var

This commit is contained in:
Luke Boswell 2024-03-26 11:38:51 +11:00
parent a418bf4fb8
commit 0a3b9c34b3
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
134 changed files with 466 additions and 107 deletions

View file

@ -289,6 +289,7 @@ pub enum Expr<'a> {
Var {
module_name: &'a str, // module_name will only be filled if the original Roc code stated something like `5 + SomeModule.myVar`, module_name will be blank if it was `5 + myVar`
ident: &'a str,
suffixed: u8, // how many `!` suffixes, for example `doTheThing!!` executes a Task that returns a Task
},
Underscore(&'a str),
@ -1395,11 +1396,13 @@ impl<'a> Expr<'a> {
pub const REPL_OPAQUE_FUNCTION: Self = Expr::Var {
module_name: "",
ident: "<function>",
suffixed: 0,
};
pub const REPL_RUNTIME_CRASH: Self = Expr::Var {
module_name: "",
ident: "*",
suffixed: 0,
};
pub fn loc_ref(&'a self, region: Region) -> Loc<&'a Self> {