(startOP = '(', endOp = ')')
| 593 | } |
| 594 | |
| 595 | function expressionList(startOP = '(', endOp = ')'): ASTNodeOrNull { |
| 596 | if (matchPunctuator(startOP)) { |
| 597 | const start = token; |
| 598 | let end: Token; |
| 599 | next(); |
| 600 | const args: Array<any> = []; |
| 601 | let state = argListStates.START; |
| 602 | |
| 603 | while (true) { |
| 604 | if (state === argListStates.COMMA || !matchPunctuator(endOp)) { |
| 605 | const arg = assert(expression()); |
| 606 | args.push(arg); |
| 607 | state = argListStates.START; |
| 608 | |
| 609 | if (matchPunctuator(',')) { |
| 610 | next(); |
| 611 | state = argListStates.COMMA; |
| 612 | } |
| 613 | } else if (matchPunctuator(endOp)) { |
| 614 | end = token; |
| 615 | next(); |
| 616 | break; |
| 617 | } |
| 618 | } |
| 619 | return { |
| 620 | type: 'expression-list', |
| 621 | body: args, |
| 622 | start: start.start, |
| 623 | end: end!.end |
| 624 | }; |
| 625 | } |
| 626 | return null; |
| 627 | } |
| 628 | |
| 629 | function argList(startOP = '(', endOp = ')'): ASTNodeOrNull { |
| 630 | let count = 0; |
no test coverage detected