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

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

Issue 14329023: Bindings generator should support Web IDL callback interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 8 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
« no previous file with comments | « Source/bindings/scripts/CodeGeneratorV8.pm ('k') | Source/bindings/tests/idls/TestCallback.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 struct( domInterface => { 44 struct( domInterface => {
45 name => '$', # Class identifier 45 name => '$', # Class identifier
46 parents => '@', # List of strings 46 parents => '@', # List of strings
47 constants => '@', # List of 'domConstant' 47 constants => '@', # List of 'domConstant'
48 functions => '@', # List of 'domFunction' 48 functions => '@', # List of 'domFunction'
49 attributes => '@', # List of 'domAttribute' 49 attributes => '@', # List of 'domAttribute'
50 extendedAttributes => '$', # Extended attributes 50 extendedAttributes => '$', # Extended attributes
51 constructors => '@', # Constructors, list of 'domFunction' 51 constructors => '@', # Constructors, list of 'domFunction'
52 customConstructors => '@', # Custom constructors, list of 'domFunction' 52 customConstructors => '@', # Custom constructors, list of 'domFunction'
53 isException => '$', # Used for exception interfaces 53 isException => '$', # Used for exception interfaces
54 isCallback => '$', # Used for callback interfaces
54 }); 55 });
55 56
56 # Used to represent domInterface contents (name of method, signature) 57 # Used to represent domInterface contents (name of method, signature)
57 struct( domFunction => { 58 struct( domFunction => {
58 isStatic => '$', 59 isStatic => '$',
59 signature => '$', # Return type/Object name/extended attributes 60 signature => '$', # Return type/Object name/extended attributes
60 parameters => '@', # List of 'domSignature' 61 parameters => '@', # List of 'domSignature'
61 }); 62 });
62 63
63 # Used to represent domInterface contents (name of attribute, signature) 64 # Used to represent domInterface contents (name of attribute, signature)
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 $self->assertUnexpectedToken($next->value(), __LINE__); 464 $self->assertUnexpectedToken($next->value(), __LINE__);
464 } 465 }
465 466
466 sub parseCallbackRestOrInterface 467 sub parseCallbackRestOrInterface
467 { 468 {
468 my $self = shift; 469 my $self = shift;
469 my $extendedAttributeList = shift; 470 my $extendedAttributeList = shift;
470 471
471 my $next = $self->nextToken(); 472 my $next = $self->nextToken();
472 if ($next->value() eq "interface") { 473 if ($next->value() eq "interface") {
473 return $self->parseInterface($extendedAttributeList); 474 my $interface = $self->parseInterface($extendedAttributeList);
475 $interface->isCallback(1);
476 return $interface;
474 } 477 }
475 if ($next->type() == IdentifierToken) { 478 if ($next->type() == IdentifierToken) {
476 return $self->parseCallbackRest($extendedAttributeList); 479 return $self->parseCallbackRest($extendedAttributeList);
477 } 480 }
478 $self->assertUnexpectedToken($next->value(), __LINE__); 481 $self->assertUnexpectedToken($next->value(), __LINE__);
479 } 482 }
480 483
481 sub parseInterface 484 sub parseInterface
482 { 485 {
483 my $self = shift; 486 my $self = shift;
(...skipping 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after
2203 $customConstructor->{overloadedIndex} = $index++; 2206 $customConstructor->{overloadedIndex} = $index++;
2204 push(@{$interface->customConstructors}, $customConstructor); 2207 push(@{$interface->customConstructors}, $customConstructor);
2205 } 2208 }
2206 delete $extendedAttributeList->{"CustomConstructors"}; 2209 delete $extendedAttributeList->{"CustomConstructors"};
2207 $extendedAttributeList->{"CustomConstructor"} = "VALUE_IS_MISSING"; 2210 $extendedAttributeList->{"CustomConstructor"} = "VALUE_IS_MISSING";
2208 } 2211 }
2209 $interface->extendedAttributes($extendedAttributeList); 2212 $interface->extendedAttributes($extendedAttributeList);
2210 } 2213 }
2211 2214
2212 1; 2215 1;
OLDNEW
« no previous file with comments | « Source/bindings/scripts/CodeGeneratorV8.pm ('k') | Source/bindings/tests/idls/TestCallback.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698