(self, cond, optional=False)
| 208 | raise ValueError(table_type) |
| 209 | |
| 210 | def parse_cond(self, cond, optional=False): |
| 211 | if optional and not cond: |
| 212 | return None |
| 213 | |
| 214 | if len(cond) > 1: |
| 215 | return { |
| 216 | '_type': self.LOGIC_OPERATORS_F[cond[1]], |
| 217 | 'left': self.parse_cond(cond[:1]), |
| 218 | 'right': self.parse_cond(cond[2:]), |
| 219 | } |
| 220 | |
| 221 | (not_op, op_id, val_unit, val1, val2), = cond |
| 222 | result = { |
| 223 | '_type': self.COND_TYPES_F[op_id], |
| 224 | 'val_unit': self.parse_val_unit(val_unit), |
| 225 | 'val1': self.parse_val(val1), |
| 226 | } |
| 227 | if op_id == 1: # between |
| 228 | result['val2'] = self.parse_val(val2) |
| 229 | if not_op: |
| 230 | result = { |
| 231 | '_type': 'Not', |
| 232 | 'c': result, |
| 233 | } |
| 234 | return result |
| 235 | |
| 236 | def parse_sql(self, sql, optional=False): |
| 237 | if optional and sql is None: |
no test coverage detected