Changeset 98766 in webkit
- Timestamp:
- Oct 28, 2011, 2:46:17 PM (15 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
bindings/scripts/IDLParser.pm (modified) (4 diffs)
-
bindings/scripts/IDLStructure.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r98765 r98766 1 2011-10-28 Adam Klein <adamk@chromium.org> 2 3 Remove unused parsers for 'exception' and 'alias' IDL keywords 4 https://bugs.webkit.org/show_bug.cgi?id=71140 5 6 Reviewed by Adam Barth. 7 8 * bindings/scripts/IDLParser.pm: 9 (ParseInterface): 10 (DetermineParseMode): 11 (ProcessSection): 12 * bindings/scripts/IDLStructure.pm: 13 1 14 2011-10-28 Dan Bernstein <mitz@apple.com> 2 15 -
trunk/Source/WebCore/bindings/scripts/IDLParser.pm
r94156 r98766 33 33 use constant MODE_MODULE => 10; # 'module' section 34 34 use constant MODE_INTERFACE => 11; # 'interface' section 35 use constant MODE_EXCEPTION => 12; # 'exception' section36 use constant MODE_ALIAS => 13; # 'alias' section37 35 38 36 # Helper variables … … 237 235 238 236 # Beginning of the regexp parsing magic 239 if ($sectionName eq "exception") { 240 print " |- Trying to parse exception...\n" unless $beQuiet; 241 242 my $exceptionName = ""; 243 my $exceptionData = ""; 244 my $exceptionDataName = ""; 245 my $exceptionDataType = ""; 246 247 # Match identifier of the exception, and enclosed data... 248 $data =~ /$IDLStructure::exceptionSelector/; 249 $exceptionName = (defined($1) ? $1 : die("Parsing error!\nSource:\n$data\n)")); 250 $exceptionData = (defined($2) ? $2 : die("Parsing error!\nSource:\n$data\n)")); 251 252 ('' =~ /^/); # Reset variables needed for regexp matching 253 254 # ... parse enclosed data (get. name & type) 255 $exceptionData =~ /$IDLStructure::exceptionSubSelector/; 256 $exceptionDataType = (defined($1) ? $1 : die("Parsing error!\nSource:\n$data\n)")); 257 $exceptionDataName = (defined($2) ? $2 : die("Parsing error!\nSource:\n$data\n)")); 258 259 # Fill in domClass datastructure 260 $dataNode->name($exceptionName); 261 262 my $newDataNode = new domAttribute(); 263 $newDataNode->type("readonly attribute"); 264 $newDataNode->signature(new domSignature()); 265 266 $newDataNode->signature->name($exceptionDataName); 267 $newDataNode->signature->type($exceptionDataType); 268 269 my $arrayRef = $dataNode->attributes; 270 push(@$arrayRef, $newDataNode); 271 272 print " |----> Exception; NAME \"$exceptionName\" DATA TYPE \"$exceptionDataType\" DATA NAME \"$exceptionDataName\"\n |-\n |\n" unless $beQuiet; 273 } elsif ($sectionName eq "interface") { 237 if ($sectionName eq "interface") { 274 238 print " |- Trying to parse interface...\n" unless $beQuiet; 275 239 … … 416 380 } elsif ($_ =~ /interface/) { 417 381 $mode = MODE_INTERFACE; 418 } elsif ($_ =~ /exception/) {419 $mode = MODE_EXCEPTION;420 } elsif ($_ =~ /(\A|\b)alias/) {421 # The (\A|\b) above is needed so we don't match attributes422 # whose names contain the substring "alias".423 $mode = MODE_ALIAS;424 382 } 425 383 … … 443 401 my $arrayRef = $document->classes; 444 402 push(@$arrayRef, $node); 445 } elsif($parseMode eq MODE_EXCEPTION) {446 my $node = new domClass();447 $object->ParseInterface($node, "exception");448 449 die ("No module specified! Fatal Error!\n") if ($document eq 0);450 my $arrayRef = $document->classes;451 push(@$arrayRef, $node);452 } elsif($parseMode eq MODE_ALIAS) {453 print " |- Trying to parse alias...\n" unless $beQuiet;454 455 my $line = join("", @temporaryContent);456 $line =~ /$IDLStructure::aliasSelector/;457 458 my $interfaceName = (defined($1) ? $1 : die("Parsing error!\nSource:\n$line\n)"));459 my $wrapperName = (defined($2) ? $2 : die("Parsing error!\nSource:\n$line\n)"));460 461 print " |----> Alias; INTERFACE \"$interfaceName\" WRAPPER \"$wrapperName\"\n |-\n |\n" unless $beQuiet;462 463 # FIXME: Check if alias is already in aliases464 my $aliases = $document->aliases;465 $aliases->{$interfaceName} = $wrapperName;466 403 } 467 404 -
trunk/Source/WebCore/bindings/scripts/IDLStructure.pm
r98563 r98766 33 33 }); 34 34 35 # Used to represent 'interface' / 'exception'blocks35 # Used to represent 'interface' blocks 36 36 struct( domClass => { 37 37 name => '$', # Class identifier (without module) … … 103 103 our $typeNamespaceSelector = '((?:' . $idlId . '*::)*)\s*(' . $idlDataType . '*)'; 104 104 105 our $exceptionSelector = 'exception\s*(' . $idlIdNs . '*)\s*([a-zA-Z\s{;]*};)';106 our $exceptionSubSelector = '{\s*' . $supportedTypes . '\s*(' . $idlType . '*)\s*;\s*}';107 108 105 our $interfaceSelector = 'interface\s*((?:' . $extendedAttributeSyntax . ' )?)(' . $idlIdNs . '*)\s*(?::(\s*[^{]*))?{([-a-zA-Z0-9_"=\s(),;:\[\]&\|]*)'; 109 106 our $interfaceMethodSelector = '\s*((?:' . $extendedAttributeSyntax . ' )?)' . $supportedTypes . '\s*(' . $idlIdNs . '*)\s*\(\s*([a-zA-Z0-9:\s,=\[\]]*)';
Note:
See TracChangeset
for help on using the changeset viewer.