@@ -731,9 +732,10 @@ to be distinguished.
Host parsing
+
The host parser takes a
scalar value string input with an optional boolean isNotSpecial
-(default false), and then runs these steps:
+(default false), and then runs these steps. They return failure or a host.
-
@@ -771,11 +773,13 @@ to be distinguished.
Return asciiDomain.
+
+
The ends in a number checker takes an ASCII string input and then
-runs these steps:
+runs these steps. They return a boolean.
Let parts be the result of strictly splitting input on
@@ -807,18 +811,16 @@ runs these steps:
Return false.
+
+
The IPv4 parser takes an ASCII string input
-and then runs these steps:
+and then runs these steps. They return failure or an IPv4 address.
-
- -
-
Let validationError be false.
-
-
This uses validationError to track validation errors to avoid
- reporting them before we are confident we want to parse input as an IPv4 address as the
- host parser almost always invokes the IPv4 parser.
+
The IPv4 parser is not to be invoked directly. Instead check that the
+return value of the host parser is an IPv4 address.
+
Let parts be the result of strictly splitting input on
U+002E (.).
@@ -826,7 +828,7 @@ and then runs these steps:
If the last item in parts is the empty string, then:
- Set validationError to true.
+
Validation error.
If parts's size is greater than 1, then remove
the last item from parts.
@@ -848,18 +850,11 @@ and then runs these steps:
If result is failure, validation error, return failure.
-
If result[1] is true, then set validationError to true.
+
If result[1] is true, validation error.
Append result[0] to numbers.
- -
-
If validationError is true, validation error.
-
-
At this point each part was parsed into a number and input will be
- treated as an IPv4 address (or failure). And therefore error reporting resumes.
-
-
If any item in numbers is greater than 255, validation error.
If any but the last item in numbers is greater than 255, then
@@ -887,7 +882,9 @@ and then runs these steps:
Return ipv4.
+
+
The IPv4 number parser takes an ASCII string input and then runs
these steps:
@@ -938,11 +935,16 @@ these steps:
Return (output, validationError).
+
+
The IPv6 parser takes a scalar value string
-input and then runs these steps:
+input and then runs these steps. They return failure or an IPv6 address.
+
+
The IPv6 parser could in theory be invoked directly, but please discuss
+actually doing that with the editors of this document first.
Let address be a new IPv6 address whose IPv6 pieces are all 0.
@@ -1088,11 +1090,14 @@ these steps:
Return address.
+
+
Host serializing