Skip to content

Commit f2c78f8

Browse files
committed
Mark all unexpected EOFs as parse errors. Fixes #132.
1 parent 9d268dd commit f2c78f8

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

css-syntax/Overview.bs

+26-6
Original file line numberDiff line numberDiff line change
@@ -1244,8 +1244,12 @@ Consume a string token</h4>
12441244

12451245
<dl>
12461246
<dt><var>ending code point</var>
1247+
<dd>
1248+
Return the <<string-token>>.
1249+
12471250
<dt>EOF
12481251
<dd>
1252+
This is a <a>parse error</a>.
12491253
Return the <<string-token>>.
12501254

12511255
<dt><a>newline</a>
@@ -1257,6 +1261,7 @@ Consume a string token</h4>
12571261
<dt>U+005C REVERSE SOLIDUS (\)
12581262
<dd>
12591263
If the <a>next input code point</a> is EOF,
1264+
this is a <a>parse error</a>;
12601265
do nothing.
12611266

12621267
Otherwise,
@@ -1291,22 +1296,27 @@ Consume a url token</h4>
12911296

12921297
<li>
12931298
If the <a>next input code point</a> is EOF,
1294-
return the <<url-token>>.
1299+
this is a <a>parse error</a>.
1300+
Return the <<url-token>>.
12951301

12961302
<li>
12971303
Repeatedly consume the <a>next input code point</a> from the stream:
12981304

12991305
<dl>
13001306
<dt>U+0029 RIGHT PARENTHESIS ())
1301-
<dt>EOF
13021307
<dd>
13031308
Return the <<url-token>>.
13041309

1310+
<dt>EOF
1311+
This is a <a>parse error</a>.
1312+
Return the <<url-token>>.
1313+
13051314
<dt><a>whitespace</a>
13061315
<dd>
13071316
Consume as much <a>whitespace</a> as possible.
13081317
If the <a>next input code point</a> is U+0029 RIGHT PARENTHESIS ()) or EOF,
1309-
consume it and return the <<url-token>>;
1318+
consume it and return the <<url-token>>
1319+
(if EOF was encountered, this is a <a>parse error</a>);
13101320
otherwise,
13111321
<a>consume the remnants of a bad url</a>,
13121322
create a <<bad-url-token>>,
@@ -1370,6 +1380,7 @@ Consume an escaped code point</h4>
13701380

13711381
<dt>EOF code point
13721382
<dd>
1383+
This is a <a>parse error</a>.
13731384
Return U+FFFD REPLACEMENT CHARACTER (�).
13741385

13751386
<dt>anything else
@@ -2351,10 +2362,13 @@ Consume an at-rule</h4>
23512362

23522363
<dl>
23532364
<dt><<semicolon-token>>
2354-
<dt><<EOF-token>>
23552365
<dd>
23562366
Return the at-rule.
23572367

2368+
<dt><<EOF-token>>
2369+
This is a <a>parse error</a>.
2370+
Return the at-rule.
2371+
23582372
<dt><a href="#tokendef-open-curly">&lt;{-token></a>
23592373
<dd>
23602374
<a>Consume a simple block</a>
@@ -2531,11 +2545,14 @@ Consume a simple block</h4>
25312545
Repeatedly consume the <a>next input token</a> and process it as follows:
25322546

25332547
<dl>
2534-
<dt><<EOF-token>>
25352548
<dt><a>ending token</a>
25362549
<dd>
25372550
Return the block.
25382551

2552+
<dt><<EOF-token>>
2553+
This is a <a>parse error</a>.
2554+
Return the block.
2555+
25392556
<dt>anything else
25402557
<dd>
25412558
<a>Reconsume the current input token</a>.
@@ -2557,11 +2574,14 @@ Consume a function</h4>
25572574
Repeatedly consume the <a>next input token</a> and process it as follows:
25582575

25592576
<dl>
2560-
<dt><<EOF-token>>
25612577
<dt><a href="#tokendef-close-paren">&lt;)-token></a>
25622578
<dd>
25632579
Return the function.
25642580

2581+
<dt><<EOF-token>>
2582+
This is a <a>parse error</a>.
2583+
Return the function.
2584+
25652585
<dt>anything else
25662586
<dd>
25672587
<a>Reconsume the current input token</a>.

0 commit comments

Comments
 (0)