From 2ab838ea788d6b35436f48831fa56d039bb161bb Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Thu, 31 Aug 2023 14:28:57 +0000 Subject: [PATCH] lexer: introduce NewIsInRunes() shortcut for NewIsIn() Signed-off-by: Alejandro Mery --- lexer/runes.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lexer/runes.go b/lexer/runes.go index a69992d..222dbd9 100644 --- a/lexer/runes.go +++ b/lexer/runes.go @@ -21,6 +21,12 @@ func NewIsIn(s string) func(rune) bool { } } +// NewIsInRunes generates a rune condition checker that accepts +// the runes specified +func NewIsInRunes(s ...rune) func(rune) bool { + return NewIsIn(string(s)) +} + // NewIsOneOf generates a run condition checker that accepts runes // accepted by any of the given checkers func NewIsOneOf(s ...func(rune) bool) func(rune) bool {