Browse Source

webidl: attribute name interface

mattias 3 years ago
parent
commit
6719b7df29
2 changed files with 7 additions and 1 deletions
  1. 1 1
      packages/webidl/src/webidlparser.pp
  2. 6 0
      packages/webidl/tests/tcidlparser.pp

+ 1 - 1
packages/webidl/src/webidlparser.pp

@@ -785,7 +785,7 @@ begin
   ok:=false;
   ok:=false;
   try
   try
     Result.AttributeType:=ParseType(Result,True,True);
     Result.AttributeType:=ParseType(Result,True,True);
-    CheckCurrentTokens([tkIdentifier,tkRequired]);
+    CheckCurrentTokens([tkIdentifier,tkRequired,tkInterface]);
     Result.Name:=CurrentTokenString;
     Result.Name:=CurrentTokenString;
     Result.Options:=Options;
     Result.Options:=Options;
     ok:=true;
     ok:=true;

+ 6 - 0
packages/webidl/tests/tcidlparser.pp

@@ -197,6 +197,7 @@ Type
     Procedure ParseSimpleReadonlyStringifierAttribute;
     Procedure ParseSimpleReadonlyStringifierAttribute;
     Procedure ParseComplexReadonlyStaticAttribute;
     Procedure ParseComplexReadonlyStaticAttribute;
     Procedure ParseSimpleAttributeRequired;
     Procedure ParseSimpleAttributeRequired;
+    Procedure ParseSimpleAttributeInterface;
     Procedure ParseIdentifierAttribute;
     Procedure ParseIdentifierAttribute;
     Procedure Parse2IdentifierAttributes;
     Procedure Parse2IdentifierAttributes;
   end;
   end;
@@ -721,6 +722,11 @@ begin
   ParseAttribute('attribute boolean required','required','boolean',[]);
   ParseAttribute('attribute boolean required','required','boolean',[]);
 end;
 end;
 
 
+procedure TTestAttributeInterfaceParser.ParseSimpleAttributeInterface;
+begin
+  ParseAttribute('attribute boolean interface','interface','boolean',[]);
+end;
+
 procedure TTestAttributeInterfaceParser.ParseIdentifierAttribute;
 procedure TTestAttributeInterfaceParser.ParseIdentifierAttribute;
 begin
 begin
   ParseAttribute('attribute B A','A','B',[]);
   ParseAttribute('attribute B A','A','B',[]);