(toks, start_idx, tables_with_alias, schema, default_tables=None)
| 227 | |
| 228 | |
| 229 | def parse_val_unit(toks, start_idx, tables_with_alias, schema, default_tables=None): |
| 230 | idx = start_idx |
| 231 | len_ = len(toks) |
| 232 | isBlock = False |
| 233 | if toks[idx] == '(': |
| 234 | isBlock = True |
| 235 | idx += 1 |
| 236 | |
| 237 | col_unit1 = None |
| 238 | col_unit2 = None |
| 239 | unit_op = UNIT_OPS.index('none') |
| 240 | |
| 241 | idx, col_unit1 = parse_col_unit(toks, idx, tables_with_alias, schema, default_tables) |
| 242 | if idx < len_ and toks[idx] in UNIT_OPS: |
| 243 | unit_op = UNIT_OPS.index(toks[idx]) |
| 244 | idx += 1 |
| 245 | idx, col_unit2 = parse_col_unit(toks, idx, tables_with_alias, schema, default_tables) |
| 246 | |
| 247 | if isBlock: |
| 248 | assert toks[idx] == ')' |
| 249 | idx += 1 # skip ')' |
| 250 | |
| 251 | return idx, (unit_op, col_unit1, col_unit2) |
| 252 | |
| 253 | |
| 254 | def parse_table_unit(toks, start_idx, tables_with_alias, schema): |
no test coverage detected