Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(462)

Side by Side Diff: Source/bindings/scripts/deprecated_idl_parser.pm

Issue 23479016: Introduce Promise mapping to the IDL generator (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # 1 #
2 # KDOM IDL parser 2 # KDOM IDL parser
3 # 3 #
4 # Copyright (C) 2005 Nikolas Zimmermann <wildfox@kde.org> 4 # Copyright (C) 2005 Nikolas Zimmermann <wildfox@kde.org>
5 # 5 #
6 # This library is free software; you can redistribute it and/or 6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Library General Public 7 # modify it under the terms of the GNU Library General Public
8 # License as published by the Free Software Foundation; either 8 # License as published by the Free Software Foundation; either
9 # version 2 of the License, or (at your option) any later version. 9 # version 2 of the License, or (at your option) any later version.
10 # 10 #
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 sub typeRemoveNullableSuffix 327 sub typeRemoveNullableSuffix
328 { 328 {
329 my $type = shift; 329 my $type = shift;
330 $type =~ s/\?$//g; 330 $type =~ s/\?$//g;
331 return $type; 331 return $type;
332 } 332 }
333 333
334 my $nextAttribute_1 = '^(attribute|inherit|readonly)$'; 334 my $nextAttribute_1 = '^(attribute|inherit|readonly)$';
335 my $nextPrimitiveType_1 = '^(int|long|short|unsigned)$'; 335 my $nextPrimitiveType_1 = '^(int|long|short|unsigned)$';
336 my $nextPrimitiveType_2 = '^(double|float|unrestricted)$'; 336 my $nextPrimitiveType_2 = '^(double|float|unrestricted)$';
337 my $nextArgumentList_1 = '^(\(|::|ByteString|DOMString|Date|\[|any|boolean|byte| double|float|in|int|long|object|octet|optional|sequence|short|unrestricted|unsig ned)$'; 337 my $nextArgumentList_1 = '^(\(|::|ByteString|DOMString|Promise|PromiseResolver|D ate|\[|any|boolean|byte|double|float|in|int|long|object|octet|optional|sequence| short|unrestricted|unsigned)$';
haraken 2013/09/02 21:44:21 Do you really need to make these changes to the ID
yusukesuzuki 2013/09/03 01:52:40 Promise and PromiseResolver won't be DOMObject sin
haraken 2013/09/03 02:12:19 Thanks for the clarification. Makes sense. Would y
yusukesuzuki 2013/09/03 09:35:55 Done.
338 my $nextNonAnyType_1 = '^(boolean|byte|double|float|int|long|octet|short|unrestr icted|unsigned)$'; 338 my $nextNonAnyType_1 = '^(boolean|byte|double|float|int|long|octet|short|unrestr icted|unsigned)$';
339 my $nextInterfaceMember_1 = '^(\(|::|ByteString|DOMString|Date|any|attribute|boo lean|byte|creator|deleter|double|float|getter|inherit|int|legacycaller|long|obje ct|octet|readonly|sequence|serializer|setter|short|static|stringifier|unrestrict ed|unsigned|void)$'; 339 my $nextInterfaceMember_1 = '^(\(|::|ByteString|DOMString|Promise|PromiseResolve r|Date|any|attribute|boolean|byte|creator|deleter|double|float|getter|inherit|in t|legacycaller|long|object|octet|readonly|sequence|serializer|setter|short|stati c|stringifier|unrestricted|unsigned|void)$';
340 my $nextOptionalIteratorInterfaceOrObject_1 = '^(;|=)$'; 340 my $nextOptionalIteratorInterfaceOrObject_1 = '^(;|=)$';
341 my $nextAttributeOrOperationOrIterator_1 = '^(static|stringifier)$'; 341 my $nextAttributeOrOperationOrIterator_1 = '^(static|stringifier)$';
342 my $nextAttributeOrOperationOrIterator_2 = '^(\(|::|ByteString|DOMString|Date|an y|boolean|byte|creator|deleter|double|float|getter|int|legacycaller|long|object| octet|sequence|setter|short|unrestricted|unsigned|void)$'; 342 my $nextAttributeOrOperationOrIterator_2 = '^(\(|::|ByteString|DOMString|Promise |PromiseResolver|Date|any|boolean|byte|creator|deleter|double|float|getter|int|l egacycaller|long|object|octet|sequence|setter|short|unrestricted|unsigned|void)$ ';
343 my $nextUnrestrictedFloatType_1 = '^(double|float)$'; 343 my $nextUnrestrictedFloatType_1 = '^(double|float)$';
344 my $nextExtendedAttributeRest3_1 = '^(\,|::|\])$'; 344 my $nextExtendedAttributeRest3_1 = '^(\,|::|\])$';
345 my $nextExceptionField_1 = '^(\(|::|ByteString|DOMString|Date|any|boolean|byte|d ouble|float|int|long|object|octet|sequence|short|unrestricted|unsigned)$'; 345 my $nextExceptionField_1 = '^(\(|::|ByteString|DOMString|Promise|PromiseResolver |Date|any|boolean|byte|double|float|int|long|object|octet|sequence|short|unrestr icted|unsigned)$';
346 my $nextType_1 = '^(::|ByteString|DOMString|Date|any|boolean|byte|double|float|i nt|long|object|octet|sequence|short|unrestricted|unsigned)$'; 346 my $nextType_1 = '^(::|ByteString|DOMString|Promise|PromiseResolver|Date|any|boo lean|byte|double|float|int|long|object|octet|sequence|short|unrestricted|unsigne d)$';
347 my $nextSpecials_1 = '^(creator|deleter|getter|legacycaller|setter)$'; 347 my $nextSpecials_1 = '^(creator|deleter|getter|legacycaller|setter)$';
348 my $nextDefinitions_1 = '^(::|callback|dictionary|enum|exception|interface|parti al|typedef)$'; 348 my $nextDefinitions_1 = '^(::|callback|dictionary|enum|exception|interface|parti al|typedef)$';
349 my $nextExceptionMembers_1 = '^(\(|::|ByteString|DOMString|Date|\[|any|boolean|b yte|const|double|float|int|long|object|octet|optional|sequence|short|unrestricte d|unsigned)$'; 349 my $nextExceptionMembers_1 = '^(\(|::|ByteString|DOMString|Promise|PromiseResolv er|Date|\[|any|boolean|byte|const|double|float|int|long|object|octet|optional|se quence|short|unrestricted|unsigned)$';
350 my $nextAttributeRest_1 = '^(attribute|readonly)$'; 350 my $nextAttributeRest_1 = '^(attribute|readonly)$';
351 my $nextInterfaceMembers_1 = '^(\(|::|ByteString|DOMString|Date|any|attribute|bo olean|byte|const|creator|deleter|double|float|getter|inherit|int|legacycaller|lo ng|object|octet|readonly|sequence|serializer|setter|short|static|stringifier|unr estricted|unsigned|void)$'; 351 my $nextInterfaceMembers_1 = '^(\(|::|ByteString|DOMString|Promise|PromiseResolv er|Date|any|attribute|boolean|byte|const|creator|deleter|double|float|getter|inh erit|int|legacycaller|long|object|octet|readonly|sequence|serializer|setter|shor t|static|stringifier|unrestricted|unsigned|void)$';
352 my $nextSingleType_1 = '^(::|ByteString|DOMString|Date|boolean|byte|double|float |int|long|object|octet|sequence|short|unrestricted|unsigned)$'; 352 my $nextSingleType_1 = '^(::|ByteString|DOMString|Promise|PromiseResolver|Date|b oolean|byte|double|float|int|long|object|octet|sequence|short|unrestricted|unsig ned)$';
353 my $nextArgumentName_1 = '^(attribute|callback|const|creator|deleter|dictionary| enum|exception|getter|implements|inherit|interface|legacycaller|partial|serializ er|setter|static|stringifier|typedef|unrestricted)$'; 353 my $nextArgumentName_1 = '^(attribute|callback|const|creator|deleter|dictionary| enum|exception|getter|implements|inherit|interface|legacycaller|partial|serializ er|setter|static|stringifier|typedef|unrestricted)$';
354 my $nextConstValue_1 = '^(false|true)$'; 354 my $nextConstValue_1 = '^(false|true)$';
355 my $nextConstValue_2 = '^(-|Infinity|NaN)$'; 355 my $nextConstValue_2 = '^(-|Infinity|NaN)$';
356 my $nextDefinition_1 = '^(callback|interface)$'; 356 my $nextDefinition_1 = '^(callback|interface)$';
357 my $nextAttributeOrOperationRest_1 = '^(\(|::|ByteString|DOMString|Date|any|bool ean|byte|double|float|int|long|object|octet|sequence|short|unrestricted|unsigned |void)$'; 357 my $nextAttributeOrOperationRest_1 = '^(\(|::|ByteString|DOMString|Promise|Promi seResolver|Date|any|boolean|byte|double|float|int|long|object|octet|sequence|sho rt|unrestricted|unsigned|void)$';
358 my $nextUnsignedIntegerType_1 = '^(int|long|short)$'; 358 my $nextUnsignedIntegerType_1 = '^(int|long|short)$';
359 my $nextDefaultValue_1 = '^(-|Infinity|NaN|false|null|true)$'; 359 my $nextDefaultValue_1 = '^(-|Infinity|NaN|false|null|true)$';
360 360
361 361
362 sub parseDefinitions 362 sub parseDefinitions
363 { 363 {
364 my $self = shift; 364 my $self = shift;
365 my @definitions = (); 365 my @definitions = ();
366 366
367 while (1) { 367 while (1) {
(...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1855 return $self->parsePrimitiveType() . $self->parseTypeSuffix(); 1855 return $self->parsePrimitiveType() . $self->parseTypeSuffix();
1856 } 1856 }
1857 if ($next->value() eq "ByteString") { 1857 if ($next->value() eq "ByteString") {
1858 $self->assertTokenValue($self->getToken(), "ByteString", __LINE__); 1858 $self->assertTokenValue($self->getToken(), "ByteString", __LINE__);
1859 return "ByteString" . $self->parseTypeSuffix(); 1859 return "ByteString" . $self->parseTypeSuffix();
1860 } 1860 }
1861 if ($next->value() eq "DOMString") { 1861 if ($next->value() eq "DOMString") {
1862 $self->assertTokenValue($self->getToken(), "DOMString", __LINE__); 1862 $self->assertTokenValue($self->getToken(), "DOMString", __LINE__);
1863 return "DOMString" . $self->parseTypeSuffix(); 1863 return "DOMString" . $self->parseTypeSuffix();
1864 } 1864 }
1865 if ($next->value() eq "Promise") {
1866 $self->assertTokenValue($self->getToken(), "Promise", __LINE__);
1867 return "Promise" . $self->parseTypeSuffix();
1868 }
1869 if ($next->value() eq "PromiseResolver") {
1870 $self->assertTokenValue($self->getToken(), "PromiseResolver", __LINE__);
1871 return "PromiseResolver" . $self->parseTypeSuffix();
1872 }
1865 if ($next->value() eq "sequence") { 1873 if ($next->value() eq "sequence") {
1866 $self->assertTokenValue($self->getToken(), "sequence", __LINE__); 1874 $self->assertTokenValue($self->getToken(), "sequence", __LINE__);
1867 $self->assertTokenValue($self->getToken(), "<", __LINE__); 1875 $self->assertTokenValue($self->getToken(), "<", __LINE__);
1868 my $type = $self->parseType(); 1876 my $type = $self->parseType();
1869 $self->assertTokenValue($self->getToken(), ">", __LINE__); 1877 $self->assertTokenValue($self->getToken(), ">", __LINE__);
1870 return "sequence<" . $type . ">" . $self->parseNull(); 1878 return "sequence<" . $type . ">" . $self->parseNull();
1871 } 1879 }
1872 if ($next->value() eq "object") { 1880 if ($next->value() eq "object") {
1873 $self->assertTokenValue($self->getToken(), "object", __LINE__); 1881 $self->assertTokenValue($self->getToken(), "object", __LINE__);
1874 return "object" . $self->parseTypeSuffix(); 1882 return "object" . $self->parseTypeSuffix();
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
2234 $customConstructor->overloadedIndex($index++); 2242 $customConstructor->overloadedIndex($index++);
2235 push(@{$interface->customConstructors}, $customConstructor); 2243 push(@{$interface->customConstructors}, $customConstructor);
2236 } 2244 }
2237 delete $extendedAttributeList->{"CustomConstructors"}; 2245 delete $extendedAttributeList->{"CustomConstructors"};
2238 $extendedAttributeList->{"CustomConstructor"} = "VALUE_IS_MISSING"; 2246 $extendedAttributeList->{"CustomConstructor"} = "VALUE_IS_MISSING";
2239 } 2247 }
2240 $interface->extendedAttributes($extendedAttributeList); 2248 $interface->extendedAttributes($extendedAttributeList);
2241 } 2249 }
2242 2250
2243 1; 2251 1;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698