From 97f0594db95d8f8f5aee3abfd845d8eaec97aa8d Mon Sep 17 00:00:00 2001 From: hydroper Date: Fri, 3 May 2024 09:28:49 -0300 Subject: [PATCH] Fix interface method body --- Cargo.lock | 2 +- crates/parser/Cargo.toml | 2 +- crates/parser/parser/parser.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 649f09b..1c1411b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,7 +67,7 @@ checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" [[package]] name = "as3_parser" -version = "1.0.9" +version = "1.0.10" dependencies = [ "bitflags", "by_address", diff --git a/crates/parser/Cargo.toml b/crates/parser/Cargo.toml index a9d1d14..04d9a3b 100644 --- a/crates/parser/Cargo.toml +++ b/crates/parser/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "as3_parser" -version = "1.0.9" +version = "1.0.10" edition = "2021" authors = ["hydroper "] repository = "https://github.com/hydroper/as3parser" diff --git a/crates/parser/parser/parser.rs b/crates/parser/parser/parser.rs index 1d82cc4..a75fb08 100644 --- a/crates/parser/parser/parser.rs +++ b/crates/parser/parser/parser.rs @@ -3727,10 +3727,10 @@ impl<'input> Parser<'input> { // Body verification. // - // Note that interface methods must have a body unlike in Java. - if (has_native || has_abstract) && common.body.is_some() { + // Note that interface methods must never have a body unlike in Java. + if (interface_method || has_native || has_abstract) && common.body.is_some() { self.add_syntax_error(&name.location(), DiagnosticKind::FunctionMustNotContainBody, diagarg![]); - } else if (interface_method || !(has_native || has_abstract)) && common.body.is_none() { + } else if !(has_native || has_abstract) && common.body.is_none() { self.add_syntax_error(&name.location(), DiagnosticKind::FunctionMustContainBody, diagarg![]); }