summaryrefslogtreecommitdiffhomepage
path: root/parser/pageparser/pageparser.go
diff options
context:
space:
mode:
Diffstat (limited to 'parser/pageparser/pageparser.go')
-rw-r--r--parser/pageparser/pageparser.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/parser/pageparser/pageparser.go b/parser/pageparser/pageparser.go
index bc6f55dd8..0d32c0e89 100644
--- a/parser/pageparser/pageparser.go
+++ b/parser/pageparser/pageparser.go
@@ -48,7 +48,7 @@ func Parse(r io.Reader) (Result, error) {
}
func parseMainSection(input []byte, from int) Result {
- lexer := newPageLexer(input, pos(from), lexMainSection) // TODO(bep) 2errors
+ lexer := newPageLexer(input, Pos(from), lexMainSection) // TODO(bep) 2errors
lexer.run()
return lexer
}
@@ -57,7 +57,7 @@ func parseMainSection(input []byte, from int) Result {
// if needed.
type Iterator struct {
l *pageLexer
- lastPos pos // position of the last item returned by nextItem
+ lastPos Pos // position of the last item returned by nextItem
}
// consumes and returns the next item
@@ -69,7 +69,7 @@ func (t *Iterator) Next() Item {
var errIndexOutOfBounds = Item{tError, 0, []byte("no more tokens")}
func (t *Iterator) current() Item {
- if t.lastPos >= pos(len(t.l.items)) {
+ if t.lastPos >= Pos(len(t.l.items)) {
return errIndexOutOfBounds
}
return t.l.items[t.lastPos]
@@ -98,7 +98,7 @@ func (t *Iterator) Peek() Item {
// PeekWalk will feed the next items in the iterator to walkFn
// until it returns false.
func (t *Iterator) PeekWalk(walkFn func(item Item) bool) {
- for i := t.lastPos + 1; i < pos(len(t.l.items)); i++ {
+ for i := t.lastPos + 1; i < Pos(len(t.l.items)); i++ {
item := t.l.items[i]
if !walkFn(item) {
break
@@ -120,5 +120,5 @@ func (t *Iterator) Consume(cnt int) {
// LineNumber returns the current line number. Used for logging.
func (t *Iterator) LineNumber() int {
- return bytes.Count(t.l.input[:t.current().pos], lf) + 1
+ return bytes.Count(t.l.input[:t.current().Pos], lf) + 1
}