[html5] r4301 - [e] (0) Simplify the algorithms for parsing signed and unsigned integers to use [...]

whatwg at whatwg.org whatwg at whatwg.org
Fri Oct 23 00:20:32 PDT 2009


Author: ianh
Date: 2009-10-23 00:20:28 -0700 (Fri, 23 Oct 2009)
New Revision: 4301

Modified:
   complete.html
   index
   source
Log:
[e] (0) Simplify the algorithms for parsing signed and unsigned integers to use subalgorithms that have since been defined.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=8012

Modified: complete.html
===================================================================
--- complete.html	2009-10-23 07:15:40 UTC (rev 4300)
+++ complete.html	2009-10-23 07:20:28 UTC (rev 4301)
@@ -2753,8 +2753,6 @@
    <li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
    string.</li>
 
-   <li><p>Let <var title="">value</var> have the value 0.</li>
-
    <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
 
    <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return an error.</li>
@@ -2772,24 +2770,10 @@
    trailing garbage which we'll ignore, but it's a number, and we
    won't return an error. -->
 
-   <li>
+   <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
+   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
+   resulting sequence as a base-ten integer. Let <var title="">value</var> be that integer.</li>
 
-    <p><i>Loop</i>: If the character indicated by <var title="">position</var> is one of U+0030 DIGIT ZERO (0) to U+0039
-    DIGIT NINE (9):</p>
-
-    <ol><li>Multiply <var title="">value</var> by ten.</li>
-
-     <li>Add the value of the character indicated by <var title="">position</var> (0..9) to <var title="">value</var>.</li>
-
-     <li>Advance <var title="">position</var> to the next
-     character.</li>
-
-     <li>If <var title="">position</var> is not past the end of <var title="">input</var>, return to the top of the step labeled
-     <i>loop</i> in the overall algorithm (that's the step within
-     which these substeps find themselves).</li>
-
-    </ol></li>
-
    <li><p>Return <var title="">value</var>.</li>
 
   </ol></div>
@@ -2826,8 +2810,6 @@
    <li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
    string.</li>
 
-   <li><p>Let <var title="">value</var> have the value 0.</li>
-
    <li><p>Let <var title="">sign</var> have the value
    "positive".</li>
 
@@ -2866,24 +2848,10 @@
    trailing garbage which we'll ignore, but it's a number, and we
    won't return an error. -->
 
-   <li>
+   <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
+   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
+   resulting sequence as a base-ten integer. Let <var title="">value</var> be that integer.</li>
 
-    <p>If the character indicated by <var title="">position</var> is
-    one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9):</p>
-
-    <ol><li>Multiply <var title="">value</var> by ten.</li>
-
-     <li>Add the value of the character indicated by <var title="">position</var> (0..9) to <var title="">value</var>.</li>
-
-     <li>Advance <var title="">position</var> to the next
-     character.</li>
-
-     <li>If <var title="">position</var> is not past the end of <var title="">input</var>, return to the top of step 9 in the overall
-     algorithm (that's the step within which these substeps find
-     themselves).</li>
-
-    </ol></li>
-
    <li><p>If <var title="">sign</var> is "positive", return <var title="">value</var>, otherwise return the result of subtracting
    <var title="">value</var> from zero.</li>
 

Modified: index
===================================================================
--- index	2009-10-23 07:15:40 UTC (rev 4300)
+++ index	2009-10-23 07:20:28 UTC (rev 4301)
@@ -2563,8 +2563,6 @@
    <li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
    string.</li>
 
-   <li><p>Let <var title="">value</var> have the value 0.</li>
-
    <li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>
 
    <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return an error.</li>
@@ -2582,24 +2580,10 @@
    trailing garbage which we'll ignore, but it's a number, and we
    won't return an error. -->
 
-   <li>
+   <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
+   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
+   resulting sequence as a base-ten integer. Let <var title="">value</var> be that integer.</li>
 
-    <p><i>Loop</i>: If the character indicated by <var title="">position</var> is one of U+0030 DIGIT ZERO (0) to U+0039
-    DIGIT NINE (9):</p>
-
-    <ol><li>Multiply <var title="">value</var> by ten.</li>
-
-     <li>Add the value of the character indicated by <var title="">position</var> (0..9) to <var title="">value</var>.</li>
-
-     <li>Advance <var title="">position</var> to the next
-     character.</li>
-
-     <li>If <var title="">position</var> is not past the end of <var title="">input</var>, return to the top of the step labeled
-     <i>loop</i> in the overall algorithm (that's the step within
-     which these substeps find themselves).</li>
-
-    </ol></li>
-
    <li><p>Return <var title="">value</var>.</li>
 
   </ol></div>
@@ -2636,8 +2620,6 @@
    <li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
    string.</li>
 
-   <li><p>Let <var title="">value</var> have the value 0.</li>
-
    <li><p>Let <var title="">sign</var> have the value
    "positive".</li>
 
@@ -2676,24 +2658,10 @@
    trailing garbage which we'll ignore, but it's a number, and we
    won't return an error. -->
 
-   <li>
+   <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
+   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
+   resulting sequence as a base-ten integer. Let <var title="">value</var> be that integer.</li>
 
-    <p>If the character indicated by <var title="">position</var> is
-    one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9):</p>
-
-    <ol><li>Multiply <var title="">value</var> by ten.</li>
-
-     <li>Add the value of the character indicated by <var title="">position</var> (0..9) to <var title="">value</var>.</li>
-
-     <li>Advance <var title="">position</var> to the next
-     character.</li>
-
-     <li>If <var title="">position</var> is not past the end of <var title="">input</var>, return to the top of step 9 in the overall
-     algorithm (that's the step within which these substeps find
-     themselves).</li>
-
-    </ol></li>
-
    <li><p>If <var title="">sign</var> is "positive", return <var title="">value</var>, otherwise return the result of subtracting
    <var title="">value</var> from zero.</li>
 

Modified: source
===================================================================
--- source	2009-10-23 07:15:40 UTC (rev 4300)
+++ source	2009-10-23 07:20:28 UTC (rev 4301)
@@ -1628,8 +1628,6 @@
    title="">input</var>, initially pointing at the start of the
    string.</p></li>
 
-   <li><p>Let <var title="">value</var> have the value 0.</li>
-
    <li><p><span>Skip whitespace</span>.</p></li>
 
    <li><p>If <var title="">position</var> is past the end of <var
@@ -1651,31 +1649,11 @@
    trailing garbage which we'll ignore, but it's a number, and we
    won't return an error. -->
 
-   <li>
+   <li><p><span>Collect a sequence of characters</span> in the range
+   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
+   resulting sequence as a base-ten integer. Let <var
+   title="">value</var> be that integer.</p></li>
 
-    <p><i>Loop</i>: If the character indicated by <var
-    title="">position</var> is one of U+0030 DIGIT ZERO (0) to U+0039
-    DIGIT NINE (9):</p>
-
-    <ol>
-
-     <li>Multiply <var title="">value</var> by ten.</li>
-
-     <li>Add the value of the character indicated by <var
-     title="">position</var> (0..9) to <var title="">value</var>.</li>
-
-     <li>Advance <var title="">position</var> to the next
-     character.</li>
-
-     <li>If <var title="">position</var> is not past the end of <var
-     title="">input</var>, return to the top of the step labeled
-     <i>loop</i> in the overall algorithm (that's the step within
-     which these substeps find themselves).</li>
-
-    </ol>
-
-   </li>
-
    <li><p>Return <var title="">value</var>.</p></li>
 
   </ol>
@@ -1717,8 +1695,6 @@
    title="">input</var>, initially pointing at the start of the
    string.</p></li>
 
-   <li><p>Let <var title="">value</var> have the value 0.</p></li>
-
    <li><p>Let <var title="">sign</var> have the value
    "positive".</p></li>
 
@@ -1769,30 +1745,11 @@
    trailing garbage which we'll ignore, but it's a number, and we
    won't return an error. -->
 
-   <li>
+   <li><p><span>Collect a sequence of characters</span> in the range
+   U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
+   resulting sequence as a base-ten integer. Let <var
+   title="">value</var> be that integer.</p></li>
 
-    <p>If the character indicated by <var title="">position</var> is
-    one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9):</p>
-
-    <ol>
-
-     <li>Multiply <var title="">value</var> by ten.</li>
-
-     <li>Add the value of the character indicated by <var
-     title="">position</var> (0..9) to <var title="">value</var>.</li>
-
-     <li>Advance <var title="">position</var> to the next
-     character.</li>
-
-     <li>If <var title="">position</var> is not past the end of <var
-     title="">input</var>, return to the top of step 9 in the overall
-     algorithm (that's the step within which these substeps find
-     themselves).</li>
-
-    </ol>
-
-   </li>
-
    <li><p>If <var title="">sign</var> is "positive", return <var
    title="">value</var>, otherwise return the result of subtracting
    <var title="">value</var> from zero.</p></li>




More information about the Commit-Watchers mailing list