aboutsummaryrefslogtreecommitdiff
path: root/lib/parser/parser.go
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2020-11-15 15:25:20 +0700
committerShulhan <m.shulhan@gmail.com>2020-11-15 15:25:20 +0700
commit3659f9e9e4b632ca4d759eadcbadc6d5e862f4db (patch)
tree89b1bab8cf693d43fde4e2eb2c1bbedb39d241d8 /lib/parser/parser.go
parent07a0d95ce49c3550850725f285d767b195b5efe8 (diff)
downloadpakakeh.go-3659f9e9e4b632ca4d759eadcbadc6d5e862f4db.tar.xz
parser: fix Line method that always return non-empty line
In case of content end without new line, for example "a\nb", the Line() method always return "b, 0" on the last line.
Diffstat (limited to 'lib/parser/parser.go')
-rw-r--r--lib/parser/parser.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/parser/parser.go b/lib/parser/parser.go
index cebf033a..33897ba7 100644
--- a/lib/parser/parser.go
+++ b/lib/parser/parser.go
@@ -175,6 +175,7 @@ func (p *Parser) Line() (string, rune) {
}
p.token = append(p.token, r)
}
+ p.x = len(p.v)
return string(p.token), 0
}