scanner.Scanner: Add .NewLine() helper to increment line of the cursor

Signed-off-by: Alejandro Mery <amery@geeks.cl>
This commit is contained in:
2014-10-24 07:39:08 +02:00
parent 7a4713a353
commit f9405e7fe1
+6
View File
@@ -74,6 +74,12 @@ func (l *Scanner) Skip() {
l.runes = 0
}
// Count NewLine
func (l *Scanner) NextLine() {
l.cursor.Line++
l.cursor.Column = 1
}
// Return the next rune but not moving the cursor
func (l *Scanner) Peek() (rune, uint) {
if l.cursor.Offset == uint(len(l.input)) {