(toks, start_idx)
| 510 | |
| 511 | |
| 512 | def parse_limit(toks, start_idx): |
| 513 | idx = start_idx |
| 514 | len_ = len(toks) |
| 515 | |
| 516 | if idx < len_ and toks[idx] == 'limit': |
| 517 | idx += 2 |
| 518 | # make limit value can work, cannot assume put 1 as a fake limit number |
| 519 | if type(toks[idx - 1]) != int: # noqa |
| 520 | return idx, 1 |
| 521 | |
| 522 | return idx, int(toks[idx - 1]) |
| 523 | |
| 524 | return idx, None |
| 525 | |
| 526 | |
| 527 | def parse_sql(toks, start_idx, tables_with_alias, schema): |