Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: use Infra to define the ordered set parser #427

Merged
merged 2 commits into from Mar 19, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 5 additions & 16 deletions dom.bs
Expand Up @@ -229,24 +229,13 @@ of <a>preceding</a>
<var>input</var> and then runs these steps:

<ol>
<li><p>Let <var>position</var> be a pointer into <var>input</var>, initially pointing at the start
of the string.
<li><p>Let <var>inputTokens</var> be the result of
<a lt="split on ASCII whitespace">splitting <var>input</var> on ASCII whitespace</a>.

<li><p>Let <var>tokens</var> be an <a>ordered set</a>, initially empty.
<li><p>Let <var>tokens</var> be a new <a>ordered set</a>.

<li><p><a>Skip ASCII whitespace</a> within <var>input</var> given <var>position</var>.

<li><p>While <var>position</var> is not past the end of <var>input</var>:

<ol>
<li><p>Let <var>token</var> be the result of <a>collecting a sequence of code points</a> that are
not <a>ASCII whitespace</a> from <var>input</var> given <var>position</var>.

<li><p>If <var>token</var> is not in <var>tokens</var>, <a for=set>append</a> <var>token</var> to
<var>tokens</var>.

<li><p><a>Skip ASCII whitespace</a> within <var>input</var> given <var>position</var>.
</ol>
<li><p><a for=list>For each</a> <var>token</var> in <var>inputTokens</var>, <a for=set>append</a>
<var>token</var> to <var>tokens</var>.

<li>Return <var>tokens</var>.
</ol>
Expand Down