summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatt Farina <[email protected]>2013-04-10 16:45:13 -0400
committerMatt Farina <[email protected]>2013-04-10 16:45:19 -0400
commit8823b54d3bc4fe9e8dafdfceede85c4a7eb58772 (patch)
treeeeb4523677cc28945ee568a6131bc0ab2cbcf701 /src
parentab9d8dbaf0469a1ab419f283e1e1e21fec1c1b74 (diff)
Added pass through commands on the scanner to the column, row, and characters remaining methonds.
Diffstat (limited to 'src')
-rw-r--r--src/HTML5/Parser/Scanner.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/HTML5/Parser/Scanner.php b/src/HTML5/Parser/Scanner.php
index 63b7be4..f952704 100644
--- a/src/HTML5/Parser/Scanner.php
+++ b/src/HTML5/Parser/Scanner.php
@@ -135,4 +135,38 @@ class Scanner {
public function getNumeric() {
return $this->is->charsWhile('0123456789');
}
+
+ /**
+ * Returns the current line that is being consumed.
+ *
+ * @return int
+ * The current line number.
+ */
+ public function currentLine() {
+ return $this->is->currentLine();
+ }
+
+ /**
+ * Returns the current column of the current line that the tokenizer is at.
+ *
+ * Newlines are column 0. The first char after a newline is column 1.
+ *
+ * @return int
+ * The column number.
+ */
+ public function columnOffset() {
+ return $this->is->columnOffset();
+ }
+
+ /**
+ * Get all characters until EOF.
+ *
+ * This consumes characters until the EOF.
+ *
+ * @return int
+ * The number of characters remaining.
+ */
+ public function remainingChars() {
+ return $this->is->remainingChars();
+ }
}