feat: Implement diagnostic for await outside of async

This commit is contained in:
Shoyu Vanilla 2024-08-05 03:07:24 +09:00
parent aa00ddcf65
commit 8a51419a2d
6 changed files with 187 additions and 17 deletions

View file

@ -48,6 +48,7 @@ macro_rules! diagnostics {
// ]
diagnostics![
AwaitOutsideOfAsync,
BreakOutsideOfLoop,
ExpectedFunction,
InactiveCode,
@ -135,6 +136,12 @@ pub struct UnreachableLabel {
pub name: Name,
}
#[derive(Debug)]
pub struct AwaitOutsideOfAsync {
pub node: InFile<AstPtr<ast::AwaitExpr>>,
pub location: String,
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct UndeclaredLabel {
pub node: InFile<AstPtr<ast::Lifetime>>,