summaryrefslogtreecommitdiff
path: root/parser.go
diff options
context:
space:
mode:
authorAdam Scarr <adam@vektah.net>2017-08-09 22:14:27 +1000
committerAdam Scarr <adam@vektah.net>2017-08-09 22:14:27 +1000
commitb64fcfaa6115eb4a5f65c12d37f95d842136ae35 (patch)
treeceb8a55f3c538a263ab96563be7edec898518661 /parser.go
parentd285a0badc988be2cef6e01d224bf8f108bb33bb (diff)
Add a unicode whitespace parser
Diffstat (limited to 'parser.go')
-rw-r--r--parser.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/parser.go b/parser.go
index f084af4..7590ffa 100644
--- a/parser.go
+++ b/parser.go
@@ -25,6 +25,9 @@ type Result struct {
// - A parser that consumed some input should advance state.Pos
type Parser func(*State) Result
+// VoidParser is a special type of parser that never returns anything but can still consume input
+type VoidParser func(*State)
+
// Parserish types are any type that can be turned into a Parser by Parsify
// These currently include *Parser and string literals.
//
@@ -76,7 +79,7 @@ func ParsifyAll(parsers ...Parserish) []Parser {
// WS will consume whitespace, it should only be needed when AutoWS is turned off
func WS() Parser {
return NewParser("AutoWS", func(ps *State) Result {
- ps.WS()
+ ps.WS(ps)
return Result{}
})
}