Bug 65046 - Add parsing support for extended attributes on IDL constants
Summary: Add parsing support for extended attributes on IDL constants
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Patrick R. Gansterer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-22 14:20 PDT by Patrick R. Gansterer
Modified: 2011-08-29 13:36 PDT (History)
1 user (show)

See Also:


Attachments
Patch (3.72 KB, patch)
2011-07-22 14:29 PDT, Patrick R. Gansterer
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick R. Gansterer 2011-07-22 14:20:14 PDT
Add parsing support for extended attributes on IDL constants
Comment 1 Patrick R. Gansterer 2011-07-22 14:29:11 PDT
Created attachment 101766 [details]
Patch
Comment 2 Brent Fulgham 2011-08-29 12:00:42 PDT
Comment on attachment 101766 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=101766&action=review

Looks good. r+, but please consider my suggestions.

> Source/WebCore/bindings/scripts/IDLParser.pm:332
> +                my $constExtendedAttributes = (defined($1) ? $1 : " "); chop($constExtendedAttributes);

I'm not a fan of having two bits of logic on a single line like this.  I'd rather see the 'chop' on its own line.

> Source/WebCore/bindings/scripts/IDLStructure.pm:97
> +our $constantSelector = 'const\s*(' . $extendedAttributeSyntax . ' )?' . $supportedTypes . '\s*(' . $idlType . '*)\s*=\s*(' . $constValue . ')';

Does adding this new elements to the IDL structure require lots of the existing IDL to be changed?  I think the answer is no (based on the EWS), but I just wanted to double-check.
Comment 3 Patrick R. Gansterer 2011-08-29 12:42:07 PDT
Comment on attachment 101766 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=101766&action=review

>> Source/WebCore/bindings/scripts/IDLParser.pm:332
>> +                my $constExtendedAttributes = (defined($1) ? $1 : " "); chop($constExtendedAttributes);
> 
> I'm not a fan of having two bits of logic on a single line like this.  I'd rather see the 'chop' on its own line.

It's only the same code as in ...
http://trac.webkit.org/browser/trunk/Source/WebCore/bindings/scripts/IDLParser.pm?rev=91770#L216
http://trac.webkit.org/browser/trunk/Source/WebCore/bindings/scripts/IDLParser.pm?rev=91770#L245
http://trac.webkit.org/browser/trunk/Source/WebCore/bindings/scripts/IDLParser.pm?rev=91770#L279
http://trac.webkit.org/browser/trunk/Source/WebCore/bindings/scripts/IDLParser.pm?rev=91770#L312

>> Source/WebCore/bindings/scripts/IDLStructure.pm:97
>> +our $constantSelector = 'const\s*(' . $extendedAttributeSyntax . ' )?' . $supportedTypes . '\s*(' . $idlType . '*)\s*=\s*(' . $constValue . ')';
> 
> Does adding this new elements to the IDL structure require lots of the existing IDL to be changed?  I think the answer is no (based on the EWS), but I just wanted to double-check.

as the ? in the regexp already says: it's optional :-)
Comment 4 Brent Fulgham 2011-08-29 12:47:58 PDT
Comment on attachment 101766 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=101766&action=review

Re-approved.  r+

>>> Source/WebCore/bindings/scripts/IDLParser.pm:332
>>> +                my $constExtendedAttributes = (defined($1) ? $1 : " "); chop($constExtendedAttributes);
>> 
>> I'm not a fan of having two bits of logic on a single line like this.  I'd rather see the 'chop' on its own line.
> 
> It's only the same code as in ...
> http://trac.webkit.org/browser/trunk/Source/WebCore/bindings/scripts/IDLParser.pm?rev=91770#L216
> http://trac.webkit.org/browser/trunk/Source/WebCore/bindings/scripts/IDLParser.pm?rev=91770#L245
> http://trac.webkit.org/browser/trunk/Source/WebCore/bindings/scripts/IDLParser.pm?rev=91770#L279
> http://trac.webkit.org/browser/trunk/Source/WebCore/bindings/scripts/IDLParser.pm?rev=91770#L312

Okay -- existing precedent trumps personal opinion :-)

>>> Source/WebCore/bindings/scripts/IDLStructure.pm:97
>>> +our $constantSelector = 'const\s*(' . $extendedAttributeSyntax . ' )?' . $supportedTypes . '\s*(' . $idlType . '*)\s*=\s*(' . $constValue . ')';
>> 
>> Does adding this new elements to the IDL structure require lots of the existing IDL to be changed?  I think the answer is no (based on the EWS), but I just wanted to double-check.
> 
> as the ? in the regexp already says: it's optional :-)

Great!
Comment 5 WebKit Review Bot 2011-08-29 13:36:35 PDT
Comment on attachment 101766 [details]
Patch

Clearing flags on attachment: 101766

Committed r94010: <http://trac.webkit.org/changeset/94010>
Comment 6 WebKit Review Bot 2011-08-29 13:36:39 PDT
All reviewed patches have been landed.  Closing bug.