Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 817 my $next = $self->nextToken(); | 817 my $next = $self->nextToken(); |
| 818 if ($next->value() eq "typedef") { | 818 if ($next->value() eq "typedef") { |
| 819 $self->assertTokenValue($self->getToken(), "typedef", __LINE__); | 819 $self->assertTokenValue($self->getToken(), "typedef", __LINE__); |
| 820 my $typedef = Typedef->new(); | 820 my $typedef = Typedef->new(); |
| 821 $typedef->extendedAttributes($self->parseExtendedAttributeListAllowEmpty ()); | 821 $typedef->extendedAttributes($self->parseExtendedAttributeListAllowEmpty ()); |
| 822 $typedef->type($self->parseType()); | 822 $typedef->type($self->parseType()); |
| 823 my $nameToken = $self->getToken(); | 823 my $nameToken = $self->getToken(); |
| 824 $self->assertTokenType($nameToken, IdentifierToken); | 824 $self->assertTokenType($nameToken, IdentifierToken); |
| 825 $self->assertTokenValue($self->getToken(), ";", __LINE__); | 825 $self->assertTokenValue($self->getToken(), ";", __LINE__); |
| 826 my $name = $nameToken->value(); | 826 my $name = $nameToken->value(); |
| 827 die "typedef redefinition for " . $name . " at " . $self->{Line} if exis ts $typedefs{$name}; | 827 die "typedef redefinition for " . $name . " at " . $self->{Line} if (exi sts $typedefs{$name} && $typedef->type ne $typedefs{$name}->type); |
|
haraken
2013/04/22 11:44:50
Nit: What is this change for?
| |
| 828 $typedefs{$name} = $typedef; | 828 $typedefs{$name} = $typedef; |
| 829 return; | 829 return; |
| 830 } | 830 } |
| 831 $self->assertUnexpectedToken($next->value(), __LINE__); | 831 $self->assertUnexpectedToken($next->value(), __LINE__); |
| 832 } | 832 } |
| 833 | 833 |
| 834 sub parseImplementsStatement | 834 sub parseImplementsStatement |
| 835 { | 835 { |
| 836 my $self = shift; | 836 my $self = shift; |
| 837 my $extendedAttributeList = shift; | 837 my $extendedAttributeList = shift; |
| (...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2175 my @attributeKeys = keys (%attributes); | 2175 my @attributeKeys = keys (%attributes); |
| 2176 my $constructorName = $attributeKeys[0]; | 2176 my $constructorName = $attributeKeys[0]; |
| 2177 push(@{$newDataNode->parameters}, @{$attributes{$constructorName}}); | 2177 push(@{$newDataNode->parameters}, @{$attributes{$constructorName}}); |
| 2178 $extendedAttributeList->{"NamedConstructor"} = $constructorName; | 2178 $extendedAttributeList->{"NamedConstructor"} = $constructorName; |
| 2179 push(@{$interface->constructors}, $newDataNode); | 2179 push(@{$interface->constructors}, $newDataNode); |
| 2180 } | 2180 } |
| 2181 $interface->extendedAttributes($extendedAttributeList); | 2181 $interface->extendedAttributes($extendedAttributeList); |
| 2182 } | 2182 } |
| 2183 | 2183 |
| 2184 1; | 2184 1; |
| OLD | NEW |