summaryrefslogtreecommitdiff
path: root/src/HTML5/InputStream.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/HTML5/InputStream.php')
-rw-r--r--src/HTML5/InputStream.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/HTML5/InputStream.php b/src/HTML5/InputStream.php
index 860f883..1efaff3 100644
--- a/src/HTML5/InputStream.php
+++ b/src/HTML5/InputStream.php
@@ -390,9 +390,20 @@ class InputStream {
/**
* Unconsume one character.
*/
- public function unget() {
+ public function unconsume() {
if ($this->char > 0 && $this->char <= $this->EOF) {
$this->char--;
}
}
+ public function unget() {
+ $this->unconsume();
+ }
+
+ public function peek() {
+ return $this->data[$this->char + 1];
+ }
+
+ public function position() {
+ return $this->char;
+ }
}