@@ -83,6 +83,18 @@ def __call__(self, mutations):
83
83
return Score (not child_score .score , child_score .residues )
84
84
85
85
86
+ class BoolTrue (AsiExpr ):
87
+ """Boolean True constant"""
88
+ def __call__ (self , * args ):
89
+ return Score (True , [])
90
+
91
+
92
+ class BoolFalse (AsiExpr ):
93
+ """Boolean False constant"""
94
+ def __call__ (self , * args ):
95
+ return Score (False , [])
96
+
97
+
86
98
class AndExpr (AsiExpr ):
87
99
"""Fold boolean AND on children"""
88
100
@@ -279,8 +291,11 @@ def parser(self, rule):
279
291
selectstatement = select + select_quantifier + from_ + residue_list
280
292
selectstatement .setParseAction (SelectFrom )
281
293
294
+ bool_ = Literal ('TRUE' ).suppress ().setParseAction (BoolTrue ) | \
295
+ Literal ('FALSE' ).suppress ().setParseAction (BoolFalse )
296
+
282
297
booleancondition = Forward ()
283
- condition = residue | excludestatement | selectstatement
298
+ condition = residue | excludestatement | selectstatement | bool_
284
299
285
300
booleancondition << infixNotation (condition ,
286
301
[(and_ , 2 , opAssoc .LEFT , AndExpr ),
0 commit comments