diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b9b2f00..d0fd6476 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Added + +- Added support for Delphi 13 `noreturn` directive. + ## [0.7.0] - 2025-11-11 ### Added diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index 417eabaa..163f76c8 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added + +- Added support for Delphi 13 `noreturn` directive. + ## 0.7.0 - 2025-11-11 ### Added diff --git a/core/benches/benchmark_lexer.rs b/core/benches/benchmark_lexer.rs index f98fb29e..0950c0da 100644 --- a/core/benches/benchmark_lexer.rs +++ b/core/benches/benchmark_lexer.rs @@ -98,7 +98,6 @@ const OPERATORS: [&str; 24] = [ const KEYWORDS: [&str; 123] = [ "absolute", "abstract", - "add", "align", "and", "array", @@ -160,6 +159,7 @@ const KEYWORDS: [&str; 123] = [ "near", "nil", "nodefault", + "noreturn", "not", "object", "of", @@ -187,7 +187,6 @@ const KEYWORDS: [&str; 123] = [ "reference", "register", "reintroduce", - "remove", "repeat", "requires", "resident", @@ -201,6 +200,7 @@ const KEYWORDS: [&str; 123] = [ "stdcall", "stored", "strict", + "string", "then", "threadvar", "to", @@ -212,9 +212,9 @@ const KEYWORDS: [&str; 123] = [ "uses", "var", "varargs", - "variant", "virtual", "while", + "winapi", "with", "write", "writeonly", diff --git a/core/src/defaults/lexer.rs b/core/src/defaults/lexer.rs index b15ee07b..3293a9cf 100644 --- a/core/src/defaults/lexer.rs +++ b/core/src/defaults/lexer.rs @@ -321,7 +321,7 @@ const fn make_byte_map(map: &[(ByteSet<'_>, T)], default: T) -> [T; 256 // endregion: byte-set // region: keywords -const KEYWORDS: [(&str, RawTokenType); 122] = [ +const KEYWORDS: [(&str, RawTokenType); 123] = [ ("absolute", TT::IdentifierOrKeyword(KK::Absolute)), ("abstract", TT::IdentifierOrKeyword(KK::Abstract)), ("align", TT::IdentifierOrKeyword(KK::Align)), @@ -385,6 +385,7 @@ const KEYWORDS: [(&str, RawTokenType); 122] = [ ("near", TT::IdentifierOrKeyword(KK::Near)), ("nil", TT::Keyword(KK::Nil)), ("nodefault", TT::IdentifierOrKeyword(KK::NoDefault)), + ("noreturn", TT::IdentifierOrKeyword(KK::NoReturn)), ("not", TT::Keyword(KK::Not)), ("object", TT::Keyword(KK::Object)), ("of", TT::Keyword(KK::Of)), diff --git a/core/src/defaults/parser/token_consolidation_tests.rs b/core/src/defaults/parser/token_consolidation_tests.rs index c5797378..bde22e56 100644 --- a/core/src/defaults/parser/token_consolidation_tests.rs +++ b/core/src/defaults/parser/token_consolidation_tests.rs @@ -157,6 +157,7 @@ method_directive_consolidation_test!( method_directive_ident_consolidation_test!( forward = { "FORWARD" }, external = { "EXTERNAL" }, + noreturn = { "NORETURN" }, name = { "NAME dll_name" }, index = { "INDEX 1" }, delayed = { "DELAYED" }, diff --git a/core/src/lang.rs b/core/src/lang.rs index 0bf10d3d..a318f782 100644 --- a/core/src/lang.rs +++ b/core/src/lang.rs @@ -146,6 +146,7 @@ pub enum KeywordKind { Name, Near, NoDefault, + NoReturn, On, Operator, Out, @@ -192,6 +193,7 @@ impl KeywordKind { | KeywordKind::Abstract | KeywordKind::Final | KeywordKind::Inline + | KeywordKind::NoReturn | KeywordKind::Assembler | KeywordKind::Cdecl | KeywordKind::Pascal diff --git a/misc/keywords.txt b/misc/keywords.txt index 125e4b32..d4703f7f 100644 --- a/misc/keywords.txt +++ b/misc/keywords.txt @@ -61,6 +61,7 @@ name near nil nodefault +noreturn not object of