| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 my $name = shift; | 163 my $name = shift; |
| 164 my $line = shift; | 164 my $line = shift; |
| 165 my $typedef = $typedefs{$name}; | 165 my $typedef = $typedefs{$name}; |
| 166 my $msg = "Unexpected extendedAttributeList in typedef \"$name\" at " . $sel
f->{Line}; | 166 my $msg = "Unexpected extendedAttributeList in typedef \"$name\" at " . $sel
f->{Line}; |
| 167 if (defined ($line)) { | 167 if (defined ($line)) { |
| 168 $msg .= " IDLParser.pm:" . $line; | 168 $msg .= " IDLParser.pm:" . $line; |
| 169 } | 169 } |
| 170 die $msg if %{$typedef->extendedAttributes}; | 170 die $msg if %{$typedef->extendedAttributes}; |
| 171 } | 171 } |
| 172 | 172 |
| 173 sub ParseOnlyExtendedAttributes |
| 174 { |
| 175 my $self = shift; |
| 176 my $fileName = shift; |
| 177 my $defines = shift; |
| 178 my $preprocessor = shift; |
| 179 |
| 180 my @lines = applyPreprocessor($fileName, $defines, $preprocessor); |
| 181 $self->{Line} = $lines[0]; |
| 182 $self->{DocumentContent} = join(' ', @lines); |
| 183 |
| 184 $self->getToken(); |
| 185 return $self->parseExtendedAttributeListAllowEmpty(); |
| 186 } |
| 187 |
| 173 sub Parse | 188 sub Parse |
| 174 { | 189 { |
| 175 my $self = shift; | 190 my $self = shift; |
| 176 my $fileName = shift; | 191 my $fileName = shift; |
| 177 my $defines = shift; | 192 my $defines = shift; |
| 178 my $preprocessor = shift; | 193 my $preprocessor = shift; |
| 179 | 194 |
| 180 my @definitions = (); | 195 my @definitions = (); |
| 181 | 196 |
| 182 my @lines = applyPreprocessor($fileName, $defines, $preprocessor); | 197 my @lines = applyPreprocessor($fileName, $defines, $preprocessor); |
| (...skipping 2020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2203 $customConstructor->{overloadedIndex} = $index++; | 2218 $customConstructor->{overloadedIndex} = $index++; |
| 2204 push(@{$interface->customConstructors}, $customConstructor); | 2219 push(@{$interface->customConstructors}, $customConstructor); |
| 2205 } | 2220 } |
| 2206 delete $extendedAttributeList->{"CustomConstructors"}; | 2221 delete $extendedAttributeList->{"CustomConstructors"}; |
| 2207 $extendedAttributeList->{"CustomConstructor"} = "VALUE_IS_MISSING"; | 2222 $extendedAttributeList->{"CustomConstructor"} = "VALUE_IS_MISSING"; |
| 2208 } | 2223 } |
| 2209 $interface->extendedAttributes($extendedAttributeList); | 2224 $interface->extendedAttributes($extendedAttributeList); |
| 2210 } | 2225 } |
| 2211 | 2226 |
| 2212 1; | 2227 1; |
| OLD | NEW |