Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
naorpeled committed Oct 29, 2024
1 parent c64ec8f commit 65ed593
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/parser/lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,6 @@ func (l *Lexer) Lex(lval *yySymType) int {
case "CONTAINS":
logDebug("Returning CONTAINS token")
return int(CONTAINS)
case "=~":
logDebug("Returning REGEX_COMPARE token")
return int(REGEX_COMPARE)
default:
lval.strVal = lit
logDebug("Returning IDENT token with value:", lval.strVal)
Expand All @@ -221,6 +218,12 @@ func (l *Lexer) Lex(lval *yySymType) int {
logDebug("Returning COLON token")
return int(COLON)
case '=':
ch := l.s.Peek()
if ch == '~' {
l.s.Next() // Consume '~'
logDebug("Returning REGEX_COMPARE token")
return int(REGEX_COMPARE)
}
logDebug("Returning EQUALS token")
return int(EQUALS)
case '!':
Expand Down

0 comments on commit 65ed593

Please sign in to comment.