diff --git a/lib/lexer.rb b/lib/lexer.rb index 80cb51f..aa87d79 100644 --- a/lib/lexer.rb +++ b/lib/lexer.rb @@ -66,13 +66,13 @@ class Query < Racc::Parser when (text = @ss.scan(/\)/)) action { return [:R_BRACKET, text] } - when (text = @ss.scan(/(?i)or/)) + when (text = @ss.scan(/(?i)\bor\b/)) action { return [:OPERATOR_OR, text] } - when (text = @ss.scan(/(?i)and/)) + when (text = @ss.scan(/(?i)\band\b/)) action { return [:OPERATOR_AND, text] } - when (text = @ss.scan(/(?i)not/)) + when (text = @ss.scan(/(?i)\bnot\b/)) action { return [:OPERATOR_NOT, text] } when (text = @ss.scan(/"([^"]*)"/))