diff --git a/regex/compile.go b/regex/compile.go index 6ba669f..6cd0e59 100644 --- a/regex/compile.go +++ b/regex/compile.go @@ -498,7 +498,7 @@ func shuntingYard(re string, flags ...ReFlag) ([]postfixNode, error) { } } else if re_postfix[i] == 'p' || re_postfix[i] == 'P' { charClassInverted := (re_postfix[i] == 'P') - charsInClass := []rune{} + var charsInClass []rune i++ if isUnicodeCharClassLetter(re_postfix[i]) { var err error @@ -713,7 +713,7 @@ func shuntingYard(re string, flags ...ReFlag) ([]postfixNode, error) { } } else if re_postfix[i] == 'p' || re_postfix[i] == 'P' { charClassInverted := (re_postfix[i] == 'P') - charsInList := []rune{} + var charsInList []rune i++ if isUnicodeCharClassLetter(re_postfix[i]) { var err error