Skip to content

Commit 3fa5b2f

Browse files
committed
[css-syntax] More algo tweaks, including making 'consume a component value' start with a token consumption.
1 parent 65c3aa3 commit 3fa5b2f

2 files changed

Lines changed: 30 additions & 14 deletions

File tree

css-syntax/Overview.html

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,7 +2015,8 @@ <h4 id="parse-a-component-value" data-level="5.3.6"><span class="secno">5.3.6 </
20152015
return a syntax error.
20162016

20172017
</li><li>
2018-
<a data-autolink="link" href="#consume-a-component-value0">Consume a component value</a>.
2018+
<a data-autolink="link">Reconsume the current input token.
2019+
</a><a data-autolink="link" href="#consume-a-component-value0">Consume a component value</a>.
20192020
If nothing is returned,
20202021
return a syntax error.
20212022

@@ -2134,7 +2135,8 @@ <h4 id="consume-an-at-rule" data-level="5.4.2"><span class="secno">5.4.2 </span>
21342135

21352136
</dd><dt>anything else
21362137
</dt><dd>
2137-
<a data-autolink="link" href="#consume-a-component-value0">Consume a component value</a>.
2138+
<a data-autolink="link">Reconsume the current input token.
2139+
</a><a data-autolink="link" href="#consume-a-component-value0">Consume a component value</a>.
21382140
Append the returned value to the at-rule's prelude.
21392141
</dd></dl>
21402142

@@ -2171,7 +2173,8 @@ <h4 id="consume-a-qualified-rule" data-level="5.4.3"><span class="secno">5.4.3 <
21712173

21722174
</dd><dt>anything else
21732175
</dt><dd>
2174-
<a data-autolink="link" href="#consume-a-component-value0">Consume a component value</a>.
2176+
<a data-autolink="link">Reconsume the current input token.
2177+
</a><a data-autolink="link" href="#consume-a-component-value0">Consume a component value</a>.
21752178
Append the returned value to the qualified rule's prelude.
21762179
</dd></dl>
21772180

@@ -2201,17 +2204,18 @@ <h4 id="consume-a-list-of-declarations" data-level="5.4.4"><span class="secno">5
22012204
</dd><dt>&#9001;ident&#9002;
22022205
</dt><dd>
22032206
Initialize a temporary list initially filled with the <a data-autolink="link" href="#current-input-token">current input token</a>.
2204-
Repeatedly <a data-autolink="link" href="#consume-a-component-value0">consume a component value</a> from the <a data-autolink="link" href="#next-input-token">next input token</a>
2205-
until a &#9001;semicolon&#9002; or &#9001;EOF&#9002; is returned,
2206-
appending all of the returned values up to that point to the temporary list.
2207-
<a data-autolink="link" href="#consume-a-declaration0">Consume a declaration</a> from the temporary list.
2207+
<a data-autolink="link">Consume the next input token.
2208+
While the <a data-autolink="link" href="#current-input-token">current input token</a> is anything but a &#9001;semicolon&#9002; or &#9001;EOF&#9002;,
2209+
append it to the temporary list
2210+
and <a data-autolink="link" href="#consume-the-next-input-token">consume the next input token</a>.
2211+
</a><a data-autolink="link" href="#consume-a-declaration0">Consume a declaration</a> from the temporary list.
22082212
If anything was returned,
22092213
append it to the list of declarations.
22102214

22112215
</dd><dt>anything else
22122216
</dt><dd>
22132217
This is a <a data-autolink="link" href="#parse-errors">parse error</a>.
2214-
Repeatedly <a data-autolink="link" href="#consume-a-component-value0">consume a component value</a> from the <a data-autolink="link" href="#next-input-token">next input token</a>
2218+
Repeatedly <a data-autolink="link" href="#consume-a-component-value0">consume a component value</a>
22152219
until it is a &#9001;semicolon&#9002; or &#9001;EOF&#9002;.
22162220
</dd></dl>
22172221

@@ -2260,6 +2264,8 @@ <h4 id="consume-a-component-value" data-level="5.4.6"><span class="secno">5.4.6
22602264

22612265
<p> This section describes how to <a data-autolink="link" href="#consume-a-component-value0">consume a component value</a>.
22622266

2267+
</p><p> <a data-autolink="link" href="#consume-the-next-input-token">Consume the next input token</a>.
2268+
22632269
</p><p> If the <a data-autolink="link" href="#current-input-token">current input token</a>
22642270
is a &#9001;{&#9002;, &#9001;[&#9002;, or &#9001;(&#9002;,
22652271
<a data-autolink="link" href="#consume-a-simple-block0">consume a simple block</a>
@@ -2294,7 +2300,8 @@ <h4 id="consume-a-component-value" data-level="5.4.6"><span class="secno">5.4.6
22942300

22952301
</dd><dt>anything else
22962302
</dt><dd>
2297-
<a data-autolink="link" href="#consume-a-component-value0">Consume a component value</a>
2303+
<a data-autolink="link">Reconsume the current input token.
2304+
</a><a data-autolink="link" href="#consume-a-component-value0">Consume a component value</a>
22982305
and append it to the value of the block.
22992306
</dd></dl>
23002307

@@ -2317,7 +2324,8 @@ <h4 id="consume-a-function" data-level="5.4.8"><span class="secno">5.4.8 </span>
23172324

23182325
</dd><dt>anything else
23192326
</dt><dd>
2320-
<a data-autolink="link" href="#consume-a-component-value0">Consume a component value</a>
2327+
<a data-autolink="link">Reconsume the current input token.
2328+
</a><a data-autolink="link" href="#consume-a-component-value0">Consume a component value</a>
23212329
and append the returned value
23222330
to the function's value.
23232331
</dd></dl>

css-syntax/Overview.src.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,6 +1902,7 @@ <h4>
19021902
return a syntax error.
19031903

19041904
<li>
1905+
<a>Reconsume the current input token</i>.
19051906
<a>Consume a component value</a>.
19061907
If nothing is returned,
19071908
return a syntax error.
@@ -2021,6 +2022,7 @@ <h4>
20212022

20222023
<dt>anything else
20232024
<dd>
2025+
<a>Reconsume the current input token</i>.
20242026
<a>Consume a component value</a>.
20252027
Append the returned value to the at-rule's prelude.
20262028
</dl>
@@ -2058,6 +2060,7 @@ <h4>
20582060

20592061
<dt>anything else
20602062
<dd>
2063+
<a>Reconsume the current input token</i>.
20612064
<a>Consume a component value</a>.
20622065
Append the returned value to the qualified rule's prelude.
20632066
</dl>
@@ -2088,17 +2091,18 @@ <h4>
20882091
<dt>〈ident〉
20892092
<dd>
20902093
Initialize a temporary list initially filled with the <a>current input token</a>.
2091-
Repeatedly <a>consume a component value</a> from the <a>next input token</a>
2092-
until a 〈semicolon〉 or 〈EOF〉 is returned,
2093-
appending all of the returned values up to that point to the temporary list.
2094+
<a>Consume the next input token</i>.
2095+
While the <i>current input token</i> is anything but a 〈semicolon〉 or 〈EOF〉,
2096+
append it to the temporary list
2097+
and <i>consume the next input token</i>.
20942098
<a>Consume a declaration</a> from the temporary list.
20952099
If anything was returned,
20962100
append it to the list of declarations.
20972101

20982102
<dt>anything else</dd>
20992103
<dd>
21002104
This is a <a>parse error</a>.
2101-
Repeatedly <a>consume a component value</a> from the <a>next input token</a>
2105+
Repeatedly <a>consume a component value</a>
21022106
until it is a 〈semicolon〉 or 〈EOF〉.
21032107
</dl>
21042108

@@ -2147,6 +2151,8 @@ <h4>
21472151

21482152
This section describes how to <a>consume a component value</a>.
21492153

2154+
<i>Consume the next input token</i>.
2155+
21502156
If the <a>current input token</a>
21512157
is a 〈{〉, 〈[〉, or 〈(〉,
21522158
<a>consume a simple block</a>
@@ -2181,6 +2187,7 @@ <h4>
21812187

21822188
<dt>anything else
21832189
<dd>
2190+
<a>Reconsume the current input token</i>.
21842191
<a>Consume a component value</a>
21852192
and append it to the value of the block.
21862193
</dl>
@@ -2204,6 +2211,7 @@ <h4>
22042211

22052212
<dt>anything else
22062213
<dd>
2214+
<a>Reconsume the current input token</i>.
22072215
<a>Consume a component value</a>
22082216
and append the returned value
22092217
to the function's value.

0 commit comments

Comments
 (0)