| Index: Source/bindings/scripts/IDLParser.pm
|
| diff --git a/Source/bindings/scripts/IDLParser.pm b/Source/bindings/scripts/IDLParser.pm
|
| index 5075384350320329498f9ccdc1b3227a476d927c..dd043179f2cd26efee85ff4a6133c680c2a5972d 100644
|
| --- a/Source/bindings/scripts/IDLParser.pm
|
| +++ b/Source/bindings/scripts/IDLParser.pm
|
| @@ -35,9 +35,16 @@ use constant EmptyToken => 5;
|
|
|
| # Used to represent a parsed IDL document
|
| struct( idlDocument => {
|
| - interfaces => '@', # All parsed interfaces
|
| - enumerations => '@', # All parsed enumerations
|
| fileName => '$', # file name
|
| + callbackFunctions => '@',
|
| + enumerations => '@', # All parsed enumerations
|
| + interfaces => '@', # All parsed interfaces
|
| +});
|
| +
|
| +struct( CallbackFunction => {
|
| + name => '$',
|
| + returnType => '$',
|
| + arguments => '@',
|
| });
|
|
|
| # Used to represent 'interface' blocks
|
| @@ -208,6 +215,8 @@ sub Parse
|
| push(@{$document->interfaces}, $definition);
|
| } elsif (ref($definition) eq "domEnum") {
|
| push(@{$document->enumerations}, $definition);
|
| + } elsif (ref($definition) eq "CallbackFunction") {
|
| + push(@{$document->callbackFunctions}, $definition);
|
| } else {
|
| die "Unrecognized IDL definition kind: \"" . ref($definition) . "\"";
|
| }
|
| @@ -810,14 +819,17 @@ sub parseCallbackRest
|
|
|
| my $next = $self->nextToken();
|
| if ($next->type() == IdentifierToken) {
|
| - $self->assertTokenType($self->getToken(), IdentifierToken);
|
| + my $callback = CallbackFunction->new();
|
| + my $name = $self->getToken();
|
| + $self->assertTokenType($name, IdentifierToken);
|
| + $callback->name($name->value());
|
| $self->assertTokenValue($self->getToken(), "=", __LINE__);
|
| - $self->parseReturnType();
|
| + $callback->returnType($self->parseReturnType());
|
| $self->assertTokenValue($self->getToken(), "(", __LINE__);
|
| - $self->parseArgumentList();
|
| + $callback->arguments($self->parseArgumentList());
|
| $self->assertTokenValue($self->getToken(), ")", __LINE__);
|
| $self->assertTokenValue($self->getToken(), ";", __LINE__);
|
| - return;
|
| + return $callback;
|
| }
|
| $self->assertUnexpectedToken($next->value(), __LINE__);
|
| }
|
| @@ -1338,7 +1350,7 @@ sub parseOperationRest
|
| $newDataNode->signature(domSignature->new());
|
| my $name = $self->parseOptionalIdentifier();
|
| $newDataNode->signature->name($name);
|
| - $self->assertTokenValue($self->getToken(), "(", $name, __LINE__);
|
| + $self->assertTokenValue($self->getToken(), "(", __LINE__);
|
| push(@{$newDataNode->parameters}, @{$self->parseArgumentList()});
|
| $self->assertTokenValue($self->getToken(), ")", __LINE__);
|
| $self->assertTokenValue($self->getToken(), ";", __LINE__);
|
|
|