desugar no args correctly e.g. Stdin.line!

This commit is contained in:
Luke Boswell 2024-03-21 19:25:34 +11:00
parent 5e2fc1c3fd
commit 4035221dac
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0
2 changed files with 9 additions and 0 deletions

View file

@ -601,11 +601,17 @@ impl<'a> Defs<'a> {
let index = value_index.index();
if let ValueDef::Body(_, expr) = &self.value_defs[index] {
// The Suffixed has arguments applied e.g. `Stdout.line! "Hello World"`
if let Expr::Apply(sub_expr, _, _) = expr.value {
if let Expr::Suffixed(_) = sub_expr.value {
return Some((tag_index, index));
}
}
// The Suffixed has NO arguments applied e.g. `Stdin.line!`
if let Expr::Suffixed(_) = expr.value {
return Some((tag_index, index));
}
}
}
}