(toks, start_idx)
| 481 | |
| 482 | |
| 483 | def parse_limit(toks, start_idx): |
| 484 | idx = start_idx |
| 485 | len_ = len(toks) |
| 486 | |
| 487 | if idx < len_ and toks[idx] == 'limit': |
| 488 | idx += 2 |
| 489 | # make limit value can work, cannot assume put 1 as a fake limit number |
| 490 | if type(toks[idx-1]) != int: |
| 491 | return idx, 1 |
| 492 | |
| 493 | return idx, int(toks[idx-1]) |
| 494 | |
| 495 | return idx, None |
| 496 | |
| 497 | |
| 498 | def parse_sql(toks, start_idx, tables_with_alias, schema): |