File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ import (
1010 "text/scanner"
1111)
1212
13- // regex contains a compiled regexp and is used by the Lexer to match filter identifiers.
14- // Currently, it allows to match any character except these inside the curly braces .
15- var regex = regexp .MustCompile ("[^!&|~<>=()]" )
13+ // identifiersMatcher contains a compiled regexp and is used by the Lexer to match filter identifiers.
14+ // Currently, it allows to match any character except a LogicalOp and CompOperator .
15+ var identifiersMatcher = regexp .MustCompile ("[^!&|~<>=()]" )
1616
1717// init just sets the global yyErrorVerbose variable to true.
1818func init () {
@@ -146,7 +146,7 @@ func (l *Lexer) Error(s string) {
146146// isIdentRune provides custom implementation of scanner.IsIdentRune.
147147// This function determines whether a given character is allowed to be part of an identifier.
148148func isIdentRune (ch rune , i int ) bool {
149- return regex .MatchString (string (ch ))
149+ return identifiersMatcher .MatchString (string (ch ))
150150}
151151
152152// ScanError is used to capture all errors the Scanner encounters.
You can’t perform that action at this time.
0 commit comments