⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 94010 in webkit


Ignore:
Timestamp:
Aug 29, 2011, 1:32:32 PM (15 years ago)
Author:
Patrick Gansterer
Message:

Add parsing support for extended attributes on IDL constants
https://bugs.webkit.org/show_bug.cgi?id=65046

Reviewed by Brent Fulgham.

With support for extended attributes on constants we can
replace some preprocessor lines from the IDL files with
the corresponding [Conditional=XXX] later.
Using the preprocessor causes much pain on native windows.

CodeGenerator support will be added in separate patches.

  • bindings/scripts/IDLParser.pm:
  • bindings/scripts/IDLStructure.pm:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r94009 r94010  
     12011-08-29  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Add parsing support for extended attributes on IDL constants
     4        https://bugs.webkit.org/show_bug.cgi?id=65046
     5
     6        Reviewed by Brent Fulgham.
     7
     8        With support for extended attributes on constants we can
     9        replace some preprocessor lines from the IDL files with
     10        the corresponding [Conditional=XXX] later.
     11        Using the preprocessor causes much pain on native windows.
     12
     13        CodeGenerator support will be added in separate patches.
     14
     15        * bindings/scripts/IDLParser.pm:
     16        * bindings/scripts/IDLStructure.pm:
     17
    1182011-08-29  Ryosuke Niwa  <rniwa@webkit.org>
    219
  • trunk/Source/WebCore/bindings/scripts/IDLParser.pm

    r91770 r94010  
    331331            } elsif ($line =~ /^\s*const/) {
    332332                $line =~ /$IDLStructure::constantSelector/;
    333                 my $constType = (defined($1) ? $1 : die("Parsing error!\nSource:\n$line\n)"));
    334                 my $constName = (defined($2) ? $2 : die("Parsing error!\nSource:\n$line\n)"));
    335                 my $constValue = (defined($3) ? $3 : die("Parsing error!\nSource:\n$line\n)"));
     333                my $constExtendedAttributes = (defined($1) ? $1 : " "); chop($constExtendedAttributes);
     334                my $constType = (defined($2) ? $2 : die("Parsing error!\nSource:\n$line\n)"));
     335                my $constName = (defined($3) ? $3 : die("Parsing error!\nSource:\n$line\n)"));
     336                my $constValue = (defined($4) ? $4 : die("Parsing error!\nSource:\n$line\n)"));
    336337
    337338                my $newDataNode = new domConstant();
     
    339340                $newDataNode->type($constType);
    340341                $newDataNode->value($constValue);
     342                $newDataNode->extendedAttributes(parseExtendedAttributes($constExtendedAttributes));
    341343
    342344                my $arrayRef = $dataNode->constants;
  • trunk/Source/WebCore/bindings/scripts/IDLStructure.pm

    r63908 r94010  
    7171    type => '$',      # Type of data
    7272    value => '$',      # Constant value
     73    extendedAttributes => '$', # Extended attributes
    7374});
    7475
     
    9495our $moduleSelector = 'module\s*(' . $idlId . '*)\s*{';
    9596our $moduleNSSelector = 'module\s*(' . $idlId . '*)\s*\[ns\s*(' . $idlIdNs . '*)\s*(' . $idlIdNs . '*)\]\s*;';
    96 our $constantSelector = 'const\s*' . $supportedTypes . '\s*(' . $idlType . '*)\s*=\s*(' . $constValue . ')';
     97our $constantSelector = 'const\s*(' . $extendedAttributeSyntax . ' )?' . $supportedTypes . '\s*(' . $idlType . '*)\s*=\s*(' . $constValue . ')';
    9798our $raisesSelector = 'raises\s*\((' . $idlIdNsList . '*)\s*\)';
    9899our $getterRaisesSelector = '\bgetter\s+raises\s*\((' . $idlIdNsList . '*)\s*\)';
Note: See TracChangeset for help on using the changeset viewer.