Skip to content

Commit

Permalink
[cgowt] (2) Support <!--> and <!---> comment forms (non-conforming, a…
Browse files Browse the repository at this point in the history
…t least for now).

git-svn-id: http://svn.whatwg.org/webapps@924 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jun 19, 2007
1 parent 0fbc6b4 commit 19d82fc
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 10 deletions.
67 changes: 60 additions & 7 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -34227,8 +34227,8 @@ function receiver(e) {

<p>If the next two characters are both U+002D HYPHEN-MINUS (-)
characters, consume those two characters, create a comment token whose
data is the empty string, and switch to the <a href="#comment">comment
state</a>.</p>
data is the empty string, and switch to the <a href="#comment0">comment
start state</a>.</p>

<p>Otherwise if the next seven characters are a
<span>case-insensitive</span><!-- XXX xref, ascii only --> match for the
Expand All @@ -34239,6 +34239,59 @@ function receiver(e) {
href="#bogus">bogus comment state</a>. The next character that is
consumed, if any, is the first character that will be in the comment.</p>

<dt><dfn id=comment0>Comment start state</dfn>

<dd>
<p>Consume the <a href="#next-input">next input character</a>:</p>

<dl class=switch>
<dt>U+002D HYPHEN-MINUS (-)

<dd>Switch to the <a href="#comment1">comment start dash state</a>.

<dt>U+003E GREATER-THAN SIGN (&gt;)

<dd><a href="#parse">Parse error</a>. Emit the comment token. Switch to
the <a href="#data-state">data state</a>.

<dt>EOF

<dd><a href="#parse">Parse error</a>. Emit the comment token. Reconsume
the EOF character in the <a href="#data-state">data state</a>.

<dt>Anything else

<dd>Append the input character to the comment token's data. Switch to
the <a href="#comment">comment state</a>.
</dl>

<dt><dfn id=comment1>Comment start dash state</dfn>

<dd>
<p>Consume the <a href="#next-input">next input character</a>:</p>

<dl class=switch>
<dt>U+002D HYPHEN-MINUS (-)

<dd>Switch to the <a href="#comment3">comment end state</a>

<dt>U+003E GREATER-THAN SIGN (&gt;)

<dd><a href="#parse">Parse error</a>. Emit the comment token. Switch to
the <a href="#data-state">data state</a>.

<dt>EOF

<dd><a href="#parse">Parse error</a>. Emit the comment token. Reconsume
the EOF character in the <a href="#data-state">data state</a>.

<dt>Anything else

<dd>Append a U+002D HYPHEN-MINUS (-) character and the input character
to the comment token's data. Switch to the <a href="#comment">comment
state</a>.
</dl>

<dt><dfn id=comment>Comment state</dfn>

<dd>
Expand All @@ -34247,7 +34300,7 @@ function receiver(e) {
<dl class=switch>
<dt>U+002D HYPHEN-MINUS (-)

<dd>Switch to the <a href="#comment0">comment dash state</a>
<dd>Switch to the <a href="#comment2">comment end dash state</a>

<dt>EOF

Expand All @@ -34265,15 +34318,15 @@ function receiver(e) {
<a href="#comment">comment state</a>.
</dl>

<dt><dfn id=comment0>Comment dash state</dfn>
<dt><dfn id=comment2>Comment end dash state</dfn>

<dd>
<p>Consume the <a href="#next-input">next input character</a>:</p>

<dl class=switch>
<dt>U+002D HYPHEN-MINUS (-)

<dd>Switch to the <a href="#comment1">comment end state</a>
<dd>Switch to the <a href="#comment3">comment end state</a>

<dt>EOF

Expand All @@ -34292,7 +34345,7 @@ function receiver(e) {
state</a>.
</dl>

<dt><dfn id=comment1>Comment end state</dfn>
<dt><dfn id=comment3>Comment end state</dfn>

<dd>
<p>Consume the <a href="#next-input">next input character</a>:</p>
Expand All @@ -34307,7 +34360,7 @@ function receiver(e) {

<dd><a href="#parse">Parse error</a>. Append a U+002D HYPHEN-MINUS (-)
character to the comment token's data. Stay in the <a
href="#comment1">comment end state</a>.
href="#comment3">comment end state</a>.

<dt>EOF

Expand Down
61 changes: 58 additions & 3 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -31823,7 +31823,7 @@ function receiver(e) {
<p>If the next two characters are both U+002D HYPHEN-MINUS (-)
characters, consume those two characters, create a comment token
whose data is the empty string, and switch to the <span>comment
state</span>.</p>
start state</span>.</p>

<p>Otherwise if the next seven characters are a
<span>case-insensitive</span><!-- XXX xref, ascii only --> match
Expand All @@ -31837,6 +31837,61 @@ function receiver(e) {

</dd>

<dt><dfn>Comment start state</dfn></dt>

<dd>

<p>Consume the <span>next input character</span>:</p>

<dl class="switch">

<dt>U+002D HYPHEN-MINUS (-)</dt>
<dd>Switch to the <span>comment start dash state</span>.</dd>

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

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

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

</dl>

</dd>

<dt><dfn>Comment start dash state</dfn></dt>

<dd>

<p>Consume the <span>next input character</span>:</p>

<dl class="switch">

<dt>U+002D HYPHEN-MINUS (-)</dt>
<dd>Switch to the <span>comment end state</span></dd>

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

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

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

</dl>

</dd>

<dt><dfn id="comment">Comment state</dfn></dt>

<dd>
Expand All @@ -31846,7 +31901,7 @@ function receiver(e) {
<dl class="switch">

<dt>U+002D HYPHEN-MINUS (-)</dt>
<dd>Switch to the <span>comment dash state</span></dd>
<dd>Switch to the <span>comment end dash state</span></dd>

<dt>EOF</dt>
<dd><span>Parse error</span>. Emit the comment token. Reconsume
Expand All @@ -31864,7 +31919,7 @@ function receiver(e) {

</dd>

<dt><dfn>Comment dash state</dfn></dt>
<dt><dfn>Comment end dash state</dfn></dt>

<dd>

Expand Down

0 comments on commit 19d82fc

Please sign in to comment.