Skip to content

Commit ad2bda7

Browse files
committed
[css-syntax] Handle comments more directly, to avoid naively recursing.
--HG-- extra : rebase_source : bdd79b001208356629b1d34cf088d91637d5918d
1 parent 5472fba commit ad2bda7

2 files changed

Lines changed: 88 additions & 76 deletions

File tree

css-syntax/Overview.bs

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,8 @@ Consume a token</h4>
883883
This section describes how to <dfn>consume a token</dfn> from a stream of <a>code points</a>.
884884
It will return a single token of any type.
885885

886+
<a>Consume comments</a>.
887+
886888
Consume the <a>next input code point</a>.
887889

888890
<dl>
@@ -1009,20 +1011,6 @@ Consume a token</h4>
10091011
return a <<delim-token>>
10101012
with its value set to the <a>current input code point</a>.
10111013

1012-
<dt>U+002F SOLIDUS (/)
1013-
<dd>
1014-
If the <a>next input code point</a> is U+002A ASTERISK (*),
1015-
consume it
1016-
and all following <a>code points</a> up to and including
1017-
the first U+002A ASTERISK (*) followed by a U+002F SOLIDUS (/),
1018-
or up to an EOF code point.
1019-
Then <a>consume a token</a>
1020-
and return it.
1021-
1022-
Otherwise,
1023-
return a <<delim-token>>
1024-
with its value set to the <a>current input code point</a>.
1025-
10261014
<dt>U+003A COLON (:)
10271015
<dd>
10281016
Return a <<colon-token>>.
@@ -1164,6 +1152,23 @@ Consume a token</h4>
11641152
</dl>
11651153

11661154

1155+
<h4 id="consume-comments">
1156+
Consume comments</h4>
1157+
1158+
This section describes how to <dfn>consume comments</dfn> from a stream of <a>code points</a>.
1159+
It returns nothing.
1160+
1161+
If the <a title="next input code point">next two input code point</a> are
1162+
U+002F SOLIDUS (/) followed by a U+002A ASTERISK (*),
1163+
consume them
1164+
and all following <a>code points</a> up to and including
1165+
the first U+002A ASTERISK (*) followed by a U+002F SOLIDUS (/),
1166+
or up to an EOF code point.
1167+
Return to the start of this step.
1168+
1169+
Otherwise,
1170+
return nothing.
1171+
11671172

11681173

11691174
<h4 id="consume-a-numeric-token">

0 commit comments

Comments
 (0)