From a65a9325aaebd1499a8e523463cc023124f8536a Mon Sep 17 00:00:00 2001 From: Adam Scarr Date: Sun, 6 Aug 2017 17:02:39 +1000 Subject: Get the HTML parser working --- parser.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'parser.go') diff --git a/parser.go b/parser.go index 82b5d56..3c5d752 100644 --- a/parser.go +++ b/parser.go @@ -67,7 +67,7 @@ func Exact(match string) Parser { return NewError(p.pos, "Expected "+match), p } - return NewToken(p.pos, match), p.Advance(len(match)) + return match, p.Advance(len(match)) } } @@ -79,7 +79,7 @@ func Char(match string) Parser { return NewError(p.pos, "Expected one of "+string(match)), p } - return NewToken(p.pos, string(r)), p.Advance(w) + return string(r), p.Advance(w) } } @@ -98,7 +98,7 @@ func CharRun(match string) Parser { return NewError(p.pos, "Expected some of "+match), p } - return NewToken(p.pos, p.input[p.pos:p.pos+matched]), p.Advance(matched) + return p.input[p.pos : p.pos+matched], p.Advance(matched) } } @@ -117,7 +117,7 @@ func CharRunUntil(match string) Parser { return NewError(p.pos, "Expected some of "+match), p } - return NewToken(p.pos, p.input[p.pos:p.pos+matched]), p.Advance(matched) + return p.input[p.pos : p.pos+matched], p.Advance(matched) } } @@ -177,7 +177,7 @@ func Range(r string, repetition ...int) Parser { return NewError(p.pos+matched, fmt.Sprintf("Expected at least %d more of %s", min-matched, r)), p } - return NewToken(p.pos, p.input[p.pos:p.pos+matched]), p.Advance(matched) + return p.input[p.pos : p.pos+matched], p.Advance(matched) } } -- cgit v1.2.3