(toks, start_idx, tables_with_alias, schema, default_tables=None)
| 256 | |
| 257 | |
| 258 | def parse_val_unit(toks, start_idx, tables_with_alias, schema, default_tables=None): |
| 259 | idx = start_idx |
| 260 | len_ = len(toks) |
| 261 | isBlock = False |
| 262 | if toks[idx] == '(': |
| 263 | isBlock = True |
| 264 | idx += 1 |
| 265 | |
| 266 | col_unit1 = None |
| 267 | col_unit2 = None |
| 268 | unit_op = UNIT_OPS.index('none') |
| 269 | |
| 270 | idx, col_unit1 = parse_col_unit(toks, idx, tables_with_alias, schema, default_tables) |
| 271 | if idx < len_ and toks[idx] in UNIT_OPS: |
| 272 | unit_op = UNIT_OPS.index(toks[idx]) |
| 273 | idx += 1 |
| 274 | idx, col_unit2 = parse_col_unit(toks, idx, tables_with_alias, schema, default_tables) |
| 275 | |
| 276 | if isBlock: |
| 277 | assert toks[idx] == ')' |
| 278 | idx += 1 # skip ')' |
| 279 | |
| 280 | return idx, (unit_op, col_unit1, col_unit2) |
| 281 | |
| 282 | |
| 283 | def parse_table_unit(toks, start_idx, tables_with_alias, schema): |
no test coverage detected