Parse ! suffixes as an Expr::TaskAwaitBang instead of using suffix field in ident

This commit is contained in:
Joshua Warner 2024-04-23 20:58:32 -07:00 committed by Luke Boswell
parent 4b4aee3c1a
commit 6080c12ca8
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
8 changed files with 94 additions and 89 deletions

View file

@ -252,7 +252,7 @@ pub enum Expr<'a> {
is_negative: bool,
},
// String Literals
/// String Literals
Str(StrLiteral<'a>), // string without escapes in it
/// eg 'b'
SingleQuote(&'a str),
@ -266,6 +266,9 @@ pub enum Expr<'a> {
/// Look up exactly one field on a tuple, e.g. `(x, y).1`.
TupleAccess(&'a Expr<'a>, &'a str),
/// Task await bang - i.e. the ! in `File.readUtf8! path`
TaskAwaitBang(&'a Expr<'a>),
// Collection Literals
List(Collection<'a, &'a Loc<Expr<'a>>>),
@ -1873,7 +1876,8 @@ impl<'a> Malformed for Expr<'a> {
Str(inner) => inner.is_malformed(),
RecordAccess(inner, _) |
TupleAccess(inner, _) => inner.is_malformed(),
TupleAccess(inner, _) |
TaskAwaitBang(inner) => inner.is_malformed(),
List(items) => items.is_malformed(),