This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14022 - Common microsyntax idiom "to strictly split a string on a particular delimiter character" is incorrectly described.
Summary: Common microsyntax idiom "to strictly split a string on a particular delimite...
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-04 08:38 UTC by remci Mizkur
Modified: 2011-09-04 20:57 UTC (History)
6 users (show)

See Also:


Attachments

Description remci Mizkur 2011-09-04 08:38:45 UTC
In editor's draft, 2011-08-29, Common infrastructure / Common microsyntaxes / Common parser idioms, the algorithm "to strictly split a string on a particular delimiter character" is incorrectly described.  As described, it creates an infinite loop at the first delimiter.

This is based on an interpretation that the call in step 4.1 to the algorithm to "Collect a sequence of characters", specifically step 3 of that algorithm, returns with position at the next location after the last character collected, i.e. pointing at a delimiter if one was encountered.

Suggested resolution:

Add a step 4.3 to advance position, so that step 4 reads:

  4. While position is not past the end of input:
      1. Collect a sequence of characters that are not the delimiter character.
      2. Add the string collected in the previous step to tokens.
      3. Advance position to the next character in input.
           [italicize "position" and "input"]
Comment 1 Ian 'Hixie' Hickson 2011-09-04 20:50:16 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Good catch! Thanks.
Comment 2 contributor 2011-09-04 20:57:11 UTC
Checked in as WHATWG revision r6538.
Check-in comment: Fix infinite loop. Oops.
http://html5.org/tools/web-apps-tracker?from=6537&to=6538