From 5084c5bbb44a684f61f86946cf1720f24ae87b64 Mon Sep 17 00:00:00 2001
From: Tab Atkins-Bittner
Date: Thu, 5 Sep 2019 14:31:51 -0700
Subject: [PATCH] Update widlparser. Fixes #1513, closes #1514.
---
bikeshed/widlparser/CONTRIBUTING.md | 17 +
bikeshed/widlparser/test-expected.txt | 773 ++++++++++++++++++
bikeshed/widlparser/test.py | 19 +-
bikeshed/widlparser/widlparser/constructs.py | 18 +-
bikeshed/widlparser/widlparser/parser.py | 8 +-
bikeshed/widlparser/widlparser/productions.py | 284 +++++--
bikeshed/widlparser/widlparser/tokenizer.py | 2 +-
tests/github/w3c/IndexedDB/index.html | 4 +-
.../w3c/csswg-drafts/cssom-1/Overview.html | 12 +-
tests/idl001.html | 14 +-
tests/idl003.html | 14 +-
11 files changed, 1048 insertions(+), 117 deletions(-)
create mode 100644 bikeshed/widlparser/CONTRIBUTING.md
create mode 100644 bikeshed/widlparser/test-expected.txt
diff --git a/bikeshed/widlparser/CONTRIBUTING.md b/bikeshed/widlparser/CONTRIBUTING.md
new file mode 100644
index 0000000000..191bf9a165
--- /dev/null
+++ b/bikeshed/widlparser/CONTRIBUTING.md
@@ -0,0 +1,17 @@
+Contributing to widlparser
+==========================
+
+All contributions are welcome!
+
+
+Testing
+-------
+
+To ensure that there are no unexpected changes, compare the output of `test.py`:
+
+ ./test.py | diff -u test-expected.txt -
+
+If all changes are expected, include them in your pull request:
+
+ ./test.py > test-expected.txt
+ git add test-expected.txt
diff --git a/bikeshed/widlparser/test-expected.txt b/bikeshed/widlparser/test-expected.txt
new file mode 100644
index 0000000000..22c3244540
--- /dev/null
+++ b/bikeshed/widlparser/test-expected.txt
@@ -0,0 +1,773 @@
+IDL >>>
+dictionary CSSFontFaceLoadEventInit : EventInit { sequence fontfaces = [ ]; };
+interface Simple{
+ serializer;
+ serializer = { foo };
+ serializer cereal(short one);
+ iterable;
+ iterable;
+ async iterable;
+ readonly maplike;
+ setlike;
+ attribute boolean required;
+ static attribute Foo foo;
+ static Foo foo();
+ Promise? theCheckIsInTheMail();
+}; // this is a comment éß
+interface Multi : One , Two , Three {
+ attribute short one;
+};
+typedef sequence? fooType;
+typedef (short or Foo) maybeFoo;
+typedef sequence<(short or Foo)> maybeFoos;
+typedef FrozenArray<(short or Foo)> frozenMaybeFoos;
+typedef record? recordFoo;
+typedef record? recordMaybeFoo;
+typedef record recordAny;
+typedef record recordBroken;
+interface foo {
+ [one] attribute Foo one;
+ [two] Foo two()bar;
+ [three] const Foo three = 3}}foo
+typedef short shorttype = error this is;
+
+ const long long one= 2 ;
+ const long hex = 0xabcdef09;
+ const long octal = 0777;
+ const double reallyHigh = Infinity;
+ const double reallyLow = -Infinity;
+ const double notANumber = NaN;
+ const double invalid = - Infinity;
+ Window implements WindowInterface ; // more comment
+
+enum foo {"one" , "two", } ;
+enum foo { "one" };
+enum bar{"one","two","three",}; // and another
+enum comments {
+"one", //comment one
+ // more comment
+"two", //comment two
+"three" , //coment three
+};
+
+ typedef short shorttype;
+typedef long longtype;
+typedef long long longtype;
+[hello, my name is inigo montøya (you ] killed my father)] typedef unsigned long long inigo;
+typedef unrestricted double dubloons;
+typedef short [ ] shortarray;
+typedef DOMString string;
+typedef DOMString[] stringarray;
+typedef foo barType;
+typedef foo [ ] [ ] barTypes;
+typedef sequence sequins;
+typedef sequence? sequinses;
+typedef object obj;
+typedef (short or [Extended] double) union;
+typedef (short or sequence < DOMString [ ] ? [ ] > ? or DOMString[]?[] or unsigned long long or unrestricted double) craziness;
+typedef (short or (long or double)) nestedUnion;
+typedef (short or (long or double) or long long) moreNested;
+typedef (short or sequence<(DOMString[]?[] or short)>? or DOMString[]?[]) sequenceUnion;
+
+[ Constructor , NamedConstructor = MyConstructor, Constructor (Foo one), NamedConstructor = MyOtherConstructor (Foo two , long long longest ) ] partial interface Foo: Bar {
+ unsigned long long method(short x, unsigned long long y, optional double inf = Infinity, sequence... fooArg) raises (hell);
+ unsigned long long method(DOMString string, optional Foo foo = {});
+ void abort();
+ void anotherMethod(short round);
+ [ha!] attribute short bar getraises (an, exception);
+ const short fortyTwo = 42;
+ attribute long async;
+ long foo(long x, long y, long async);
+ void bar(any constructor);
+ long includes();
+}
+[ NoInterfaceObject , MapClass (short, Foo )] interface LinkStyle {
+ constructor();
+ constructor(int x);
+ stringifier attribute DOMString mediaText;
+ readonly attribute [Extended] short bar ;
+ getter object (DOMString name);
+ getter setter object bob (DOMString name);
+ stringifier foo me(int x);
+ stringifier foo ();
+ stringifier;
+ stringifier attribute short string;
+ this is a syntax error, naturally
+};
+[foo] partial dictionary FooDict:BarDict {
+ [one "]" ( tricky ] test)] short bar;
+ [two] sequence<(double or [Extended] Foo)> foo = "hello";
+ required Foo baz;
+}
+
+callback callFoo = short();
+callback callFoo2 = unsigned long long(unrestricted double one, DOMString two, Fubar ... three);
+callback interface callMe {
+ inherit attribute short round setraises (for the heck of it);
+};
+callback interface mixin callMeMixin {
+ long method();
+};
+
+[Exposed=(Window, Worker)] dictionary MyDictionary {
+ any value = null;
+ any[] value = null;
+ any [] value = null;
+};
+
+[] interface Int {
+ readonly attribute long? service;
+ readonly attribute ArrayBuffer? value;
+ readonly attribute ArrayBuffer value2;
+ attribute ArrayBuffer? value3;
+};
+
+namespace Namespace1 {
+ [One] unsigned long long method([Extended] short x);
+ [Two] unsigned long long method(short x, short y);
+ readonly attribute long? value;
+ attribute long error; // error, must be readonly
+};
+partial namespace Namespace2 {
+ [One] unsigned long long method(short x);
+ [Two] unsigned long long method(short x, short y);
+};
+
+interface System {
+ object createObject(DOMString _interface);
+ sequence getObjects(DOMString interface);
+ getter DOMString (DOMString keyName);
+ DOMString? lookupPrefix(DOMString? namespace);
+};
+
+interface OptionalTest {
+ long methodWithOptionalDict(long one, (long or MyDictionary or object) optionalDict); // should error
+ long methodWithOptionalDict(long one, MyDictionary optionalDict, optional long three); // should error
+ long methodWithRequiredDict(long one, FooDict requiredDict);
+ long methodWithRequiredDict(long one, FooDict requiredDict, long three);
+};
+
+interface Interface {
+ attribute long hello;
+};
+
+interface mixin Mixin {
+ const double constantMember = 10.0;
+ readonly attribute long readOnlyAttributeMember;
+ attribute long attributeMember;
+ DOMString? operationMember(long argument);
+ stringifier;
+};
+
+Interface includes Mixin;
+
+[NoInterfaceObject] Interface includes Mixin;
+
+interface mixin MixinCanNotIncludeSpecialOperation {
+ getter long (unsigned long argument);
+};
+
+interface mixin MixinCanNotIncludeStaticMember {
+ static readonly attribute long staticReadOnlyAttributeMember;
+};
+
+interface mixin MixinCanNotIncludeIterable {
+ iterable;
+};
+
+interface mixin MixinCanNotIncludeMaplike {
+ readonly maplike;
+};
+
+interface mixin MixinCanNotIncludeSetlike {
+ readonly setlike;
+};
+
+
+<<<
+IDL SYNTAX ERROR LINE: 3 - skipped: "serializer"
+
+IDL SYNTAX ERROR LINE: 4 - skipped: "serializer = { foo }"
+
+IGNORED LEGACY IDL LINE: 16 - " , Two , Three "
+
+IDL SYNTAX ERROR LINE: 26 - skipped: "typedef record recordBroken"
+
+IDL SYNTAX ERROR LINE: 29 - expected ";" skipped: "bar"
+
+IDL SYNTAX ERROR LINE: 30 - expected ";"
+
+IDL SYNTAX ERROR LINE: 30 - expected ";"
+
+IDL SYNTAX ERROR LINE: 30 - skipped: "}"
+
+IDL SYNTAX ERROR LINE: 30 - skipped: "foo
+typedef short shorttype = error this is"
+
+IDL SYNTAX ERROR LINE: 39 - skipped: "const double invalid = - Infinity"
+
+IGNORED LEGACY IDL LINE: 42 - ","
+
+IGNORED LEGACY IDL LINE: 44 - ","
+
+IGNORED LEGACY IDL LINE: 50 - ","
+
+IGNORED LEGACY IDL LINE: 72 - "raises (hell)"
+
+IGNORED LEGACY IDL LINE: 76 - "getraises (an, exception)"
+
+IDL SYNTAX ERROR LINE: 83 - expected ";"
+
+IDL SYNTAX ERROR LINE: 94 - skipped: "this is a syntax error, naturally
+"
+
+IDL SYNTAX ERROR LINE: 102 - expected ";"
+
+IGNORED LEGACY IDL LINE: 105 - "setraises (for the heck of it)"
+
+IDL SYNTAX ERROR LINE: 128 - skipped: "attribute long error"
+
+IDL ERROR LINE: 143 - Dictionary argument "optionalDict" without required members must be marked optional
+
+IDL ERROR LINE: 144 - Dictionary argument "optionalDict" without required members must be marked optional
+
+IDL SYNTAX ERROR LINE: 163 - skipped: "[NoInterfaceObject] Interface includes Mixin"
+
+IDL SYNTAX ERROR LINE: 166 - skipped: "getter long (unsigned long argument)"
+
+IDL SYNTAX ERROR LINE: 170 - skipped: "static readonly attribute long staticReadOnlyAttributeMember"
+
+IDL SYNTAX ERROR LINE: 174 - skipped: "iterable"
+
+IDL SYNTAX ERROR LINE: 178 - skipped: "readonly maplike"
+
+IDL SYNTAX ERROR LINE: 182 - skipped: "readonly setlike"
+
+[Parser: [dictionary: [name: CSSFontFaceLoadEventInit] [inherits: EventInit][members:
+ [dict-member: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [sequence] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: u'CSSFontFaceRule']]]]]] [name: fontfaces] = [default: [Default: [ ]]]]
+]]
+[interface: [name: Simple] [members:
+ [unknown: tokens: [identifier:serializer][symbol:;]]
+ [unknown: tokens: [identifier:serializer][whitespace: ][symbol:=][whitespace: ][symbol:{][whitespace: ][identifier:foo][whitespace: ][symbol:}][symbol:;]]
+ [member: [Operation: [Type: [SingleType: [NonAnyType: u'serializer']]] [OperationRest: [name: [OperationName: u'cereal']] [argumentlist: [argument: [type: short ] [name: one]]]]]]
+ [member: [Iterable: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: u'Foo']]]]]
+ [member: [Iterable: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: u'Foo']]] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: u'Bar']]]]]
+ [member: [AsyncIterable: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: u'Foo']]] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: u'Bar']]]]]
+ [member: [Maplike: [readonly] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: u'Foo']]] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: u'Bar']]]]]
+ [member: [Setlike: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: Uint8ClampedArray]]]]]
+ [member: [attribute: [AttributeRest: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: u'boolean']]]] [name: required]]]]
+ [member: [StaticMember: [AttributeRest: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: u'Foo']]] [name: foo]]]]
+ [member: [StaticMember: [Type: [SingleType: [NonAnyType: u'Foo']]] [OperationRest: [name: [OperationName: u'foo']] [argumentlist: ]]]]
+ [member: [Operation: [Type: [SingleType: [NonAnyType: [Promise] [Type: [SingleType: [NonAnyType: u'ReallyISwear']]][null]]]] [OperationRest: [name: [OperationName: u'theCheckIsInTheMail']] [argumentlist: ]]]]
+]]
+[interface: [name: Multi] [inherits: One][members:
+ [member: [attribute: [AttributeRest: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]]] [name: one]]]]
+]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [sequence] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: u'Foo'[TypeSuffix: [array] ]]]][null]]]] [name: fooType]]
+[typedef: [TypeWithExtendedAttributes: [UnionType: [UnionMemberType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]][UnionMemberType: [NonAnyType: u'Foo']]]] [name: maybeFoo]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [sequence] [TypeWithExtendedAttributes: [UnionType: [UnionMemberType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]][UnionMemberType: [NonAnyType: u'Foo']]]]]]] [name: maybeFoos]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [sequence] [TypeWithExtendedAttributes: [UnionType: [UnionMemberType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]][UnionMemberType: [NonAnyType: u'Foo']]]]]]] [name: frozenMaybeFoos]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [record] [StringType: DOMString] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: u'Foo'[TypeSuffix: [array] ]]]][null]]]] [name: recordFoo]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [record] [StringType: DOMString] [TypeWithExtendedAttributes: [UnionType: [UnionMemberType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]][UnionMemberType: [NonAnyType: u'Foo']]]][null]]]] [name: recordMaybeFoo]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [record] [StringType: USVString] [TypeWithExtendedAttributes: [SingleType: any]]]]] [name: recordAny]]
+[unknown: tokens: [symbol:typedef][whitespace: ][symbol:record][symbol:<][symbol:any][symbol:,][whitespace: ][symbol:any][symbol:>][whitespace: ][identifier:recordBroken][symbol:;]]
+[interface: [name: foo] [members:
+ [member: [Extended Attributes: [ExtendedAttributeNoArgs: one]] [attribute: [AttributeRest: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: u'Foo']]] [name: one]]]]
+ [member: [Extended Attributes: [ExtendedAttributeNoArgs: two]] [Operation: [Type: [SingleType: [NonAnyType: u'Foo']]] [OperationRest: [name: [OperationName: u'two']] [argumentlist: ]]]]
+ [member: [Extended Attributes: [ExtendedAttributeNoArgs: three]] [const: [ConstType: u'Foo'][name: three] = [value: 3]]]
+]]
+[unknown: tokens: [symbol:}]]
+[unknown: tokens: [identifier:foo][whitespace:
+][symbol:typedef][whitespace: ][symbol:short][whitespace: ][identifier:shorttype][whitespace: ][symbol:=][whitespace: ][identifier:error][whitespace: ][identifier:this][whitespace: ][identifier:is][symbol:;]]
+[const: [ConstType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long long]]]][name: one] = [value: 2 ]]
+[const: [ConstType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]]][name: hex] = [value: 0xabcdef09]]
+[const: [ConstType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]]][name: octal] = [value: 0777]]
+[const: [ConstType: [PrimitiveType: [UnrestrictedFloatType: [FloatType: double]]]][name: reallyHigh] = [value: Infinity]]
+[const: [ConstType: [PrimitiveType: [UnrestrictedFloatType: [FloatType: double]]]][name: reallyLow] = [value: -Infinity]]
+[const: [ConstType: [PrimitiveType: [UnrestrictedFloatType: [FloatType: double]]]][name: notANumber] = [value: NaN]]
+[unknown: tokens: [symbol:const][whitespace: ][symbol:double][whitespace: ][identifier:invalid][whitespace: ][symbol:=][whitespace: ][symbol:-][whitespace: ][symbol:Infinity][symbol:;]]
+[implements: [name: Window] [implements: WindowInterface]]
+[enum: [name: foo] [values: [EnumValueList: [EnumValue: "one"][EnumValue: "two"]]]]
+[enum: [name: foo] [values: [EnumValueList: [EnumValue: "one"]]]]
+[enum: [name: bar] [values: [EnumValueList: [EnumValue: "one"][EnumValue: "two"][EnumValue: "three"]]]]
+[enum: [name: comments] [values: [EnumValueList: [EnumValue: "one"][EnumValue: "two"][EnumValue: "three"]]]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]]] [name: shorttype]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]]]]] [name: longtype]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long long]]]]]] [name: longtype]]
+[typedef: [Extended Attributes: [ExtendedAttributeNoArgs: hello] [ExtendedAttribute: [identifier:my][whitespace: ][identifier:name][whitespace: ][identifier:is][whitespace: ][identifier:inigo][whitespace: ][identifier:mont][other:?][identifier:ya][whitespace: ][symbol:(][identifier:you][whitespace: ][symbol:]][whitespace: ][identifier:killed][whitespace: ][identifier:my][whitespace: ][identifier:father][symbol:)]]] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [unsigned][IntegerType: long long]]]]]] [name: inigo]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnrestrictedFloatType: [unrestricted][FloatType: double]]]]]] [name: dubloons]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]][TypeSuffix: [array] ]]]] [name: shortarray]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: DOMString]]] [name: string]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: DOMString[TypeSuffix: [array] ]]]] [name: stringarray]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: u'foo']]] [name: barType]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: u'foo'[TypeSuffix: [array] [TypeSuffix: [array] ]]]]] [name: barTypes]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [sequence] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: DOMString[TypeSuffix: [array] ]]]]]]] [name: sequins]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [sequence] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: DOMString[TypeSuffix: [array] ]]]][null]]]] [name: sequinses]]
+[typedef: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: object]]] [name: obj]]
+[typedef: [TypeWithExtendedAttributes: [UnionType: [UnionMemberType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]][UnionMemberType: [NonAnyType: [PrimitiveType: [UnrestrictedFloatType: [FloatType: double]]]]]]] [name: union]]
+[typedef: [TypeWithExtendedAttributes: [UnionType: [UnionMemberType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]][UnionMemberType: [NonAnyType: [sequence] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: DOMString[TypeSuffix: [array] [TypeSuffix: [null] [TypeSuffixStartingWithArray: ]]]]]][null]]][UnionMemberType: [NonAnyType: DOMString[TypeSuffix: [array] [TypeSuffix: [null] [TypeSuffixStartingWithArray: ]]]]][UnionMemberType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [unsigned][IntegerType: long long]]]]][UnionMemberType: [NonAnyType: [PrimitiveType: [UnrestrictedFloatType: [unrestricted][FloatType: double]]]]]]] [name: craziness]]
+[typedef: [TypeWithExtendedAttributes: [UnionType: [UnionMemberType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]][UnionMemberType: [UnionType: [UnionMemberType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]]]][UnionMemberType: [NonAnyType: [PrimitiveType: [UnrestrictedFloatType: [FloatType: double]]]]]]]]] [name: nestedUnion]]
+[typedef: [TypeWithExtendedAttributes: [UnionType: [UnionMemberType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]][UnionMemberType: [UnionType: [UnionMemberType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]]]][UnionMemberType: [NonAnyType: [PrimitiveType: [UnrestrictedFloatType: [FloatType: double]]]]]]][UnionMemberType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long long]]]]]]] [name: moreNested]]
+[typedef: [TypeWithExtendedAttributes: [UnionType: [UnionMemberType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]][UnionMemberType: [NonAnyType: [sequence] [TypeWithExtendedAttributes: [UnionType: [UnionMemberType: [NonAnyType: DOMString[TypeSuffix: [array] [TypeSuffix: [null] [TypeSuffixStartingWithArray: ]]]]][UnionMemberType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]]]][null]]][UnionMemberType: [NonAnyType: DOMString[TypeSuffix: [array] [TypeSuffix: [null] [TypeSuffixStartingWithArray: ]]]]]]] [name: sequenceUnion]]
+[interface: [Extended Attributes: [ExtendedAttributeNoArgs: Constructor] [ExtendedAttributeIdent: NamedConstructor [value: MyConstructor]] [ExtendedAttributeArgList: Constructor [arguments: [argument: [type: Foo ] [name: one]]]] [ExtendedAttributeNamedArgList: NamedConstructor [value: MyOtherConstructor] [arguments: [argument: [type: Foo ] [name: two]] [argument: [type: long long ] [name: longest]]]]] [partial] [name: Foo] [inherits: Bar][members:
+ [ExtendedAttributeNoArgs: Constructor]
+ [ExtendedAttributeIdent: NamedConstructor [value: MyConstructor]]
+ [ExtendedAttributeArgList: Constructor [arguments: [argument: [type: Foo ] [name: one]]]]
+ [ExtendedAttributeNamedArgList: NamedConstructor [value: MyOtherConstructor] [arguments: [argument: [type: Foo ] [name: two]] [argument: [type: long long ] [name: longest]]]]
+ [member: [Operation: [Type: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [unsigned][IntegerType: long long]]]]]] [OperationRest: [name: [OperationName: u'method']] [argumentlist: [argument: [type: short ] [name: x]] [argument: [type: unsigned long long ] [name: y]] [argument: [optional] [type: double ] [name: inf] [default: [Default: [ConstValue: [FloatLiteral: Infinity]]]]] [argument: [type: sequence][...] [name: fooArg]]]]]]
+ [member: [Operation: [Type: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [unsigned][IntegerType: long long]]]]]] [OperationRest: [name: [OperationName: u'method']] [argumentlist: [argument: [type: DOMString ] [name: string]] [argument: [optional] [type: Foo ] [name: foo] [default: [Default: {}]]]]]]]
+ [member: [Operation: void [OperationRest: [name: [OperationName: u'abort']] [argumentlist: ]]]]
+ [member: [Operation: void [OperationRest: [name: [OperationName: u'anotherMethod']] [argumentlist: [argument: [type: short ] [name: round]]]]]]
+ [member: [Extended Attributes: [ExtendedAttribute: [identifier:ha][other:!]]] [attribute: [AttributeRest: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]]] [name: bar]]]]
+ [member: [const: [ConstType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]][name: fortyTwo] = [value: 42]]]
+ [member: [attribute: [AttributeRest: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]]]]] [name: async]]]]
+ [member: [Operation: [Type: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]]]]] [OperationRest: [name: [OperationName: u'foo']] [argumentlist: [argument: [type: long ] [name: x]] [argument: [type: long ] [name: y]] [argument: [type: long ] [name: async]]]]]]
+ [member: [Operation: void [OperationRest: [name: [OperationName: u'bar']] [argumentlist: [argument: [type: any ] [name: constructor]]]]]]
+ [member: [Operation: [Type: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]]]]] [OperationRest: [name: [OperationName: u'includes']] [argumentlist: ]]]]
+]]
+[interface: [Extended Attributes: [ExtendedAttributeNoArgs: NoInterfaceObject] [ExtendedAttributeTypePair: MapClass [Type: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]]] [Type: [SingleType: [NonAnyType: u'Foo']]]]] [name: LinkStyle] [members:
+ [member: [Constructor: [argumentlist: ]]]
+ [member: [Constructor: [argumentlist: [argument: [type: int ] [name: x]]]]]
+ [member: [Stringifier: [AttributeRest: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: DOMString]]] [name: mediaText]]]]
+ [member: [attribute: [AttributeRest: [readonly] [TypeWithExtendedAttributes: [Extended Attributes: [ExtendedAttributeNoArgs: Extended]] [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]]] [name: bar]]]]
+ [member: [SpecialOperation: [getter] [Type: [SingleType: [NonAnyType: object]]] [OperationRest: [argumentlist: [argument: [type: DOMString ] [name: name]]]]]]
+ [member: [SpecialOperation: [getter] [setter] [Type: [SingleType: [NonAnyType: object]]] [OperationRest: [name: [OperationName: u'bob']] [argumentlist: [argument: [type: DOMString ] [name: name]]]]]]
+ [member: [Stringifier: [Type: [SingleType: [NonAnyType: u'foo']]] [OperationRest: [name: [OperationName: u'me']] [argumentlist: [argument: [type: int ] [name: x]]]]]]
+ [member: [Stringifier: [Type: [SingleType: [NonAnyType: u'foo']]] [OperationRest: [argumentlist: ]]]]
+ [member: [Stringifier: ]]
+ [member: [Stringifier: [AttributeRest: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]]] [name: string]]]]
+ [unknown: tokens: [identifier:this][whitespace: ][identifier:is][whitespace: ][identifier:a][whitespace: ][identifier:syntax][whitespace: ][identifier:error][symbol:,][whitespace: ][identifier:naturally][whitespace:
+]]
+]]
+[dictionary: [Extended Attributes: [ExtendedAttributeNoArgs: foo]] [partial] [name: FooDict] [inherits: BarDict][members:
+ [dict-member: [Extended Attributes: [ExtendedAttribute: [identifier:one][whitespace: ][string:"]"][whitespace: ][symbol:(][whitespace: ][identifier:tricky][whitespace: ][symbol:]][whitespace: ][identifier:test][symbol:)]]] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]]] [name: bar]]
+ [dict-member: [Extended Attributes: [ExtendedAttributeNoArgs: two]] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [sequence] [TypeWithExtendedAttributes: [UnionType: [UnionMemberType: [NonAnyType: [PrimitiveType: [UnrestrictedFloatType: [FloatType: double]]]]][UnionMemberType: [NonAnyType: u'Foo']]]]]]] [name: foo] = [default: [Default: u'"hello"']]]
+ [dict-member: [required] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: u'Foo']]] [name: baz]]
+]]
+[callback: [name: callFoo] [returnType: short] [argumentlist: ]]
+[callback: [name: callFoo2] [returnType: unsigned long long] [argumentlist: [argument: [type: unrestricted double ] [name: one]] [argument: [type: DOMString ] [name: two]] [argument: [type: Fubar ][...] [name: three]]]]
+[callback: [interface: [name: callMe] [members:
+ [member: [attribute: [inherit] [AttributeRest: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: short]]]]]] [name: round]]]]
+]]]
+[callback: [interface: [mixin] [name: callMeMixin] [members:
+ [member: [Operation: [Type: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]]]]] [OperationRest: [name: [OperationName: u'method']] [argumentlist: ]]]]
+]]]
+[dictionary: [Extended Attributes: [ExtendedAttributeIdentList: Exposed [value: Window] Worker]] [name: MyDictionary] [members:
+ [dict-member: [TypeWithExtendedAttributes: [SingleType: any]] [name: value] = [default: [Default: [ConstValue: u'null']]]]
+ [dict-member: [TypeWithExtendedAttributes: [SingleType: any[TypeSuffixStartingWithArray: ]]] [name: value] = [default: [Default: [ConstValue: u'null']]]]
+ [dict-member: [TypeWithExtendedAttributes: [SingleType: any[TypeSuffixStartingWithArray: ]]] [name: value] = [default: [Default: [ConstValue: u'null']]]]
+]]
+[interface: [Extended Attributes: [ExtendedAttribute: ]] [name: Int] [members:
+ [member: [attribute: [AttributeRest: [readonly] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]][TypeSuffix: [null] ]]]] [name: service]]]]
+ [member: [attribute: [AttributeRest: [readonly] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: ArrayBuffer[null]]]] [name: value]]]]
+ [member: [attribute: [AttributeRest: [readonly] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: ArrayBuffer]]] [name: value2]]]]
+ [member: [attribute: [AttributeRest: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: ArrayBuffer[null]]]] [name: value3]]]]
+]]
+[namespace: [name: Namespace1] [members:
+ [member: [Extended Attributes: [ExtendedAttributeNoArgs: One]] [Operation: [Type: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [unsigned][IntegerType: long long]]]]]] [OperationRest: [name: [OperationName: u'method']] [argumentlist: [argument: [Extended Attributes: [ExtendedAttributeNoArgs: Extended]] [type: short ] [name: x]]]]]]
+ [member: [Extended Attributes: [ExtendedAttributeNoArgs: Two]] [Operation: [Type: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [unsigned][IntegerType: long long]]]]]] [OperationRest: [name: [OperationName: u'method']] [argumentlist: [argument: [type: short ] [name: x]] [argument: [type: short ] [name: y]]]]]]
+ [member: [attribute: [AttributeRest: [readonly] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]][TypeSuffix: [null] ]]]] [name: value]]]]
+ [unknown: tokens: [symbol:attribute][whitespace: ][symbol:long][whitespace: ][identifier:error][symbol:;]]
+]]
+[namespace: [partial] [name: Namespace2] [members:
+ [member: [Extended Attributes: [ExtendedAttributeNoArgs: One]] [Operation: [Type: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [unsigned][IntegerType: long long]]]]]] [OperationRest: [name: [OperationName: u'method']] [argumentlist: [argument: [type: short ] [name: x]]]]]]
+ [member: [Extended Attributes: [ExtendedAttributeNoArgs: Two]] [Operation: [Type: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [unsigned][IntegerType: long long]]]]]] [OperationRest: [name: [OperationName: u'method']] [argumentlist: [argument: [type: short ] [name: x]] [argument: [type: short ] [name: y]]]]]]
+]]
+[interface: [name: System] [members:
+ [member: [Operation: [Type: [SingleType: [NonAnyType: object]]] [OperationRest: [name: [OperationName: u'createObject']] [argumentlist: [argument: [type: DOMString ] [name: interface]]]]]]
+ [member: [Operation: [Type: [SingleType: [NonAnyType: [sequence] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: object]]]]]] [OperationRest: [name: [OperationName: u'getObjects']] [argumentlist: [argument: [type: DOMString ] [name: interface]]]]]]
+ [member: [SpecialOperation: [getter] [Type: [SingleType: [NonAnyType: DOMString]]] [OperationRest: [argumentlist: [argument: [type: DOMString ] [name: keyName]]]]]]
+ [member: [Operation: [Type: [SingleType: [NonAnyType: DOMString[TypeSuffix: [null] ]]]] [OperationRest: [name: [OperationName: u'lookupPrefix']] [argumentlist: [argument: [type: DOMString? ] [name: namespace]]]]]]
+]]
+[interface: [name: OptionalTest] [members:
+ [member: [Operation: [Type: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]]]]] [OperationRest: [name: [OperationName: u'methodWithOptionalDict']] [argumentlist: [argument: [type: long ] [name: one]] [argument: [type: (long or MyDictionary or object) ] [name: optionalDict]]]]]]
+ [member: [Operation: [Type: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]]]]] [OperationRest: [name: [OperationName: u'methodWithOptionalDict']] [argumentlist: [argument: [type: long ] [name: one]] [argument: [type: MyDictionary ] [name: optionalDict]] [argument: [optional] [type: long ] [name: three]]]]]]
+ [member: [Operation: [Type: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]]]]] [OperationRest: [name: [OperationName: u'methodWithRequiredDict']] [argumentlist: [argument: [type: long ] [name: one]] [argument: [type: FooDict ] [name: requiredDict]]]]]]
+ [member: [Operation: [Type: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]]]]] [OperationRest: [name: [OperationName: u'methodWithRequiredDict']] [argumentlist: [argument: [type: long ] [name: one]] [argument: [type: FooDict ] [name: requiredDict]] [argument: [type: long ] [name: three]]]]]]
+]]
+[interface: [name: Interface] [members:
+ [member: [attribute: [AttributeRest: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]]]]] [name: hello]]]]
+]]
+[interface: [mixin] [name: Mixin] [members:
+ [member: [const: [ConstType: [PrimitiveType: [UnrestrictedFloatType: [FloatType: double]]]][name: constantMember] = [value: 10.0]]]
+ [member: [attribute: [AttributeRest: [readonly] [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]]]]] [name: readOnlyAttributeMember]]]]
+ [member: [attribute: [AttributeRest: [TypeWithExtendedAttributes: [SingleType: [NonAnyType: [PrimitiveType: [UnsignedIntegerType: [IntegerType: long]]]]]] [name: attributeMember]]]]
+ [member: [Operation: [Type: [SingleType: [NonAnyType: DOMString[TypeSuffix: [null] ]]]] [OperationRest: [name: [OperationName: u'operationMember']] [argumentlist: [argument: [type: long ] [name: argument]]]]]]
+ [member: [Stringifier: ]]
+]]
+[includes: [name: Interface] [includes: Mixin]]
+[unknown: tokens: [symbol:[][identifier:NoInterfaceObject][symbol:]][whitespace: ][identifier:Interface][whitespace: ][symbol:includes][whitespace: ][identifier:Mixin][symbol:;]]
+[interface: [mixin] [name: MixinCanNotIncludeSpecialOperation] [members:
+ [unknown: tokens: [symbol:getter][whitespace: ][symbol:long][whitespace: ][symbol:(][symbol:unsigned][whitespace: ][symbol:long][whitespace: ][identifier:argument][symbol:)][symbol:;]]
+]]
+[interface: [mixin] [name: MixinCanNotIncludeStaticMember] [members:
+ [unknown: tokens: [symbol:static][whitespace: ][symbol:readonly][whitespace: ][symbol:attribute][whitespace: ][symbol:long][whitespace: ][identifier:staticReadOnlyAttributeMember][symbol:;]]
+]]
+[interface: [mixin] [name: MixinCanNotIncludeIterable] [members:
+ [unknown: tokens: [symbol:iterable][symbol:<][symbol:long][symbol:>][symbol:;]]
+]]
+[interface: [mixin] [name: MixinCanNotIncludeMaplike] [members:
+ [unknown: tokens: [symbol:readonly][whitespace: ][symbol:maplike][symbol:<][symbol:DOMString][symbol:,][whitespace: ][symbol:DOMString][symbol:>][symbol:;]]
+]]
+[interface: [mixin] [name: MixinCanNotIncludeSetlike] [members:
+ [unknown: tokens: [symbol:readonly][whitespace: ][symbol:setlike][symbol:<][symbol:DOMString][symbol:>][symbol:;]]
+]]
+]
+MARKED UP:
+dictionary CSSFontFaceLoadEventInit : EventInit { sequence <CSSFontFaceRule > fontfaces = [ ]; };
+interface Simple {
+ serializer;
+ serializer = { foo };
+ serializer cereal (short
one );
+ iterable <Foo >;
+ iterable <Foo , Bar >;
+ async iterable <Foo , Bar >;
+ readonly maplike <Foo , Bar >;
+ setlike <Uint8ClampedArray >;
+ attribute boolean
required ;
+ static attribute Foo foo ;
+ static Foo foo ();
+ Promise <ReallyISwear >? theCheckIsInTheMail ();
+}; // this is a comment éß
+interface Multi : One , Two , Three {
+ attribute short
one ;
+};
+typedef sequence <Foo [] >? fooType ;
+typedef (short
or Foo ) maybeFoo ;
+typedef sequence <(short
or Foo ) > maybeFoos ;
+typedef FrozenArray <(short
or Foo ) > frozenMaybeFoos ;
+typedef record <DOMString , Foo []>? recordFoo ;
+typedef record <DOMString , (short
or Foo )>? recordMaybeFoo ;
+typedef record <USVString , any > recordAny ;
+typedef record<any, any> recordBroken;
+interface foo {
+ [one ] attribute Foo one ;
+ [two ] Foo two ()bar;
+ [three ] const Foo three = 3 }} foo
+typedef short shorttype = error this is;
+
+ const long long
one = 2 ;
+ const long
hex = 0xabcdef09;
+ const long
octal = 0777;
+ const double
reallyHigh = Infinity ;
+ const double
reallyLow = -Infinity ;
+ const double
notANumber = NaN ;
+ const double invalid = - Infinity;
+ Window implements WindowInterface ; // more comment
+
+enum foo {"one" , "two" , } ;
+enum foo { "one" };
+enum bar {"one" ,"two" ,"three" ,}; // and another
+enum comments {
+"one" , //comment one
+ // more comment
+"two" , //comment two
+"three" , //coment three
+};
+
+ typedef short
shorttype ;
+typedef long
longtype ;
+typedef long long
longtype ;
+[hello , my name is inigo montøya (you ] killed my father) ] typedef unsigned long long
inigo ;
+typedef unrestricted double
dubloons ;
+typedef short
[ ] shortarray ;
+typedef DOMString string ;
+typedef DOMString [] stringarray ;
+typedef foo barType ;
+typedef foo [ ] [ ] barTypes ;
+typedef sequence <DOMString [] > sequins ;
+typedef sequence <DOMString [] >? sequinses ;
+typedef object obj ;
+typedef (short
or [Extended ] double
) union ;
+typedef (short
or sequence < DOMString [ ] ? [ ] > ? or DOMString []?[] or unsigned long long
or unrestricted double
) craziness ;
+typedef (short
or (long
or double
) ) nestedUnion ;
+typedef (short
or (long
or double
) or long long
) moreNested ;
+typedef (short
or sequence <(DOMString []?[] or short
) >? or DOMString []?[] ) sequenceUnion ;
+
+[ Constructor , NamedConstructor = MyConstructor , Constructor (Foo one ) , NamedConstructor = MyOtherConstructor (Foo two , long long
longest ) ] partial interface Foo : Bar {
+ unsigned long long
method (short
x , unsigned long long
y , optional double
inf = Infinity , sequence <Foo > ... fooArg ) raises (hell);
+ unsigned long long
method (DOMString string , optional Foo foo = {} );
+ void abort ();
+ void anotherMethod (short
round );
+ [ha! ] attribute short
bar getraises (an, exception);
+ const short
fortyTwo = 42;
+ attribute long
async ;
+ long
foo (long
x , long
y , long
async );
+ void bar (any constructor );
+ long
includes ();
+}
+ [ NoInterfaceObject , MapClass (short
, Foo ) ] interface LinkStyle {
+ constructor ();
+ constructor (int x );
+ stringifier attribute DOMString mediaText ;
+ readonly attribute [Extended ] short
bar ;
+ getter object (DOMString name );
+ getter setter object bob (DOMString name );
+ stringifier foo me (int x );
+ stringifier foo ();
+ stringifier ;
+ stringifier attribute short
string ;
+ this is a syntax error, naturally
+ };
+[foo ] partial dictionary FooDict :BarDict {
+ [one "]" ( tricky ] test) ] short
bar ;
+ [two ] sequence <(double
or [Extended ] Foo ) > foo = "hello";
+ required Foo baz ;
+}
+
+ callback callFoo = short
();
+callback callFoo2 = unsigned long long
(unrestricted double
one , DOMString two , Fubar ... three );
+callback interface callMe {
+ inherit attribute short
round setraises (for the heck of it);
+};
+callback interface mixin callMeMixin {
+ long
method ();
+};
+
+[Exposed =(Window , Worker ) ] dictionary MyDictionary {
+ any value = null ;
+ any [] value = null ;
+ any [] value = null ;
+};
+
+[ ] interface Int {
+ readonly attribute long
? service ;
+ readonly attribute ArrayBuffer ? value ;
+ readonly attribute ArrayBuffer value2 ;
+ attribute ArrayBuffer ? value3 ;
+};
+
+namespace Namespace1 {
+ [One ] unsigned long long
method ([Extended ] short
x );
+ [Two ] unsigned long long
method (short
x , short
y );
+ readonly attribute long
? value ;
+ attribute long error; // error, must be readonly
+};
+partial namespace Namespace2 {
+ [One ] unsigned long long
method (short
x );
+ [Two ] unsigned long long
method (short
x , short
y );
+};
+
+interface System {
+ object createObject (DOMString _interface );
+ sequence <object > getObjects (DOMString interface );
+ getter DOMString (DOMString keyName );
+ DOMString ? lookupPrefix (DOMString ? namespace );
+};
+
+interface OptionalTest {
+ long
methodWithOptionalDict (long
one , (long
or MyDictionary or object ) optionalDict ); // should error
+ long
methodWithOptionalDict (long
one , MyDictionary optionalDict , optional long
three ); // should error
+ long
methodWithRequiredDict (long
one , FooDict requiredDict );
+ long
methodWithRequiredDict (long
one , FooDict requiredDict , long
three );
+};
+
+interface Interface {
+ attribute long
hello ;
+};
+
+interface mixin Mixin {
+ const double
constantMember = 10.0;
+ readonly attribute long
readOnlyAttributeMember ;
+ attribute long
attributeMember ;
+ DOMString ? operationMember (long
argument );
+ stringifier ;
+};
+
+Interface includes Mixin ;
+
+[NoInterfaceObject] Interface includes Mixin;
+
+interface mixin MixinCanNotIncludeSpecialOperation {
+ getter long (unsigned long argument);
+};
+
+interface mixin MixinCanNotIncludeStaticMember {
+ static readonly attribute long staticReadOnlyAttributeMember;
+};
+
+interface mixin MixinCanNotIncludeIterable {
+ iterable<long>;
+};
+
+interface mixin MixinCanNotIncludeMaplike {
+ readonly maplike<DOMString, DOMString>;
+};
+
+interface mixin MixinCanNotIncludeSetlike {
+ readonly setlike<DOMString>;
+};
+
+
+Complexity: 139
+dictionary: CSSFontFaceLoadEventInit
+ dict-member: fontfaces (fontfaces)
+interface: Simple
+ unknown: None (None)
+ unknown: None (None)
+ method: cereal(one) (cereal)
+ iterable: __iterable__ (__iterable__)
+ iterable: __iterable__ (__iterable__)
+ async-iterable: __async_iterable__ (__async_iterable__)
+ maplike: __maplike__ (__maplike__)
+ setlike: __setlike__ (__setlike__)
+ attribute: required (required)
+ attribute: foo (foo)
+ method: foo() (foo)
+ method: theCheckIsInTheMail() (theCheckIsInTheMail)
+interface: Multi
+ attribute: one (one)
+typedef: fooType
+typedef: maybeFoo
+typedef: maybeFoos
+typedef: frozenMaybeFoos
+typedef: recordFoo
+typedef: recordMaybeFoo
+typedef: recordAny
+unknown: None
+interface: foo
+ attribute: one (one)
+ method: two() (two)
+ const: three (three)
+unknown: None
+unknown: None
+const: one
+const: hex
+const: octal
+const: reallyHigh
+const: reallyLow
+const: notANumber
+unknown: None
+implements: Window
+enum: foo
+enum: foo
+enum: bar
+enum: comments
+typedef: shorttype
+typedef: longtype
+typedef: longtype
+typedef: inigo
+typedef: dubloons
+typedef: shortarray
+typedef: string
+typedef: stringarray
+typedef: barType
+typedef: barTypes
+typedef: sequins
+typedef: sequinses
+typedef: obj
+typedef: union
+typedef: craziness
+typedef: nestedUnion
+typedef: moreNested
+typedef: sequenceUnion
+interface: Foo
+ constructor: Foo() (Foo)
+ constructor: MyConstructor() (MyConstructor)
+ constructor: Foo(one) (Foo)
+ constructor: MyOtherConstructor(two, longest) (MyOtherConstructor)
+ method: method(x, y, inf, ...fooArg) (method)
+ method: method(string, foo) (method)
+ method: abort() (abort)
+ method: anotherMethod(round) (anotherMethod)
+ attribute: bar (bar)
+ const: fortyTwo (fortyTwo)
+ attribute: async (async)
+ method: foo(x, y, async) (foo)
+ method: bar(constructor) (bar)
+ method: includes() (includes)
+interface: LinkStyle
+ method: constructor() (constructor)
+ method: constructor(x) (constructor)
+ attribute: mediaText (mediaText)
+ attribute: bar (bar)
+ method: __getter__(name) (__getter__)
+ method: bob(name) (bob)
+ stringifier: me(x) (me)
+ stringifier: __stringifier__() (__stringifier__)
+ stringifier: __stringifier__ (__stringifier__)
+ attribute: string (string)
+ unknown: None (None)
+dictionary: FooDict
+ dict-member: bar (bar)
+ dict-member: foo (foo)
+ dict-member: baz (baz)
+callback: callFoo
+callback: callFoo2
+callback: callMe
+ attribute: round (round)
+callback: callMeMixin
+ method: method() (method)
+dictionary: MyDictionary
+ dict-member: value (value)
+ dict-member: value (value)
+ dict-member: value (value)
+interface: Int
+ attribute: service (service)
+ attribute: value (value)
+ attribute: value2 (value2)
+ attribute: value3 (value3)
+namespace: Namespace1
+ method: method(x) (method)
+ method: method(x, y) (method)
+ attribute: value (value)
+ unknown: None (None)
+namespace: Namespace2
+ method: method(x) (method)
+ method: method(x, y) (method)
+interface: System
+ method: createObject(interface) (createObject)
+ method: getObjects(interface) (getObjects)
+ method: __getter__(keyName) (__getter__)
+ method: lookupPrefix(namespace) (lookupPrefix)
+interface: OptionalTest
+ method: methodWithOptionalDict(one, optionalDict) (methodWithOptionalDict)
+ method: methodWithOptionalDict(one, optionalDict, three) (methodWithOptionalDict)
+ method: methodWithRequiredDict(one, requiredDict) (methodWithRequiredDict)
+ method: methodWithRequiredDict(one, requiredDict, three) (methodWithRequiredDict)
+interface: Interface
+ attribute: hello (hello)
+interface: Mixin
+ const: constantMember (constantMember)
+ attribute: readOnlyAttributeMember (readOnlyAttributeMember)
+ attribute: attributeMember (attributeMember)
+ method: operationMember(argument) (operationMember)
+ stringifier: __stringifier__ (__stringifier__)
+includes: Interface
+unknown: None
+interface: MixinCanNotIncludeSpecialOperation
+ unknown: None (None)
+interface: MixinCanNotIncludeStaticMember
+ unknown: None (None)
+interface: MixinCanNotIncludeIterable
+ unknown: None (None)
+interface: MixinCanNotIncludeMaplike
+ unknown: None (None)
+interface: MixinCanNotIncludeSetlike
+ unknown: None (None)
+FIND:
+callMe/round
+Foo/method(x, y, inf, ...fooArg)/y
+Foo/method(string, foo)
+Foo
+Foo/MyOtherConstructor(two, longest)/longest
+Foo/method(x, y, inf, ...fooArg)/fooArg
+Window
+LinkStyle/mediaText
+unsigned long long
method (DOMString string , optional Foo foo = {} );
+Foo/method(x, y, inf, ...fooArg)
+Foo/method(string, foo)
+NORMALIZE:
+foo()
+unknown()
+testMethod(one, two)
+testMethod2(one, two, and a half)
+bob(xxx)
+bob(name)
+bob(name)
+method(x, y, inf, ...fooArg), method(string, foo), method(string)
+method()
+method(x)
+method(x, y, inf, ...fooArg)
+method(x, y, bar)
+abort()
diff --git a/bikeshed/widlparser/test.py b/bikeshed/widlparser/test.py
index 2f4f252c92..f46d8a98c3 100755
--- a/bikeshed/widlparser/test.py
+++ b/bikeshed/widlparser/test.py
@@ -11,9 +11,10 @@
# [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
#
-import sys
-import itertools
import cgi
+import codecs
+import itertools
+import sys
from widlparser import parser
@@ -131,6 +132,7 @@ def test_difference(input, output):
if __name__ == "__main__": # called from the command line
sys.excepthook = debugHook
+ sys.stdout = codecs.getwriter('utf8')(sys.stdout)
parser = parser.Parser(ui=ui())
if (1 < len(sys.argv)):
@@ -222,13 +224,18 @@ def test_difference(input, output):
void anotherMethod(short round);
[ha!] attribute short bar getraises (an, exception);
const short fortyTwo = 42;
- long foo(long x, long y);
+ attribute long async;
+ long foo(long x, long y, long async);
+ void bar(any constructor);
+ long includes();
}
[ NoInterfaceObject , MapClass (short, Foo )] interface LinkStyle {
+ constructor();
+ constructor(int x);
stringifier attribute DOMString mediaText;
- readonly attribute [Extended] short bar;
+ readonly attribute [Extended] short bar ;
getter object (DOMString name);
- getter setter object bob(DOMString name);
+ getter setter object bob (DOMString name);
stringifier foo me(int x);
stringifier foo ();
stringifier;
@@ -372,5 +379,5 @@ def test_difference(input, output):
print(', '.join(parser.normalizedMethodNames('method()', 'Foo')))
print(', '.join(parser.normalizedMethodNames('method(x)', 'Foo')))
print(', '.join(parser.normalizedMethodNames('method(x, y)', 'Foo')))
- print(', '.join(parser.normalizedMethodNames('method(x, y, bar)', 'Foo')))
+ print(', '.join(parser.normalizedMethodNames('method (x, y, bar)', 'Foo')))
print(', '.join(parser.normalizedMethodNames('abort()', 'Foo')))
diff --git a/bikeshed/widlparser/widlparser/constructs.py b/bikeshed/widlparser/widlparser/constructs.py
index cd04f1f37b..9c7e792251 100644
--- a/bikeshed/widlparser/widlparser/constructs.py
+++ b/bikeshed/widlparser/widlparser/constructs.py
@@ -336,28 +336,30 @@ def __repr__(self):
return output + ((' [default: ' + repr(self.default) + ']]') if (self.default) else ']')
-class InterfaceMember(Construct): # [ExtendedAttributes] Const | Operation | SpecialOperation | Stringifier | StaticMember | AsyncIterable | Iterable | Attribute | Maplike | Setlike
+class InterfaceMember(Construct): # [ExtendedAttributes] Constructor | Const | Operation | SpecialOperation | Stringifier | StaticMember | AsyncIterable | Iterable | Attribute | Maplike | Setlike
@classmethod
def peek(cls, tokens):
tokens.pushPosition(False)
Construct.peek(tokens)
- return tokens.popPosition(Const.peek(tokens) or
+ return tokens.popPosition(Constructor.peek(tokens) or Const.peek(tokens) or
Stringifier.peek(tokens) or StaticMember.peek(tokens) or
- AsyncIterable.peek(tokens) or Iterable.peek(tokens) or
- Maplike.peek(tokens) or Setlike.peek(tokens) or
- Attribute.peek(tokens) or
+ AsyncIterable.peek(tokens) or Iterable.peek(tokens) or
+ Maplike.peek(tokens) or Setlike.peek(tokens) or
+ Attribute.peek(tokens) or
SpecialOperation.peek(tokens) or Operation.peek(tokens))
def __init__(self, tokens, parent):
Construct.__init__(self, tokens, parent)
- if (Const.peek(tokens)):
+ if (Constructor.peek(tokens)):
+ self.member = Constructor(tokens, parent)
+ elif (Const.peek(tokens)):
self.member = Const(tokens, parent)
elif (Stringifier.peek(tokens)):
self.member = Stringifier(tokens, parent)
elif (StaticMember.peek(tokens)):
self.member = StaticMember(tokens, parent)
- elif (AsyncIterable.peek(tokens)):
- self.member = AsyncIterable(tokens, parent)
+ elif (AsyncIterable.peek(tokens)):
+ self.member = AsyncIterable(tokens, parent)
elif (Iterable.peek(tokens)):
self.member = Iterable(tokens, parent)
elif (Maplike.peek(tokens)):
diff --git a/bikeshed/widlparser/widlparser/parser.py b/bikeshed/widlparser/widlparser/parser.py
index e02b5c7889..0c71cdabc5 100644
--- a/bikeshed/widlparser/widlparser/parser.py
+++ b/bikeshed/widlparser/widlparser/parser.py
@@ -216,8 +216,8 @@ def normalizedMethodName(self, methodText, interfaceName = None):
tokens = tokenizer.Tokenizer(match.group(2))
if (ArgumentList.peek(tokens)):
arguments = ArgumentList(tokens, None)
- return match.group(1) + '(' + arguments.argumentNames[0] + ')'
- name = match.group(1) + match.group(3)
+ return match.group(1).strip() + '(' + arguments.argumentNames[0] + ')'
+ name = match.group(1).strip() + match.group(3)
argumentNames = [argument.strip() for argument in match.group(2).split(',')]
else:
name = methodText
@@ -247,8 +247,8 @@ def normalizedMethodNames(self, methodText, interfaceName = None):
tokens = tokenizer.Tokenizer(match.group(2))
if (ArgumentList.peek(tokens)):
arguments = ArgumentList(tokens, None)
- return [match.group(1) + '(' + argumentName + ')' for argumentName in arguments.argumentNames]
- name = match.group(1) + match.group(3)
+ return [match.group(1).strip() + '(' + argumentName + ')' for argumentName in arguments.argumentNames]
+ name = match.group(1).strip() + match.group(3)
argumentNames = [argument.strip() for argument in match.group(2).split(',')]
else:
name = methodText
diff --git a/bikeshed/widlparser/widlparser/productions.py b/bikeshed/widlparser/widlparser/productions.py
index d694f5e4c9..91a226e768 100644
--- a/bikeshed/widlparser/widlparser/productions.py
+++ b/bikeshed/widlparser/widlparser/productions.py
@@ -1059,10 +1059,11 @@ def __repr__(self):
class ArgumentName(Production): # identifier | ArgumentNameKeyword
- ArgumentNameKeywords = frozenset(['attribute', 'callback', 'const', 'creator', 'deleter', 'dictionary', 'enum',
- 'getter', 'implements', 'inherit', 'interface', 'iterable', 'legacycaller',
- 'legacyiterable', 'maplike', 'namespace', 'partial', 'required', 'setlike',
- 'setter', 'static', 'stringifier', 'typedef', 'unrestricted'])
+ ArgumentNameKeywords = frozenset(['async', 'attribute', 'callback', 'const', 'constructor',
+ 'deleter', 'dictionary', 'enum', 'getter', 'includes',
+ 'inherit', 'interface', 'iterable', 'maplike', 'namespace',
+ 'partial', 'required', 'setlike', 'setter', 'static',
+ 'stringifier', 'typedef', 'unrestricted'])
@classmethod
def peek(cls, tokens):
token = tokens.pushPosition()
@@ -1249,7 +1250,35 @@ def __repr__(self):
return '[' + self.name.encode('ascii', 'replace') + ']'
-class AttributeRest(Production): # ["readonly"] "attribute" TypeWithExtendedAttributes ("required" | identifier) [Ignore] ";"
+class AttributeName(Production): # (identifier | AttributeNameKeyword)
+ AttributeNameKeywords = frozenset(['async', 'required'])
+
+ @classmethod
+ def peek(cls, tokens):
+ token = tokens.pushPosition()
+ return tokens.popPosition(token and (token.isIdentifier() or (token.isSymbol() and (token.text in cls.AttributeNameKeywords))))
+
+ def __init__(self, tokens):
+ Production.__init__(self, tokens)
+ self._name = tokens.next().text
+ self._didParse(tokens)
+
+ @property
+ def name(self):
+ return self._name[1:] if ('_' == self._name[0]) else self._name
+
+ def _unicode(self):
+ return self._name
+
+ def _markup(self, generator):
+ generator.addName(self._name)
+ return self
+
+ def __repr__(self):
+ return '[OperationName: ' + repr(self._name) + ']'
+
+
+class AttributeRest(Production): # ["readonly"] "attribute" TypeWithExtendedAttributes AttributeName [Ignore] ";"
@classmethod
def peek(cls, tokens):
token = tokens.pushPosition()
@@ -1257,8 +1286,7 @@ def peek(cls, tokens):
token = tokens.peek()
if (token and token.isSymbol('attribute')):
if (TypeWithExtendedAttributes.peek(tokens)):
- token = tokens.peek()
- return tokens.popPosition(token and (token.isIdentifier() or token.isSymbol('required')))
+ return tokens.popPosition(AttributeName.peek(tokens))
return tokens.popPosition(False)
def __init__(self, tokens):
@@ -1266,15 +1294,19 @@ def __init__(self, tokens):
self.readonly = Symbol(tokens, 'readonly') if (Symbol.peek(tokens, 'readonly')) else None
self._attribute = Symbol(tokens, 'attribute')
self.type = TypeWithExtendedAttributes(tokens)
- self.name = tokens.next().text
+ self._name = AttributeName(tokens)
self._ignore = Ignore(tokens) if (Ignore.peek(tokens)) else None
self._consumeSemicolon(tokens)
self._didParse(tokens)
+ @property
+ def name(self):
+ return self._name.name
+
def _unicode(self):
output = unicode(self.readonly) if (self.readonly) else ''
output += unicode(self._attribute) + unicode(self.type)
- output += self.name
+ output += unicode(self._name)
return output + (unicode(self._ignore) if (self._ignore) else '')
def _markup(self, generator):
@@ -1282,7 +1314,7 @@ def _markup(self, generator):
self.readonly.markup(generator)
self._attribute.markup(generator)
generator.addType(self.type)
- generator.addName(self.name)
+ self._name.markup(generator)
if (self._ignore):
self._ignore.markup(generator)
return self
@@ -1402,12 +1434,40 @@ def __repr__(self):
return output + repr(self.attribute) + ']'
-class OperationRest(ChildProduction): # [identifier] "(" [ArgumentList] ")" [Ignore] ";"
+class OperationName(Production): # (identifier | OperationNameKeyword)
+ OperationNameKeywords = frozenset(['includes'])
+
@classmethod
def peek(cls, tokens):
token = tokens.pushPosition()
- if (token and token.isIdentifier()):
- token = tokens.peek()
+ return tokens.popPosition(token and (token.isIdentifier() or (token.isSymbol() and (token.text in cls.OperationNameKeywords))))
+
+ def __init__(self, tokens):
+ Production.__init__(self, tokens)
+ self._name = tokens.next().text
+ self._didParse(tokens)
+
+ @property
+ def name(self):
+ return self._name[1:] if ('_' == self._name[0]) else self._name
+
+ def _unicode(self):
+ return self._name
+
+ def _markup(self, generator):
+ generator.addName(self._name)
+ return self
+
+ def __repr__(self):
+ return '[OperationName: ' + repr(self._name) + ']'
+
+
+class OperationRest(ChildProduction): # [OperationName] "(" [ArgumentList] ")" [Ignore] ";"
+ @classmethod
+ def peek(cls, tokens):
+ tokens.pushPosition(False)
+ OperationName.peek(tokens)
+ token = tokens.peek()
if (token and token.isSymbol('(')):
ArgumentList.peek(tokens)
token = tokens.peek()
@@ -1416,7 +1476,7 @@ def peek(cls, tokens):
def __init__(self, tokens, parent):
ChildProduction.__init__(self, tokens, parent)
- self.name = tokens.next().text if (tokens.sneakPeek().isIdentifier()) else None
+ self._name = OperationName(tokens) if (OperationName.peek(tokens)) else None
self._openParen = Symbol(tokens, '(')
self.arguments = ArgumentList(tokens, parent) if (ArgumentList.peek(tokens)) else None
self._closeParen = Symbol(tokens, ')')
@@ -1428,17 +1488,22 @@ def __init__(self, tokens, parent):
def idlType(self):
return 'method'
+ @property
+ def name(self):
+ return self._name.name if (self._name) else None
+
@property
def argumentNames(self):
return self.arguments.argumentNames if (self.arguments) else ['']
def _unicode(self):
- output = self.name if (self.name) else ''
+ output = unicode(self._name) if (self._name) else ''
output += unicode(self._openParen) + (unicode(self.arguments) if (self.arguments) else '') + unicode(self._closeParen)
return output + (unicode(self._ignore) if (self._ignore) else '')
def _markup(self, generator):
- generator.addName(self.name)
+ if (self._name):
+ self._name.markup(generator)
generator.addText(self._openParen)
if (self.arguments):
self.arguments.markup(generator)
@@ -1449,7 +1514,7 @@ def _markup(self, generator):
def __repr__(self):
output = '[OperationRest: '
- output += ('[name: ' + self.name.encode('ascii', 'replace') + '] ') if (self.name) else ''
+ output += ('[name: ' + repr(self._name) + '] ') if (self._name) else ''
return output + '[argumentlist: ' + (repr(self.arguments) if (self.arguments) else '') + ']]'
@@ -1531,65 +1596,65 @@ def __repr__(self):
return output + ']'
-class AsyncIterable(ChildProduction): # "async iterable" "<" TypeWithExtendedAttributes "," TypeWithExtendedAttributes ">" ";"
- @classmethod
- def peek(cls, tokens):
- tokens.pushPosition(False)
- if (Symbol.peek(tokens, 'async')):
- if (Symbol.peek(tokens, 'iterable')):
- if (Symbol.peek(tokens, '<')):
- if (TypeWithExtendedAttributes.peek(tokens)):
- if (Symbol.peek(tokens, ',')):
- if (TypeWithExtendedAttributes.peek(tokens)):
- token = tokens.peek()
- return tokens.popPosition(token and token.isSymbol('>'))
- return tokens.popPosition(False)
-
- def __init__(self, tokens, parent):
- ChildProduction.__init__(self, tokens, parent)
- self._async = Symbol(tokens)
- self._iterable = Symbol(tokens)
- self._openType = Symbol(tokens, '<')
- self.keyType = TypeWithExtendedAttributes(tokens)
- self._comma = Symbol(tokens)
- self.valueType = TypeWithExtendedAttributes(tokens)
- self._closeType = Symbol(tokens, '>')
- self._consumeSemicolon(tokens)
- self._didParse(tokens)
-
- @property
- def idlType(self):
- return 'async-iterable'
-
- @property
- def name(self):
- return '__async_iterable__'
-
- @property
- def arguments(self):
- return None
-
- def _unicode(self):
- output = unicode(self._async) + unicode(self._iterable) + unicode(self._openType)
- output += unicode(self.keyType) + unicode(self._comma) + unicode(self.valueType)
- return output + unicode(self._closeType)
-
- def _markup(self, generator):
- self._async.markup(generator)
- self._iterable.markup(generator)
- generator.addText(self._openType)
- generator.addType(self.keyType)
- generator.addText(self._comma)
- generator.addType(self.valueType)
- generator.addText(self._closeType)
- return self
-
- def __repr__(self):
- output = '[AsyncIterable: '
- output += repr(self.keyType) + ' ' + repr(self.valueType)
- return output + ']'
-
-
+class AsyncIterable(ChildProduction): # "async iterable" "<" TypeWithExtendedAttributes "," TypeWithExtendedAttributes ">" ";"
+ @classmethod
+ def peek(cls, tokens):
+ tokens.pushPosition(False)
+ if (Symbol.peek(tokens, 'async')):
+ if (Symbol.peek(tokens, 'iterable')):
+ if (Symbol.peek(tokens, '<')):
+ if (TypeWithExtendedAttributes.peek(tokens)):
+ if (Symbol.peek(tokens, ',')):
+ if (TypeWithExtendedAttributes.peek(tokens)):
+ token = tokens.peek()
+ return tokens.popPosition(token and token.isSymbol('>'))
+ return tokens.popPosition(False)
+
+ def __init__(self, tokens, parent):
+ ChildProduction.__init__(self, tokens, parent)
+ self._async = Symbol(tokens)
+ self._iterable = Symbol(tokens)
+ self._openType = Symbol(tokens, '<')
+ self.keyType = TypeWithExtendedAttributes(tokens)
+ self._comma = Symbol(tokens)
+ self.valueType = TypeWithExtendedAttributes(tokens)
+ self._closeType = Symbol(tokens, '>')
+ self._consumeSemicolon(tokens)
+ self._didParse(tokens)
+
+ @property
+ def idlType(self):
+ return 'async-iterable'
+
+ @property
+ def name(self):
+ return '__async_iterable__'
+
+ @property
+ def arguments(self):
+ return None
+
+ def _unicode(self):
+ output = unicode(self._async) + unicode(self._iterable) + unicode(self._openType)
+ output += unicode(self.keyType) + unicode(self._comma) + unicode(self.valueType)
+ return output + unicode(self._closeType)
+
+ def _markup(self, generator):
+ self._async.markup(generator)
+ self._iterable.markup(generator)
+ generator.addText(self._openType)
+ generator.addType(self.keyType)
+ generator.addText(self._comma)
+ generator.addType(self.valueType)
+ generator.addText(self._closeType)
+ return self
+
+ def __repr__(self):
+ output = '[AsyncIterable: '
+ output += repr(self.keyType) + ' ' + repr(self.valueType)
+ return output + ']'
+
+
class Maplike(ChildProduction): # ["readonly"] "maplike" "<" TypeWithExtendedAttributes "," TypeWithExtendedAttributes ">" ";"
@classmethod
def peek(cls, tokens):
@@ -1997,6 +2062,73 @@ def __repr__(self):
return output + repr(self.attribute) + ']'
+class Constructor(ChildProduction): # "constructor" "(" ArgumentList ")" ";"
+ @classmethod
+ def peek(cls, tokens):
+ tokens.pushPosition(False)
+ if (Symbol.peek(tokens, 'constructor')):
+ if (Symbol.peek(tokens, '(')):
+ ArgumentList.peek(tokens)
+ token = tokens.peek()
+ return tokens.popPosition(token and token.isSymbol(')'))
+ return tokens.popPosition(False)
+
+ def __init__(self, tokens, parent):
+ ChildProduction.__init__(self, tokens, parent)
+ self._constructor = Symbol(tokens, 'constructor')
+ self._openParen = Symbol(tokens, '(')
+ self.arguments = ArgumentList(tokens, parent) if (ArgumentList.peek(tokens)) else None
+ self._closeParen = Symbol(tokens, ')')
+ self._consumeSemicolon(tokens)
+ self._didParse(tokens)
+
+ @property
+ def idlType(self):
+ return 'method'
+
+ @property
+ def name(self):
+ return unicode(self._constructor)
+
+ @property
+ def stringifier(self):
+ return False
+
+ @property
+ def argumentNames(self):
+ return self.arguments.argumentNames if (self.arguments) else ['']
+
+ @property
+ def methodName(self):
+ name = 'constructor('
+ if (self.arguments):
+ name += self.arguments.argumentNames[0]
+ return name + ')'
+
+ @property
+ def methodNames(self):
+ if (self.arguments):
+ return ['constructor(' + argumentName + ')' for argumentName in self.arguments.argumentNames]
+ return [self.methodName]
+
+ def _unicode(self):
+ output = self.name if (self.name) else ''
+ return output + unicode(self._openParen) + (unicode(self.arguments) if (self.arguments) else '') + unicode(self._closeParen)
+
+ def _markup(self, generator):
+ if (self._constructor):
+ self._constructor.markup(generator)
+ generator.addText(self._openParen)
+ if (self.arguments):
+ self.arguments.markup(generator)
+ generator.addText(self._closeParen)
+ return self
+
+ def __repr__(self):
+ output = '[Constructor: '
+ return output + '[argumentlist: ' + (repr(self.arguments) if (self.arguments) else '') + ']]'
+
+
class ExtendedAttributeList(ChildProduction): # "[" ExtendedAttribute ["," ExtendedAttribute]... "]"
@classmethod
def peek(cls, tokens):
diff --git a/bikeshed/widlparser/widlparser/tokenizer.py b/bikeshed/widlparser/widlparser/tokenizer.py
index 7f191996e1..7892c11fff 100644
--- a/bikeshed/widlparser/widlparser/tokenizer.py
+++ b/bikeshed/widlparser/widlparser/tokenizer.py
@@ -52,7 +52,7 @@ def __repr__(self):
class Tokenizer(object):
SymbolIdents = frozenset((
- 'any', 'async', 'attribute', 'ArrayBuffer', 'boolean', 'byte', 'ByteString', 'callback', 'const', 'creator', 'DataView',
+ 'any', 'async', 'attribute', 'ArrayBuffer', 'boolean', 'byte', 'ByteString', 'callback', 'const', 'constructor', 'creator', 'DataView',
'deleter', 'dictionary', 'DOMString', 'double', 'enum', 'Error', 'exception', 'false', 'float',
'Float32Array', 'Float64Array', 'FrozenArray', 'getter', 'implements', 'includes', 'Infinity', '-Infinity', 'inherit', 'Int8Array',
'Int16Array', 'Int32Array', 'interface', 'iterable', 'legacycaller', 'legacyiterable', 'long', 'maplike', 'mixin',
diff --git a/tests/github/w3c/IndexedDB/index.html b/tests/github/w3c/IndexedDB/index.html
index 10f0b55bf0..0657a08b3f 100644
--- a/tests/github/w3c/IndexedDB/index.html
+++ b/tests/github/w3c/IndexedDB/index.html
@@ -3360,7 +3360,7 @@ 4
optional boolean lowerOpen
= false ,
optional boolean upperOpen
= false );
- boolean _includes (any key
);
+ boolean _includes (any key
);
};
Note: When mapping the _includes
identifier from [WEBIDL] to ECMAScript, the leading U+005F LOW LINE ("_") character is removed. A leading "_" is used to escape the identifier from looking like a reserved word (in this case, the includes
keyword).
@@ -7308,7 +7308,7 @@ I
optional boolean lowerOpen
= false ,
optional boolean upperOpen
= false );
- boolean _includes (any key
);
+ boolean _includes (any key
);
};
[Exposed =(Window ,Worker )]
diff --git a/tests/github/w3c/csswg-drafts/cssom-1/Overview.html b/tests/github/w3c/csswg-drafts/cssom-1/Overview.html
index ebaa72bee7..e6318c041a 100644
--- a/tests/github/w3c/csswg-drafts/cssom-1/Overview.html
+++ b/tests/github/w3c/csswg-drafts/cssom-1/Overview.html
@@ -1898,7 +1898,7 @@ supported CSS property,
the following partial interface applies where camel-cased attribute is obtained by running the CSS property to IDL attribute algorithm for property .
The camel-cased attribute
attribute, on getting, must return the
@@ -1911,7 +1911,7 @@
supported CSS property and that begins
with the string -webkit-
, the following partial interface applies where webkit-cased attribute is obtained by running the CSS property to IDL attribute algorithm for property , with the lowercase first flag set.
The webkit-cased attribute
attribute, on
@@ -1927,7 +1927,7 @@
-" (U+002D) in the property name,
the following partial interface applies where dashed attribute is property .
The dashed attribute
attribute, on getting, must return the
@@ -2577,7 +2577,7 @@