Skip to content

Commit

Permalink
Editorial: use more 'reconsume' in comment states
Browse files Browse the repository at this point in the history
This makes it easier to add new states to introduce a parse error
for <!-- <!-- -->.
  • Loading branch information
zcorpan committed May 31, 2016
1 parent a0326a1 commit 2568463
Showing 1 changed file with 13 additions and 41 deletions.
54 changes: 13 additions & 41 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -101160,20 +101160,11 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
<dt>U+002D HYPHEN-MINUS (-)</dt>
<dd>Switch to the <span>comment start dash state</span>.</dd>

<dt>U+0000 NULL</dt>
<dd><span>Parse error</span>. Append a U+FFFD REPLACEMENT CHARACTER character to the comment
token's data. Switch to the <span>comment state</span>.</dd>

<dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
<dd><span>Parse error</span>. Switch to the <span>data state</span>. Emit the comment token.</dd>

<dt>EOF</dt>
<dd><span>Parse error</span>. Emit the comment token. <span>Reconsume</span> in the <span>data
state</span>.</dd>

<dt>Anything else</dt>
<dd>Append the <span>current input character</span> to the comment token's data. Switch to the
<span>comment state</span>.</dd>
<dd><span>Reconsume</span> in the <span>comment state</span>.</dd>

</dl>

Expand All @@ -101187,10 +101178,6 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
<dt>U+002D HYPHEN-MINUS (-)</dt>
<dd>Switch to the <span>comment end state</span></dd>

<dt>U+0000 NULL</dt>
<dd><span>Parse error</span>. Append a U+002D HYPHEN-MINUS character (-) and a U+FFFD REPLACEMENT
CHARACTER character to the comment token's data. Switch to the <span>comment state</span>.</dd>

<dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
<dd><span>Parse error</span>. Switch to the <span>data state</span>. Emit the comment token.</dd>

Expand All @@ -101199,8 +101186,8 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
state</span>.</dd>

<dt>Anything else</dt>
<dd>Append a U+002D HYPHEN-MINUS character (-) and the <span>current input character</span> to
the comment token's data. Switch to the <span>comment state</span>.</dd>
<dd>Append a U+002D HYPHEN-MINUS character (-) to the comment token's data.
<span>Reconsume</span> in the <span>comment state</span>.</dd>

</dl>

Expand All @@ -101219,8 +101206,8 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
token's data.</dd>

<dt>EOF</dt>
<dd><span>Parse error</span>. Switch to the <span>data state</span>. Emit the comment token.
Reconsume the EOF character.</dd>
<dd><span>Parse error</span>. Emit the comment token. <span>Reconsume</span> in the <span>data
state</span>.</dd>

<dt>Anything else</dt>
<dd>Append the <span>current input character</span> to the comment token's data.</dd>
Expand All @@ -101237,17 +101224,13 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
<dt>U+002D HYPHEN-MINUS (-)</dt>
<dd>Switch to the <span>comment end state</span></dd>

<dt>U+0000 NULL</dt>
<dd><span>Parse error</span>. Append a U+002D HYPHEN-MINUS character (-) and a U+FFFD REPLACEMENT
CHARACTER character to the comment token's data. Switch to the <span>comment state</span>.</dd>

<dt>EOF</dt>
<dd><span>Parse error</span>. Switch to the <span>data state</span>. Emit the comment token.
Reconsume the EOF character.</dd>
<dd><span>Parse error</span>. Emit the comment token. <span>Reconsume</span> in the <span>data
state</span>.</dd>

<dt>Anything else</dt>
<dd>Append a U+002D HYPHEN-MINUS character (-) and the <span>current input character</span> to
the comment token's data. Switch to the <span>comment state</span>.</dd>
<dd>Append a U+002D HYPHEN-MINUS character (-) to the comment token's data.
<span>Reconsume</span> in the <span>comment state</span>.</dd>

</dl>

Expand All @@ -101261,11 +101244,6 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
<dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
<dd>Switch to the <span>data state</span>. Emit the comment token.</dd>

<dt>U+0000 NULL</dt>
<dd><span>Parse error</span>. Append two U+002D HYPHEN-MINUS characters (-) and a U+FFFD
REPLACEMENT CHARACTER character to the comment token's data. Switch to the <span>comment
state</span>.</dd>

<dt>U+0021 EXCLAMATION MARK (!)</dt>
<dd>Switch to the <span>comment end bang state</span>.</dd>

Expand All @@ -101277,8 +101255,8 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
state</span>.</dd>

<dt>Anything else</dt>
<dd>Append two U+002D HYPHEN-MINUS characters (-) and the <span>current input character</span> to
the comment token's data. Switch to the <span>comment state</span>.</dd>
<dd>Append two U+002D HYPHEN-MINUS characters (-) to the comment token's data.
<span>Reconsume</span> in the <span>comment state</span>.</dd>

</dl>

Expand All @@ -101296,19 +101274,13 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
<dt>U+003E GREATER-THAN SIGN (&gt;)</dt>
<dd><span>Parse error</span>. Switch to the <span>data state</span>. Emit the comment token.</dd>

<dt>U+0000 NULL</dt>
<dd><span>Parse error</span>. Append two U+002D HYPHEN-MINUS characters (-), a U+0021 EXCLAMATION
MARK character (!), and a U+FFFD REPLACEMENT CHARACTER character to the comment token's data.
Switch to the <span>comment state</span>.</dd>

<dt>EOF</dt>
<dd><span>Parse error</span>. Emit the comment token. <span>Reconsume</span> in the <span>data
state</span>.</dd>

<dt>Anything else</dt>
<dd>Append two U+002D HYPHEN-MINUS characters (-), a U+0021 EXCLAMATION MARK character (!), and
the <span>current input character</span> to the comment token's data. Switch to the <span>comment
state</span>.</dd>
<dd>Append two U+002D HYPHEN-MINUS characters (-) and a U+0021 EXCLAMATION MARK character (!) to
the comment token's data. <span>Reconsume</span> in the <span>comment state</span>.</dd>

</dl>

Expand Down

0 comments on commit 2568463

Please sign in to comment.