(type, value)
| 1796 | return false; |
| 1797 | } |
| 1798 | expect(type, value) { |
| 1799 | const token = this.peek(); |
| 1800 | if (token.type !== type) { |
| 1801 | throw new python.Error(`Unexpected '${token.value}' instead of '${type}' ${this.location()}`); |
| 1802 | } |
| 1803 | if (value && token.value !== value) { |
| 1804 | throw new python.Error(`Unexpected '${token.value}' instead of '${value}' ${this.location()}`); |
| 1805 | } |
| 1806 | this.read(); |
| 1807 | } |
| 1808 | location() { |
| 1809 | return `at ${this.filename}:${this.lineno}:${this.col_offset}.`; |
| 1810 | } |
no test coverage detected