summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖzgür Kesim <oec@codeblau.de>2019-06-16 12:10:05 +0200
committerÖzgür Kesim <oec@codeblau.de>2019-06-16 12:10:05 +0200
commit68e6e3dab81254011e451775a54b3791d5bbc502 (patch)
tree9634934b39e8f4476e37b294134635ca65885200
parent7784031254cce80098826c6bd870de881063c1dc (diff)
different tag for Chars and NotChars
-rw-r--r--parser.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/parser.go b/parser.go
index f008d33..489535c 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("["+matcher+"]", charsImpl(matcher, false, repetition...))
+ return NewParser(fmt.Sprintf("Chars(%q)", 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("!["+matcher+"]", charsImpl(matcher, true, repetition...))
+ return NewParser(fmt.Sprintf("!Chars(%q)", matcher), charsImpl(matcher, true, repetition...))
}
func charsImpl(matcher string, stopOn bool, repetition ...int) Parser {