diff options
author | Adam Scarr <adam@vektah.net> | 2017-08-06 17:02:39 +1000 |
---|---|---|
committer | Adam Scarr <adam@vektah.net> | 2017-08-06 17:02:39 +1000 |
commit | a65a9325aaebd1499a8e523463cc023124f8536a (patch) | |
tree | 2fb31800b67a3914a7204a28319a7aeb0ac649c7 /parser.go | |
parent | 8b343d6360d0edc065b9b62ab5e708e907b45a92 (diff) |
Get the HTML parser working
Diffstat (limited to 'parser.go')
-rw-r--r-- | parser.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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) } } |