Bug 29238 - CodeGenerator.pm needs some cleaning up
Summary: CodeGenerator.pm needs some cleaning up
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-13 18:51 PDT by Cameron McCormack (:heycam)
Modified: 2009-09-14 16:30 PDT (History)
2 users (show)

See Also:


Attachments
Patch v1 (15.54 KB, patch)
2009-09-13 19:02 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron McCormack (:heycam) 2009-09-13 18:51:04 PDT
A few things in CodeGenerator.pm can be cleaned up:

  * The ability to return multiple .idl files from ScanDirectory isn't needed.
  * File::Find can be used instead of ScanDirectory.
  * FindParentsRecursively can be done away with; this information can be collected while in AddMethodsConstantsAndAttributesFromParentClasses.
  * The recursion over ancestor interfaces in AddMethodsConstantsAndAttributesFromParentClasses and GetMethodsAndAttributesFromParentClasses can be factored out.
  * The searches for and parsing of .idl files can be factored out.
Comment 1 Cameron McCormack (:heycam) 2009-09-13 19:02:16 PDT
Created attachment 39533 [details]
Patch v1

Patch that simplifies CodeGenerator.pm as above.
Comment 2 Cameron McCormack (:heycam) 2009-09-13 19:07:41 PDT
I've tested that generated IDL files for all four binding targets are unchanged after this patch, btw.
Comment 3 Eric Seidel (no email) 2009-09-14 09:58:10 PDT
Comment on attachment 39533 [details]
Patch v1

This is mostly a rubber stamp.  But the change looks good as far as I can tell.  I'm *so glad* to see someone working on this again. :)  I'd still love to see us re-write this in python with a real parser (instead of regexps), but this it's good to see cleanup!
Comment 4 WebKit Commit Bot 2009-09-14 10:19:15 PDT
Comment on attachment 39533 [details]
Patch v1

Clearing flags on attachment: 39533

Committed r48356: <http://trac.webkit.org/changeset/48356>
Comment 5 WebKit Commit Bot 2009-09-14 10:19:18 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Cameron McCormack (:heycam) 2009-09-14 16:05:34 PDT
(In reply to comment #3)
> This is mostly a rubber stamp.

You're trusting. :-)

> But the change looks good as far as I can tell. I'm *so glad* to see someone
> working on this again. :)  I'd still love to see us re-write this in python
> with a real parser (instead of regexps), but this it's good to see cleanup!

Is there consensus that scripts should be rewritten in Python?  It seems most of the scripts in WebKitTools/Scripts/ are Perl.
Comment 7 Eric Seidel (no email) 2009-09-14 16:30:20 PDT
(In reply to comment #6)
> > But the change looks good as far as I can tell. I'm *so glad* to see someone
> > working on this again. :)  I'd still love to see us re-write this in python
> > with a real parser (instead of regexps), but this it's good to see cleanup!
> 
> Is there consensus that scripts should be rewritten in Python?  It seems most
> of the scripts in WebKitTools/Scripts/ are Perl.

No. :)  I don't think there is consensus about language choice.  There is consensus that these scripts need love however.

Most (all?) of the new scripting in WebKit has been done in python.  But that's because much of the recent scripting has come from me or Googlers where python very much the standard language.