diff options
Diffstat (limited to 'src/HTML5/Parser/InputStream.php')
-rw-r--r-- | src/HTML5/Parser/InputStream.php | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/HTML5/Parser/InputStream.php b/src/HTML5/Parser/InputStream.php index 4c5c075..bb2ca1c 100644 --- a/src/HTML5/Parser/InputStream.php +++ b/src/HTML5/Parser/InputStream.php @@ -4,12 +4,12 @@ namespace HTML5\Parser; /** * Interface for stream readers. */ -interface InputStream { +interface InputStream extends \Iterator { /** * Returns the current line that is being consumed. * - * TODO: Move this to the tokenizer. + * TODO: Move this to the scanner. */ public function currentLine(); @@ -18,7 +18,7 @@ interface InputStream { * * Newlines are column 0. The first char after a newline is column 1. * - * @TODO Move this to the tokenizer. + * @TODO Move this to the scanner. * * @return int * The column number. @@ -26,11 +26,6 @@ interface InputStream { public function columnOffset(); /** - * Retrieve the currently consumed character. - */ - public function char(); - - /** * Get all characters until EOF. * * This consumes characters until the EOF. @@ -74,16 +69,14 @@ interface InputStream { /** * Unconsume one character. + * + * @param int $howMany + * The number of characters to move the pointer back. */ - public function unconsume(); + public function unconsume($howMany = 1); /** * Retrieve the next character without advancing the pointer. */ public function peek(); - - /** - * Get the position of the reader. - */ - public function position(); } |