From b64fcfaa6115eb4a5f65c12d37f95d842136ae35 Mon Sep 17 00:00:00 2001 From: Adam Scarr Date: Wed, 9 Aug 2017 22:14:27 +1000 Subject: Add a unicode whitespace parser --- parser.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'parser.go') 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{} }) } -- cgit v1.2.3