diff --git a/url.bs b/url.bs index b8e65bcb..d7b910ce 100644 --- a/url.bs +++ b/url.bs @@ -552,8 +552,7 @@ then runs these steps:
Main: while c is not the - EOF code point: +
While c is not the EOF code point:
If piece pointer is eight, validation error, return failure. @@ -565,8 +564,8 @@ then runs these steps:
If compress pointer is non-null, validation error, return failure.
Let value and length be 0. @@ -579,95 +578,89 @@ then runs these steps: and increase pointer and length by one.
Switching on c: +
If c is U+002E (.), then: -
If length is 0, validation error, return failure. +
If length is 0, validation error, return failure. -
Decrease pointer by length. +
Decrease pointer by length. -
Jump to IPv4. -
If piece pointer is greater than six, validation error, return + failure. -
Increase pointer by one. +
Let numbersSeen be 0. -
If c is the EOF code point, validation error, return failure. -
While c is not the EOF code point: -
Validation error, return failure. -
Let ipv4Piece be null. -
Set piece to value. +
If numbersSeen is greater than 0, then: -
Increase piece pointer by one. -
If c is a U+002E (.) and numbersSeen is less than 4, then increase + pointer by one. -
If c is the EOF code point, jump to - Finale. +
IPv4: if - piece pointer is greater than six, validation error, return failure. +
If c is not an ASCII digit, validation error, return failure. + -
Let numbersSeen be 0. +
While c is an ASCII digit: -
While c is not the EOF code point: +
Let number be c interpreted as decimal number. -
Let value be null. +
If ipv4Piece is null, then set ipv4Piece to number. -
If numbersSeen is greater than 0, then: +
Otherwise, if ipv4Piece is 0, validation error, return failure. -
If c is a U+002E (.) and numbersSeen is less than 4, then increase - pointer by one. +
Otherwise, set ipv4Piece to ipv4Piece × 10 + + number. -
Increase pointer by one. -
If c is not an ASCII digit, validation error, return failure. - +
If ipv4Piece is greater than 255, validation error, return + failure. +
While c is an ASCII digit: +
Set piece to piece × 0x100 + ipv4Piece. -
Let number be c interpreted as decimal number. +
Increase numbersSeen by one. -
If value is null, set value to number. +
If numbersSeen is 2 or 4, then increase piece pointer by one. -
Otherwise, if value is 0, validation error, return failure. +
If c is the EOF code point and numbersSeen is not 4, + validation error, return failure. +
Break. +
Otherwise, set value to value × 10 + number. +
Otherwise, if c is U+003A (:): +
Increase pointer by one. -
If value is greater than 255, validation error, return failure. +
If c is the EOF code point, validation error, return failure.
Set piece to - piece × 0x100 + value. - -
Increase numbersSeen by one. +
Otherwise, if c is not the EOF code point, validation error, return + failure. -
If numbersSeen is 2 or 4, then increase piece pointer by one. +
Set piece to value. -
If c is the EOF code point and numbersSeen is not 4, - validation error, return failure. +
Increase piece pointer by one.
Finale: if - compress pointer is non-null, then: +
If compress pointer is non-null, then:
Let swaps be @@ -688,10 +681,6 @@ then runs these steps:
Return address.
To be clear, Main, -IPv4, and Finale are markers. They serve -no purpose other than being a location the algorithm can jump to. -
The opaque-host parser takes a string