You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -2429,56 +2431,57 @@ Consume a list of declarations</h4>
2429
2431
2430
2432
<dt><<at-keyword-token>>
2431
2433
<dd>
2434
+
<a>Reconsume the current input token</a>.
2432
2435
<a>Consume an at-rule</a>.
2433
2436
Append the returned rule to the list of declarations.
2434
2437
2435
2438
<dt><<ident-token>>
2436
2439
<dd>
2437
2440
Initialize a temporary list initially filled with the <a>current input token</a>.
2438
-
<a>Consume the next input token</a>.
2439
-
While the <a>current input token</a> is anything other than a <<semicolon-token>> or <<EOF-token>>,
2440
-
append it to the temporary list
2441
-
and <a>consume the next input token</a>.
2441
+
As long as the <a>next input token</a> is anything other than a <<semicolon-token>> or <<EOF-token>>,
2442
+
<a>consume the next input token</a> and append it to the temporary list.
2442
2443
<a>Consume a declaration</a> from the temporary list.
2443
2444
If anything was returned,
2444
2445
append it to the list of declarations.
2445
2446
2446
2447
<dt>anything else</dd>
2447
2448
<dd>
2448
2449
This is a <a>parse error</a>.
2449
-
Repeatedly <a>consume a component value</a>
2450
-
until it is a <<semicolon-token>> or <<EOF-token>>.
2450
+
<a>Reconsume the current input token</a>.
2451
+
As long as the <a>next input token</a> is anything other than a <<semicolon-token>> or <<EOF-token>>,
2452
+
<a>consume a component value</a>
2453
+
and throw away the returned value.
2451
2454
</dl>
2452
2455
2453
2456
2454
2457
<h4 id="consume-a-declaration">
2455
2458
Consume a declaration</h4>
2456
2459
2460
+
Note: This algorithm assumes that the <a>next input token</a> has already been checked to be an <<ident-token>>.
2461
+
2457
2462
To <dfn>consume a declaration</dfn>:
2458
2463
2464
+
<a>Consume the next input token</a>.
2459
2465
Create a new declaration
2460
2466
with its name set to the value of the <a>current input token</a>
2461
2467
and its value initially set to the empty list.
2462
2468
2463
2469
<ol>
2464
2470
<li>
2465
-
<a>Consume the next input token</a>.
2466
-
2467
-
<li>
2468
-
While the <a>current input token</a> is a <<whitespace-token>>,
2471
+
While the <a>next input token</a> is a <<whitespace-token>>,
2469
2472
<a>consume the next input token</a>.
2470
2473
2471
2474
<li>
2472
-
If the <a>current input token</a> is anything other than a <<colon-token>>,
2475
+
If the <a>next input token</a> is anything other than a <<colon-token>>,
2473
2476
this is a <a>parse error</a>.
2474
2477
Return nothing.
2475
2478
2476
2479
Otherwise, <a>consume the next input token</a>.
2477
2480
2478
2481
<li>
2479
-
While the <a>current input token</a> is anything other than an <<EOF-token>>,
2480
-
append it to the declaration's value
2481
-
and <a>consume the next input token</a>.
2482
+
As long as the <a>next input token</a> is anything other than an <<EOF-token>>,
2483
+
<a>consume a component value</a>
2484
+
and append it to the declaration's value.
2482
2485
2483
2486
<li>
2484
2487
If the last two non-<<whitespace-token>>s in the declaration's value are
@@ -2515,8 +2518,11 @@ Consume a component value</h4>
2515
2518
<h4 id="consume-a-simple-block">
2516
2519
Consume a simple block</h4>
2517
2520
2521
+
Note: This algorithm assumes that the <a>next input token</a> has already been checked to be an <a href="#tokendef-open-curly"><{-token></a>, <a href="#tokendef-open-square"><[-token></a>, or <a href="#tokendef-open-paren"><(-token></a>.
2522
+
2518
2523
To <dfn>consume a simple block</dfn>:
2519
2524
2525
+
<a>Consume the next input token</a>.
2520
2526
The <dfn>ending token</dfn> is the mirror variant of the <a>current input token</a>.
2521
2527
(E.g. if it was called with <a href="#tokendef-open-square"><[-token></a>, the <a>ending token</a> is <a href="#tokendef-close-square"><]-token></a>.)
2522
2528
@@ -2542,8 +2548,11 @@ Consume a simple block</h4>
2542
2548
<h4 id="consume-a-function">
2543
2549
Consume a function</h4>
2544
2550
2551
+
Note: This algorithm assumes that the <a>next input token</a> has already been checked to be a <<function-token>>.
2552
+
2545
2553
To <dfn>consume a function</dfn>:
2546
2554
2555
+
<a>Consume the next input token</a>.
2547
2556
Create a function with a name equal to the value of the <a>current input token</a>,
2548
2557
and with a value which is initially an empty list.
if the <adata-link-type=dfnhref=#next-input-tokentitle="next input token">next input token</a> is an <aclass="production css-code" data-link-type=typehref=#typedef-at-keyword-tokentitle="<at-keyword-token>"><at-keyword-token></a>,
3680
-
consume it
3681
-
and <adata-link-type=dfnhref=#consume-an-at-rule0title="consume an at-rule">consume an at-rule</a>,
3680
+
<adata-link-type=dfnhref=#consume-an-at-rule0title="consume an at-rule">consume an at-rule</a>,
Initialize a temporary list initially filled with the <adata-link-type=dfnhref=#current-input-tokentitle="current input token">current input token</a>.
3951
-
<adata-link-type=dfnhref=#consume-the-next-input-tokentitle="consume the next input token">Consume the next input token</a>.
3952
-
While the <adata-link-type=dfnhref=#current-input-tokentitle="current input token">current input token</a> is anything other than a <aclass="production css-code" data-link-type=typehref=#typedef-semicolon-tokentitle="<semicolon-token>"><semicolon-token></a> or <aclass="production css-code" data-link-type=typehref=#typedef-eof-tokentitle="<eof-token>"><EOF-token></a>,
3953
-
append it to the temporary list
3954
-
and <adata-link-type=dfnhref=#consume-the-next-input-tokentitle="consume the next input token">consume the next input token</a>.
3954
+
As long as the <adata-link-type=dfnhref=#next-input-tokentitle="next input token">next input token</a> is anything other than a <aclass="production css-code" data-link-type=typehref=#typedef-semicolon-tokentitle="<semicolon-token>"><semicolon-token></a> or <aclass="production css-code" data-link-type=typehref=#typedef-eof-tokentitle="<eof-token>"><EOF-token></a>,
3955
+
<adata-link-type=dfnhref=#consume-the-next-input-tokentitle="consume the next input token">consume the next input token</a> and append it to the temporary list.
3955
3956
<adata-link-type=dfnhref=#consume-a-declaration0title="consume a declaration">Consume a declaration</a> from the temporary list.
3956
3957
If anything was returned,
3957
3958
append it to the list of declarations.
3958
3959
3959
3960
<dt>anything else
3960
3961
<dd>
3961
3962
This is a <adata-link-type=dfnhref=#parse-errortitle="parse error">parse error</a>.
3962
-
Repeatedly <adata-link-type=dfnhref=#consume-a-component-value0title="consume a component value">consume a component value</a>
3963
-
until it is a <aclass="production css-code" data-link-type=typehref=#typedef-semicolon-tokentitle="<semicolon-token>"><semicolon-token></a> or <aclass="production css-code" data-link-type=typehref=#typedef-eof-tokentitle="<eof-token>"><EOF-token></a>.
3963
+
<adata-link-type=dfnhref=#reconsume-the-current-input-tokentitle="reconsume the current input token">Reconsume the current input token</a>.
3964
+
As long as the <adata-link-type=dfnhref=#next-input-tokentitle="next input token">next input token</a> is anything other than a <aclass="production css-code" data-link-type=typehref=#typedef-semicolon-tokentitle="<semicolon-token>"><semicolon-token></a> or <aclass="production css-code" data-link-type=typehref=#typedef-eof-tokentitle="<eof-token>"><EOF-token></a>,
3965
+
<adata-link-type=dfnhref=#consume-a-component-value0title="consume a component value">consume a component value</a>
Consume a declaration</span><aclass=self-linkhref=#consume-a-declaration></a></h4>
3969
3972
3973
+
<pclass=note> Note: This algorithm assumes that the <adata-link-type=dfnhref=#next-input-tokentitle="next input token">next input token</a> has already been checked to be an <aclass="production css-code" data-link-type=typehref=#typedef-ident-tokentitle="<ident-token>"><ident-token></a>.
3974
+
3970
3975
<p> To <dfndata-dfn-type=dfndata-noexport="" id=consume-a-declaration0>consume a declaration<aclass=self-linkhref=#consume-a-declaration0></a></dfn>:
3971
3976
3972
-
<p> Create a new declaration
3977
+
<p><adata-link-type=dfnhref=#consume-the-next-input-tokentitle="consume the next input token">Consume the next input token</a>.
3978
+
Create a new declaration
3973
3979
with its name set to the value of the <adata-link-type=dfnhref=#current-input-tokentitle="current input token">current input token</a>
3974
3980
and its value initially set to the empty list.
3975
3981
3976
3982
<ol>
3977
3983
<li>
3978
-
<adata-link-type=dfnhref=#consume-the-next-input-tokentitle="consume the next input token">Consume the next input token</a>.
3979
-
3980
-
<li>
3981
-
While the <adata-link-type=dfnhref=#current-input-tokentitle="current input token">current input token</a> is a <aclass="production css-code" data-link-type=typehref=#typedef-whitespace-tokentitle="<whitespace-token>"><whitespace-token></a>,
3984
+
While the <adata-link-type=dfnhref=#next-input-tokentitle="next input token">next input token</a> is a <aclass="production css-code" data-link-type=typehref=#typedef-whitespace-tokentitle="<whitespace-token>"><whitespace-token></a>,
3982
3985
<adata-link-type=dfnhref=#consume-the-next-input-tokentitle="consume the next input token">consume the next input token</a>.
3983
3986
3984
3987
<li>
3985
-
If the <adata-link-type=dfnhref=#current-input-tokentitle="current input token">current input token</a> is anything other than a <aclass="production css-code" data-link-type=typehref=#typedef-colon-tokentitle="<colon-token>"><colon-token></a>,
3988
+
If the <adata-link-type=dfnhref=#next-input-tokentitle="next input token">next input token</a> is anything other than a <aclass="production css-code" data-link-type=typehref=#typedef-colon-tokentitle="<colon-token>"><colon-token></a>,
3986
3989
this is a <adata-link-type=dfnhref=#parse-errortitle="parse error">parse error</a>.
3987
3990
Return nothing.
3988
3991
3989
3992
<p> Otherwise, <adata-link-type=dfnhref=#consume-the-next-input-tokentitle="consume the next input token">consume the next input token</a>.
3990
3993
3991
3994
<li>
3992
-
While the <adata-link-type=dfnhref=#current-input-tokentitle="current input token">current input token</a> is anything other than an <aclass="production css-code" data-link-type=typehref=#typedef-eof-tokentitle="<eof-token>"><EOF-token></a>,
3993
-
append it to the declaration’s value
3994
-
and <adata-link-type=dfnhref=#consume-the-next-input-tokentitle="consume the next input token">consume the next input token</a>.
3995
+
As long as the <adata-link-type=dfnhref=#next-input-tokentitle="next input token">next input token</a> is anything other than an <aclass="production css-code" data-link-type=typehref=#typedef-eof-tokentitle="<eof-token>"><EOF-token></a>,
3996
+
<adata-link-type=dfnhref=#consume-a-component-value0title="consume a component value">consume a component value</a>
3997
+
and append it to the declaration’s value.
3995
3998
3996
3999
<li>
3997
4000
If the last two non-<aclass="production css-code" data-link-type=typehref=#typedef-whitespace-tokentitle="<whitespace-token>"><whitespace-token></a>s in the declaration’s value are
Consume a simple block</span><aclass=self-linkhref=#consume-a-simple-block></a></h4>
4030
4033
4034
+
<pclass=note> Note: This algorithm assumes that the <adata-link-type=dfnhref=#next-input-tokentitle="next input token">next input token</a> has already been checked to be an <ahref=#tokendef-open-curly><{-token></a>, <ahref=#tokendef-open-square><[-token></a>, or <ahref=#tokendef-open-paren><(-token></a>.
4035
+
4031
4036
<p> To <dfndata-dfn-type=dfndata-noexport="" id=consume-a-simple-block0>consume a simple block<aclass=self-linkhref=#consume-a-simple-block0></a></dfn>:
4032
4037
4033
-
<p> The <dfndata-dfn-type=dfndata-noexport="" id=ending-token>ending token<aclass=self-linkhref=#ending-token></a></dfn> is the mirror variant of the <adata-link-type=dfnhref=#current-input-tokentitle="current input token">current input token</a>.
4038
+
<p><adata-link-type=dfnhref=#consume-the-next-input-tokentitle="consume the next input token">Consume the next input token</a>.
4039
+
The <dfndata-dfn-type=dfndata-noexport="" id=ending-token>ending token<aclass=self-linkhref=#ending-token></a></dfn> is the mirror variant of the <adata-link-type=dfnhref=#current-input-tokentitle="current input token">current input token</a>.
4034
4040
(E.g. if it was called with <ahref=#tokendef-open-square><[-token></a>, the <adata-link-type=dfnhref=#ending-tokentitle="ending token">ending token</a> is <ahref=#tokendef-close-square><]-token></a>.)
4035
4041
4036
4042
<p> Create a <adata-link-type=dfnhref=#simple-blocktitle="simple block">simple block</a> with its associated token set to the <adata-link-type=dfnhref=#current-input-tokentitle="current input token">current input token</a>
Consume a function</span><aclass=self-linkhref=#consume-a-function></a></h4>
4057
4063
4064
+
<pclass=note> Note: This algorithm assumes that the <adata-link-type=dfnhref=#next-input-tokentitle="next input token">next input token</a> has already been checked to be a <aclass="production css-code" data-link-type=typehref=#typedef-function-tokentitle="<function-token>"><function-token></a>.
4065
+
4058
4066
<p> To <dfndata-dfn-type=dfndata-noexport="" id=consume-a-function0>consume a function<aclass=self-linkhref=#consume-a-function0></a></dfn>:
4059
4067
4060
-
<p> Create a function with a name equal to the value of the <adata-link-type=dfnhref=#current-input-tokentitle="current input token">current input token</a>,
4068
+
<p><adata-link-type=dfnhref=#consume-the-next-input-tokentitle="consume the next input token">Consume the next input token</a>.
4069
+
Create a function with a name equal to the value of the <adata-link-type=dfnhref=#current-input-tokentitle="current input token">current input token</a>,
4061
4070
and with a value which is initially an empty list.
4062
4071
4063
4072
<p> Repeatedly consume the <adata-link-type=dfnhref=#next-input-tokentitle="next input token">next input token</a> and process it as follows:
0 commit comments