()
| 712 | return module; |
| 713 | } |
| 714 | _parseSuite() { |
| 715 | const body = []; |
| 716 | let statement = null; |
| 717 | if (this._tokenizer.accept('\n')) { |
| 718 | if (this._tokenizer.accept('indent')) { |
| 719 | while (!this._tokenizer.accept('eof') && !this._tokenizer.accept('dedent')) { |
| 720 | if (this._tokenizer.accept(';')) { |
| 721 | continue; |
| 722 | } |
| 723 | statement = this._parseStatement(); |
| 724 | if (statement) { |
| 725 | body.push(statement); |
| 726 | continue; |
| 727 | } |
| 728 | if (this._tokenizer.accept('\n')) { |
| 729 | continue; |
| 730 | } |
| 731 | if (this._tokenizer.match('dedent') || this._tokenizer.match('eof')) { |
| 732 | continue; |
| 733 | } |
| 734 | throw new python.Error(`Empty statement ${this._location()}`); |
| 735 | } |
| 736 | } |
| 737 | } else if (!this._tokenizer.accept('eof')) { |
| 738 | while (!this._tokenizer.match('\n') && !this._tokenizer.match('eof') && !this._tokenizer.match('dedent')) { |
| 739 | if (this._tokenizer.accept(';')) { |
| 740 | continue; |
| 741 | } |
| 742 | statement = this._parseStatement(); |
| 743 | if (statement) { |
| 744 | body.push(statement); |
| 745 | continue; |
| 746 | } |
| 747 | throw new python.Error(`Empty statement ${this._location()}`); |
| 748 | } |
| 749 | this._tokenizer.accept('\n'); |
| 750 | } |
| 751 | return body; |
| 752 | } |
| 753 | _parseStatement() { |
| 754 | let node = null; |
| 755 | let position = this._position(); |
no test coverage detected