From d12d82dab4759d18044acd66e11e1bde7b2dc269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Thu, 4 Apr 2024 20:39:33 +0200 Subject: [PATCH] * Allow more keywords as argument identifiers --- packages/webidl/src/webidlparser.pp | 2 +- packages/webidl/tests/tcidlparser.pp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/webidl/src/webidlparser.pp b/packages/webidl/src/webidlparser.pp index 14621f53bd..35f857b999 100644 --- a/packages/webidl/src/webidlparser.pp +++ b/packages/webidl/src/webidlparser.pp @@ -489,7 +489,7 @@ begin Result.HasEllipsis:=True; GetToken; end; - CheckCurrentTokens([tkIdentifier,tkOther,tkCallback,tkInterface]); + CheckCurrentTokens([tkIdentifier,tkOther,tkCallback,tkInterface,tkConstructor,tkAttribute]); Result.Name:=CurrentTokenString; ok:=true; finally diff --git a/packages/webidl/tests/tcidlparser.pp b/packages/webidl/tests/tcidlparser.pp index 5f69a7bf75..1a16b81e76 100644 --- a/packages/webidl/tests/tcidlparser.pp +++ b/packages/webidl/tests/tcidlparser.pp @@ -244,6 +244,7 @@ Type Procedure TestOptionalDefaultArgFunction; Procedure TestFunction_ClampArg; Procedure TestFunction_ArgNameCallback; + procedure TestFunction_ArgNameConstructor; end; { TTestDictionaryParser } @@ -524,6 +525,12 @@ begin ParseFunction('void getAsString(FunctionStringCallback? callback)','getAsString','void',['FunctionStringCallback','callback']); end; +procedure TTestOperationInterfaceParser.TestFunction_ArgNameConstructor; +begin + ParseFunction('void getAsString(FunctionStringCallback? constructor)','getAsString','void',['FunctionStringCallback','constructor']); +end; + + { TTestSerializerInterfaceParser } function TTestSerializerInterfaceParser.ParseSerializer(ADef: UTF8String; Attrs: array of UTF8String): TIDLSerializerDefinition;