|
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)* |
@@ -230,12 +227,6 @@ def __init__(self, defaults=True, **kwargs): |
230 | 227 | self.submission = kwargs.pop('submission') |
231 | 228 | super().__init__(defaults, **kwargs) |
232 | 229 |
|
233 | | - def visit_false(self, node, children): |
234 | | - return False, OperandType.BOOLEAN |
235 | | - |
236 | | - def visit_true(self, node, children): |
237 | | - return True, OperandType.BOOLEAN |
238 | | - |
239 | 230 | def visit_variable(self, node, children): |
240 | 231 | var_name = node.value |
241 | 232 | if var_name not in self.form.tags: |
@@ -291,12 +282,6 @@ def __init__(self, defaults=True, **kwargs): |
291 | 282 | self.variables = set() |
292 | 283 | super().__init__(defaults, **kwargs) |
293 | 284 |
|
294 | | - def visit_false(self, node, children): |
295 | | - return false(), OperandType.BOOLEAN |
296 | | - |
297 | | - def visit_true(self, node, children): |
298 | | - return true(), OperandType.BOOLEAN |
299 | | - |
300 | 285 | def visit_lookup(self, node, children): |
301 | 286 | top_level_attr, symbol, name = children |
302 | 287 | op_type = OperandType.NUMERIC |
|
0 commit comments