Bug 83212 - [CSS] Make makevalues.pl and makeprop.pl ignore '#'s.
Summary: [CSS] Make makevalues.pl and makeprop.pl ignore '#'s.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Raphael Kubo da Costa (:rakuco)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-04 13:58 PDT by Raphael Kubo da Costa (:rakuco)
Modified: 2012-04-04 15:06 PDT (History)
8 users (show)

See Also:


Attachments
Patch (2.26 KB, patch)
2012-04-04 14:03 PDT, Raphael Kubo da Costa (:rakuco)
no flags Details | Formatted Diff | Diff
Patch for landing (2.27 KB, patch)
2012-04-04 15:04 PDT, Raphael Kubo da Costa (:rakuco)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raphael Kubo da Costa (:rakuco) 2012-04-04 13:58:43 PDT
[CSS] Make makevalues.pl and makeprop.pl ignore '#'s.
Comment 1 Raphael Kubo da Costa (:rakuco) 2012-04-04 14:03:29 PDT
Created attachment 135673 [details]
Patch
Comment 2 Tony Chang 2012-04-04 14:21:21 PDT
By this point, haven't we already run the .in files through the preprocessor and the preprocessor already handled the lines beginning with # (e.g., #if/#endif).  What's an example of a line starting with # that makes it through the preprocessor?
Comment 3 Raphael Kubo da Costa (:rakuco) 2012-04-04 14:26:53 PDT
(In reply to comment #2)
> What's an example of a line starting with # that makes it through the preprocessor?

The ones produced by the preprocessor when -P is not passed to it:

# 1 "/home/rakuco/dev/webkit/WebKit/Source/WebCore/html/HTMLTagNames.in"
# 1 "<command-line>"
# 1 "/home/rakuco/dev/webkit/WebKit/Source/WebCore/html/HTMLTagNames.in"

etc
Comment 4 Raphael Kubo da Costa (:rakuco) 2012-04-04 14:38:42 PDT
Just in case I wasn't clear enough: this patch is a side-effect of my intentions to make the CMake-based ports work with GCC 4.7 without changing the parameters currently passed to the preprocessor. "-P" is always being passed to the preprocessor, but this breaks dom/make_names.pl due to GCC not outputting empty lines with "-P" anymore; if I switch to never passing "-P" (my aim), the CSS scripts currently break because of the additional lines output by the preprocessor.
Comment 5 Tony Chang 2012-04-04 14:43:54 PDT
I see, your plan is to remove -P in preprocessor.pm because -P causes you to lose empty lines which are needed by make_names.pl and InFilesParser.pm.  This wasn't clear to me in the ChangeLog description.

Would it be possible to have applyPreprocessor take a flag for whether it wants -P or not?  Or more generally, maybe applyPreprocessor can take an optional argument that is flags to pass to gcc.  If the argument is omitted, it adds "-E -P -x c++".
Comment 6 Raphael Kubo da Costa (:rakuco) 2012-04-04 14:46:44 PDT
(In reply to comment #5)
> I see, your plan is to remove -P in preprocessor.pm because -P causes you to lose empty lines which are needed by make_names.pl and InFilesParser.pm.  This wasn't clear to me in the ChangeLog description.
> 
> Would it be possible to have applyPreprocessor take a flag for whether it wants -P or not?  Or more generally, maybe applyPreprocessor can take an optional argument that is flags to pass to gcc.  If the argument is omitted, it adds "-E -P -x c++".

Actually, my plan is to remote -P from Source/cmake/OptionsCommon.cmake; the CMake-based ports always pass --preprocessor to the scripts, so the defaults aren't used.
Comment 7 Raphael Kubo da Costa (:rakuco) 2012-04-04 14:46:52 PDT
s/remote/remove/
Comment 8 Tony Chang 2012-04-04 14:56:03 PDT
Comment on attachment 135673 [details]
Patch

Ok, seems fine.  I would rewrite the ChangeLog to be what you said in comment #4.
Comment 9 Raphael Kubo da Costa (:rakuco) 2012-04-04 15:04:33 PDT
Created attachment 135692 [details]
Patch for landing
Comment 10 Raphael Kubo da Costa (:rakuco) 2012-04-04 15:06:51 PDT
Committed r113244: <http://trac.webkit.org/changeset/113244>