From 6b9cd80df517fd7d85a256a950f3de726d7e619e Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Sun, 16 Jun 2019 12:14:02 +0200 Subject: use Fprint instead of Fprintf in debug --- parser.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'parser.go') diff --git a/parser.go b/parser.go index 489535c..f008d33 100644 --- a/parser.go +++ b/parser.go @@ -197,13 +197,13 @@ func parseMatcher(matcher string) (alphabet string, ranges [][]rune) { // - min and max: Chars("a-z0-9", 4, 6) will match 4-6 lowercase alphanumeric characters // the above can be combined in any order func Chars(matcher string, repetition ...int) Parser { - return NewParser(fmt.Sprintf("Chars(%q)", matcher), charsImpl(matcher, false, repetition...)) + return NewParser("["+matcher+"]", charsImpl(matcher, false, repetition...)) } // NotChars accepts the full range of input from Chars, but it will stop when any // character matches. If you need to match until you see a sequence use Until instead func NotChars(matcher string, repetition ...int) Parser { - return NewParser(fmt.Sprintf("!Chars(%q)", matcher), charsImpl(matcher, true, repetition...)) + return NewParser("!["+matcher+"]", charsImpl(matcher, true, repetition...)) } func charsImpl(matcher string, stopOn bool, repetition ...int) Parser { -- cgit v1.2.3