Title: [146451] trunk/Source/WebCore
- Revision
- 146451
- Author
- commit-qu...@webkit.org
- Date
- 2013-03-21 04:17:30 -0700 (Thu, 21 Mar 2013)
Log Message
Changing "#define YYDEBUG 0" to 1 causing compilation error
https://bugs.webkit.org/show_bug.cgi?id=111178
Patch by Sergey Ryazanov <se...@chromium.org> on 2013-03-21
Reviewed by Pavel Feldman.
Code that reference tokens can't be placed into CSSGrammar.yy.include because it's included before tokens defined.
YYDEBUG can't be used in CSSGrammar.yy.in because the #define is only defined in CSSGrammar.yy.include. This
change simplifies CSS debugging letting manipulate only #define YYDEBUG in CSSGrammar.yy.include and/or in CSSParser.cpp.
* css/CSSGrammar.y.in:
* css/CSSGrammar.y.includes:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (146450 => 146451)
--- trunk/Source/WebCore/ChangeLog 2013-03-21 10:40:25 UTC (rev 146450)
+++ trunk/Source/WebCore/ChangeLog 2013-03-21 11:17:30 UTC (rev 146451)
@@ -1,3 +1,17 @@
+2013-03-21 Sergey Ryazanov <se...@chromium.org>
+
+ Changing "#define YYDEBUG 0" to 1 causing compilation error
+ https://bugs.webkit.org/show_bug.cgi?id=111178
+
+ Reviewed by Pavel Feldman.
+
+ Code that reference tokens can't be placed into CSSGrammar.yy.include because it's included before tokens defined.
+ YYDEBUG can't be used in CSSGrammar.yy.in because the #define is only defined in CSSGrammar.yy.include. This
+ change simplifies CSS debugging letting manipulate only #define YYDEBUG in CSSGrammar.yy.include and/or in CSSParser.cpp.
+
+ * css/CSSGrammar.y.in:
+ * css/CSSGrammar.y.includes:
+
2013-03-21 Nate Chapin <jap...@chromium.org>
Merge MainResourceLoader into DocumentLoader
Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (146450 => 146451)
--- trunk/Source/WebCore/css/CSSGrammar.y.in 2013-03-21 10:40:25 UTC (rev 146450)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in 2013-03-21 11:17:30 UTC (rev 146451)
@@ -59,6 +59,31 @@
return 1;
}
+static inline bool isCSSTokenAString(int yytype)
+{
+ switch (yytype) {
+ case IDENT:
+ case STRING:
+ case NTH:
+ case HEX:
+ case IDSEL:
+ case DIMEN:
+ case INVALIDDIMEN:
+ case URI:
+ case FUNCTION:
+ case ANYFUNCTION:
+ case NOTFUNCTION:
+ case CALCFUNCTION:
+ case MINFUNCTION:
+ case MAXFUNCTION:
+ case VAR_DEFINITION:
+ case UNICODERANGE:
+ return true;
+ default:
+ return false;
+ }
+}
+
%}
#if ENABLE_SHADOW_DOM
Modified: trunk/Source/WebCore/css/CSSGrammar.y.includes (146450 => 146451)
--- trunk/Source/WebCore/css/CSSGrammar.y.includes 2013-03-21 10:40:25 UTC (rev 146450)
+++ trunk/Source/WebCore/css/CSSGrammar.y.includes 2013-03-21 11:17:30 UTC (rev 146451)
@@ -54,32 +54,7 @@
#define YYDEBUG 0
#if YYDEBUG > 0
-#define YYPRINT(File,Type,Value) print_token_value(File,Type,Value)
-static void print_token_value(FILE * yyoutput, int yytype, YYSTYPE const &yyvalue)
-{
- switch (yytype) {
- case IDENT:
- case STRING:
- case NTH:
- case HEX:
- case IDSEL:
- case DIMEN:
- case INVALIDDIMEN:
- case URI:
- case FUNCTION:
- case ANYFUNCTION:
- case NOTFUNCTION:
- case CALCFUNCTION:
- case MINFUNCTION:
- case MAXFUNCTION:
- case VAR_DEFINITION:
- case UNICODERANGE:
- YYFPRINTF(yyoutput, "%s", String(yyvalue.string).utf8().data());
- break;
- default:
- break;
- }
-}
+#define YYPRINT(File,Type,Value) if (isCSSTokenAString(Type)) YYFPRINTF(File, "%s", String((Value).string).utf8().data())
#endif
%}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes