boolean-expression 0.0.2 → 0.0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/boolean/expression.rb +4 -0
- metadata +1 -1
data/lib/boolean/expression.rb
CHANGED
@@ -100,6 +100,10 @@ class Boolean::Expression
|
|
100
100
|
|
101
101
|
private
|
102
102
|
def _check (group)
|
103
|
+
if group.first.is_a?(Logic) && group.first.type != :not
|
104
|
+
raise SyntaxError, "the expression cannot start with AND/OR: #{group}"
|
105
|
+
end
|
106
|
+
|
103
107
|
group.each_with_index {|piece, index|
|
104
108
|
if piece.is_a?(Group)
|
105
109
|
_check(piece)
|