(asyncToken?: KeywordToken)
| 692 | |
| 693 | // with_stmt: 'with' with_item (',' with_item)* ':' suite |
| 694 | private _parseWithStatement(asyncToken?: KeywordToken): WithNode { |
| 695 | let withToken = this._getKeywordToken(KeywordType.With); |
| 696 | let withItemList: WithItemNode[] = []; |
| 697 | |
| 698 | while (true) { |
| 699 | withItemList.push(this._parseWithItem()); |
| 700 | |
| 701 | if (!this._consumeTokenIfType(TokenType.Comma)) { |
| 702 | break; |
| 703 | } |
| 704 | } |
| 705 | |
| 706 | let withSuite = this._parseSuite(); |
| 707 | let withNode = new WithNode(withToken, withSuite); |
| 708 | if (asyncToken) { |
| 709 | withNode.isAsync = true; |
| 710 | withNode.extend(asyncToken); |
| 711 | } |
| 712 | withNode.withItems = withItemList; |
| 713 | return withNode; |
| 714 | } |
| 715 | |
| 716 | // with_item: test ['as' expr] |
| 717 | private _parseWithItem(): WithItemNode { |
no test coverage detected