From 23fd5872f6520ca7f14920e50a7a2b21c95ebe5b Mon Sep 17 00:00:00 2001 From: "J. King" Date: Sun, 8 Apr 2018 20:19:59 -0400 Subject: [PATCH] Minor clarifications --- lib/URI.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/URI.php b/lib/URI.php index e9bbf1b..1f4914e 100644 --- a/lib/URI.php +++ b/lib/URI.php @@ -432,6 +432,7 @@ class URI { # Keep running the following state machine by switching on state. # If after a run pointer points to the EOF code point, go to the next step. # Otherwise, increase pointer by one and continue with the state machine. + // Note: the state machine is designed to run once even with an empty string do { # Within a parser algorithm that uses a pointer variable, c references the code point the pointer variable points to. // DEVIATION: we operate on byte strings: $pos is the byte offset of the character referred to by $pointer; @@ -584,6 +585,9 @@ class URI { } # If after a run pointer points to the EOF code point, go to the next step. # Otherwise, increase pointer by one and continue with the state machine. + // DEVIATION: we operate on byte strings: $pos is the byte offset of the character referred to by $pointer; + // $posNext is the start of "remaining" i.e. the offset of the next UTF-8 character + // $posPrev is the byte offset of the start of the previous character i.e. ($pointer - 1) $posPrev = $pos; $pos = $posNext; $pointer++;