Ver código fonte

* Allow more keywords as argument identifiers

Michaël Van Canneyt 1 ano atrás
pai
commit
d12d82dab4

+ 1 - 1
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

+ 7 - 0
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;