|
6 | 6 |
|
7 | 7 | from arpeggio import PTNodeVisitor, visit_parse_tree |
8 | 8 | from arpeggio.cleanpeg import ParserPEG |
9 | | -from sqlalchemy import ( |
10 | | - Integer, String, and_, case, false, func, null, or_, true) |
| 9 | +from sqlalchemy import Integer, String, and_, case, false, func, null, or_ |
11 | 10 | from sqlalchemy.dialects.postgresql import array |
12 | 11 | from sqlalchemy.sql.operators import concat_op |
13 | 12 |
|
|
29 | 28 | name = r'[a-zA-Z_][a-zA-Z0-9_]*' |
30 | 29 | lookup = "$" ("location" / "participant" / "submission") ("." / "@") name |
31 | 30 | null = "NULL" |
32 | | -true = "TRUE" |
33 | | -false = "FALSE" |
34 | 31 | factor = ("+" / "-")? (number / variable / lookup / "(" expression ")") |
35 | | -value = null / true / false / factor |
| 32 | +value = null / factor |
36 | 33 | exponent = value (("^") value)* |
37 | 34 | product = exponent (("*" / "/") exponent)* |
38 | 35 | sum = product (("+" / "-") product)* |
@@ -231,12 +228,6 @@ def __init__(self, defaults=True, **kwargs): |
231 | 228 | self.submission = kwargs.pop('submission') |
232 | 229 | super().__init__(defaults, **kwargs) |
233 | 230 |
|
234 | | - def visit_false(self, node, children): |
235 | | - return False, OperandType.BOOLEAN |
236 | | - |
237 | | - def visit_true(self, node, children): |
238 | | - return True, OperandType.BOOLEAN |
239 | | - |
240 | 231 | def visit_variable(self, node, children): |
241 | 232 | var_name = node.value |
242 | 233 | if var_name not in self.form.tags: |
@@ -292,12 +283,6 @@ def __init__(self, defaults=True, **kwargs): |
292 | 283 | self.variables = set() |
293 | 284 | super().__init__(defaults, **kwargs) |
294 | 285 |
|
295 | | - def visit_false(self, node, children): |
296 | | - return false(), OperandType.BOOLEAN |
297 | | - |
298 | | - def visit_true(self, node, children): |
299 | | - return true(), OperandType.BOOLEAN |
300 | | - |
301 | 286 | def visit_lookup(self, node, children): |
302 | 287 | top_level_attr, symbol, name = children |
303 | 288 | op_type = OperandType.NUMERIC |
|
0 commit comments