From b2cdcfbd615a9dd6119f61f47b6cf628388451d1 Mon Sep 17 00:00:00 2001 From: Bilal Catic Date: Mon, 10 Feb 2020 14:32:54 +0100 Subject: [PATCH] update lexer --- lib/lexer.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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(/"([^"]*)"/))