Bug 97896 - YYDEBUG doesn't print token values
Summary: YYDEBUG doesn't print token values
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Glenn Adams
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-28 05:12 PDT by Glenn Adams
Modified: 2012-10-01 14:31 PDT (History)
7 users (show)

See Also:


Attachments
Patch (1.71 KB, patch)
2012-09-28 05:21 PDT, Glenn Adams
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Glenn Adams 2012-09-28 05:12:54 PDT
When debugging CSS lexer/parser with YYDEBUG set to 1, token values are not output because YYPRINT macro is a NO-OP.
Comment 1 Glenn Adams 2012-09-28 05:21:47 PDT
Created attachment 166222 [details]
Patch
Comment 2 Simon Fraser (smfr) 2012-09-29 22:03:38 PDT
Comment on attachment 166222 [details]
Patch

Does this have any behavior or performance implications?
Comment 3 Glenn Adams 2012-09-29 22:10:57 PDT
(In reply to comment #2)
> (From update of attachment 166222 [details])
> Does this have any behavior or performance implications?

no; YYDEBUG is defined as 0 in CSSGrammar.y and CSSParser.cpp at present; in order to use YYDEBUG feature, e.g., for special debugging, one has to explicitly change the setting of YYDEBUG to 1 in these two files; if one does define as 1, then normal YYDEBUG functions work as expected except that token values aren't printed; this patch simply enables output of token values when one sets YYDEBUG to 1;
Comment 4 WebKit Review Bot 2012-10-01 12:09:16 PDT
Comment on attachment 166222 [details]
Patch

Clearing flags on attachment: 166222

Committed r130063: <http://trac.webkit.org/changeset/130063>
Comment 5 WebKit Review Bot 2012-10-01 12:09:20 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Darin Adler 2012-10-01 14:31:23 PDT
Comment on attachment 166222 [details]
Patch

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

> Source/WebCore/css/CSSGrammar.y:1744
> +        YYFPRINTF(yyoutput, "%s", ((String)yyvalue.string).utf8().data());

I suggest function-call-style casting rather than C-style casting. String(yyvalue.string).utf8().data().