Skip to content

Commit 18e7feb

Browse files
committed
Darn, have to revert the last change to keep the tokenizer stateless. Also, add parse errors to badstrings that end on EOF.
1 parent ade9574 commit 18e7feb

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

css3-syntax/parsing.html

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,19 @@ <h4>
181181

182182
<dt>U+002B PLUS SIGN (+)
183183
<dd>
184-
Emit a delim token
185-
with its value set to U+002B PLUS SIGN (+).
186-
Switch to the <i>number state</i>.
184+
If the <i>next input character</i> is
185+
a <i>digit</i>,
186+
or the <i title="next input character">next 2 input characters</i> are
187+
U+002D HYPHEN-MINUS (-)
188+
followed by a <i>digit</i>,
189+
switch to the <i>number state</i>.
190+
Set the "starts with plus" flag on the next number or dimension token you emit.
191+
192+
<p>
193+
Otherwise,
194+
emit a delim token
195+
with its value set to U+002B PLUS SIGN (+).
196+
Remain in this state</i>.
187197

188198
<dt>U+002D HYPHEN-MINUS (-)
189199
<dd>
@@ -220,7 +230,7 @@ <h4>
220230
<p>
221231
Otherwise,
222232
emit a delim token
223-
with its value set to U+002D HYPHEN-MINUS.
233+
with its value set to U+002D HYPHEN-MINUS (-).
224234
Remain in this state.
225235

226236
<dt>U+002E FULL STOP (.)
@@ -266,6 +276,7 @@ <h4>
266276
(!--),
267277
consume them
268278
and emit a cdo token.
279+
Remain in this state.
269280

270281
<p>
271282
Otherwise,
@@ -311,6 +322,7 @@ <h4>
311322
If the <i>next input character</i> is
312323
U+003D EQUALS SIGN (=),
313324
emit a dash-match token.
325+
Remain in this state.
314326

315327
<p>
316328
Otherwise,
@@ -328,6 +340,7 @@ <h4>
328340
If the <i>next input character</i> is
329341
U+003D EQUALS SIGN (=),
330342
emit an includes-match token.
343+
Remain in this state.
331344

332345
<p>
333346
Otherwise,
@@ -398,6 +411,7 @@ <h4>
398411

399412
<dt>EOF
400413
<dd>
414+
This is a <i>parse error</i>.
401415
Emit the string token.
402416
Switch to the <i>data state</i>.
403417
Reconsume the <i>current input character</i>.
@@ -457,6 +471,7 @@ <h4>
457471

458472
<dt>EOF
459473
<dd>
474+
This is a <i>parse error</i>.
460475
Emit the string token.
461476
Switch to the <i>data state</i>.
462477
Reconsume the <i>current input character</i>.

0 commit comments

Comments
 (0)