No subject
Mon Jan 28 08:41:14 PST 2013
9948">r149948</a> by <serya at chromium.org>
Added "closing_parenthesis:" and "error_recovery:" to=
avoid code
duplication in a couple of error recovery rules. Some other rules
were also refactored which allows to reduce the the number of
shift/reduce conflicts by 2.
No new tests required as this is just a refactoring, no new
functionality added.
* css/CSSGrammar.y.in:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href=3D"#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeL=
og</a></li>
<li><a href=3D"#trunkSourceWebCorecssCSSGrammaryin">trunk/Source/WebCore/=
css/CSSGrammar.y.in</a></li>
</ul>
</div>
<div id=3D"patch">
<h3>Diff</h3>
<a id=3D"trunkSourceWebCoreChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (1508=
03 =3D> 150804)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/ChangeLog 2013-05-28 14:31:=
11 UTC (rev 150803)
+++ trunk/Source/WebCore/ChangeLog 2013-05-28 14:37:34 UTC (rev 150804)
</span><span class=3D"lines">@@ -1,5 +1,24 @@
</span><span class=3D"cx"> 2013-05-28 Sergio Villar Senin <svillar at i=
galia.com>
</span><span class=3D"cx">=20
</span><ins>+ Refactoring CSS grammar
+ https://bugs.webkit.org/show_bug.cgi?id=3D116679
+
+ Reviewed by Andreas Kling.
+
+ From Blink r149948 by <serya at chromium.org>
+
+ Added "closing_parenthesis:" and "error_recovery:=
" to avoid code
+ duplication in a couple of error recovery rules. Some other rule=
s
+ were also refactored which allows to reduce the the number of
+ shift/reduce conflicts by 2.
+
+ No new tests required as this is just a refactoring, no new
+ functionality added.
+
+ * css/CSSGrammar.y.in:
+
+2013-05-28 Sergio Villar Senin <svillar at igalia.com>
+
</ins><span class=3D"cx"> Invalid block doesn't make declaration =
invalid
</span><span class=3D"cx"> https://bugs.webkit.org/show_bug.cgi?i=
d=3D115709
</span><span class=3D"cx">=20
</span></span></pre></div>
<a id=3D"trunkSourceWebCorecssCSSGrammaryin"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGrammar.=
y.in (150803 =3D> 150804)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/css/CSSGrammar.y.in 2013-05=
-28 14:31:11 UTC (rev 150803)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in 2013-05-28 14:37:34 UTC (rev=
150804)
</span><span class=3D"lines">@@ -88,9 +88,9 @@
</span><span class=3D"cx"> %}
</span><span class=3D"cx">=20
</span><span class=3D"cx"> #if ENABLE_SHADOW_DOM
</span><del>-%expect 65
</del><ins>+%expect 63
</ins><span class=3D"cx"> #else
</span><del>-%expect 64
</del><ins>+%expect 62
</ins><span class=3D"cx"> #endif
</span><span class=3D"cx">=20
</span><span class=3D"cx"> %nonassoc LOWEST_PREC
</span><span class=3D"lines">@@ -428,6 +428,11 @@
</span><span class=3D"cx"> | %prec LOWEST_PREC TOKEN_EOF
</span><span class=3D"cx"> ;
</span><span class=3D"cx">=20
</span><ins>+closing_parenthesis:
+ ')'
+ | %prec LOWEST_PREC TOKEN_EOF
+ ;
+
</ins><span class=3D"cx"> charset:
</span><span class=3D"cx"> CHARSET_SYM maybe_space STRING maybe_space '=
;' {
</span><span class=3D"cx"> if (parser->m_styleSheet)
</span><span class=3D"lines">@@ -1561,11 +1566,9 @@
</span><span class=3D"cx"> ;
</span><span class=3D"cx">=20
</span><span class=3D"cx"> decl_list_recovery:
</span><del>- error error_location {
</del><ins>+ error error_location error_recovery {
</ins><span class=3D"cx"> parser->syntaxError($2, CSSParser::P=
ropertyDeclarationError);
</span><span class=3D"cx"> }
</span><del>- | decl_list_recovery invalid_block
- | decl_list_recovery error
</del><span class=3D"cx"> ;
</span><span class=3D"cx">=20
</span><span class=3D"cx"> declaration:
</span><span class=3D"lines">@@ -1618,11 +1621,9 @@
</span><span class=3D"cx"> ;
</span><span class=3D"cx">=20
</span><span class=3D"cx"> declaration_recovery:
</span><del>- error error_location {
</del><ins>+ error error_location error_recovery {
</ins><span class=3D"cx"> parser->syntaxError($2);
</span><span class=3D"cx"> }
</span><del>- | declaration_recovery invalid_block
- | declaration_recovery error
</del><span class=3D"cx"> ;
</span><span class=3D"cx">=20
</span><span class=3D"cx"> property:
</span><span class=3D"lines">@@ -1654,17 +1655,15 @@
</span><span class=3D"cx"> $$->addValue(parser->sinkFlo=
atingValue($3));
</span><span class=3D"cx"> }
</span><span class=3D"cx"> }
</span><del>- | expr invalid_block_list {
</del><ins>+ | expr expr_recovery {
</ins><span class=3D"cx"> $$ =3D 0;
</span><span class=3D"cx"> }
</span><del>- | expr invalid_block_list error {
- $$ =3D 0;
- }
- | expr error {
- $$ =3D 0;
- }
</del><span class=3D"cx"> ;
</span><span class=3D"cx">=20
</span><ins>+expr_recovery:
+ error error_location error_recovery
+ ;
+
</ins><span class=3D"cx"> operator:
</span><span class=3D"cx"> '/' maybe_space {
</span><span class=3D"cx"> $$ =3D '/';
</span><span class=3D"lines">@@ -1754,7 +1753,7 @@
</span><span class=3D"cx"> ;
</span><span class=3D"cx">=20
</span><span class=3D"cx"> function:
</span><del>- FUNCTION maybe_space expr ')' maybe_space {
</del><ins>+ FUNCTION maybe_space expr closing_parenthesis maybe_space=
{
</ins><span class=3D"cx"> CSSParserFunction* f =3D parser->cre=
ateFloatingFunction();
</span><span class=3D"cx"> f->name =3D $1;
</span><span class=3D"cx"> f->args =3D parser->sinkFloating=
ValueList($3);
</span><span class=3D"lines">@@ -1762,17 +1761,9 @@
</span><span class=3D"cx"> $$.unit =3D CSSParserValue::Function;
</span><span class=3D"cx"> $$.function =3D f;
</span><span class=3D"cx"> } |
</span><del>- FUNCTION maybe_space expr TOKEN_EOF {
</del><ins>+ FUNCTION maybe_space closing_parenthesis maybe_space {
</ins><span class=3D"cx"> CSSParserFunction* f =3D parser->cre=
ateFloatingFunction();
</span><span class=3D"cx"> f->name =3D $1;
</span><del>- f->args =3D parser->sinkFloatingValueList($3);
- $$.id =3D 0;
- $$.unit =3D CSSParserValue::Function;
- $$.function =3D f;
- } |
- FUNCTION maybe_space ')' maybe_space {
- CSSParserFunction* f =3D parser->createFloatingFunction();
- f->name =3D $1;
</del><span class=3D"cx"> CSSParserValueList* valueList =3D parse=
r->createFloatingValueList();
</span><span class=3D"cx"> f->args =3D parser->sinkFloating=
ValueList(valueList);
</span><span class=3D"cx"> $$.id =3D 0;
</span><span class=3D"lines">@@ -1788,7 +1779,7 @@
</span><span class=3D"cx"> $$.function =3D f;
</span><span class=3D"cx"> }
</span><span class=3D"cx"> ;
</span><del>-=20
</del><ins>+
</ins><span class=3D"cx"> calc_func_term:
</span><span class=3D"cx"> unary_term { $$ =3D $1; }
</span><span class=3D"cx"> | VARFUNCTION maybe_space IDENT ')' maybe_sp=
ace {
</span><span class=3D"lines">@@ -1980,5 +1971,11 @@
</span><span class=3D"cx"> }
</span><span class=3D"cx"> ;
</span><span class=3D"cx">=20
</span><ins>+error_recovery:
+ /* empty */
+ | error_recovery invalid_block
+ | error_recovery error
+ ;
+
</ins><span class=3D"cx"> %%
</span><span class=3D"cx">=20
</span></span></pre>
</div>
</div>
</body>
</html>
More information about the webkit-changes
mailing list