Consumes the current token if it matches the provided one and returns true, otherwise returns false
(token)
| 539 | |
| 540 | /** Consumes the current token if it matches the provided one and returns true, otherwise returns false */ |
| 541 | opt(token) { |
| 542 | if (this.tkn === token) { |
| 543 | this.nextToken(); |
| 544 | return true; |
| 545 | } |
| 546 | |
| 547 | return false; |
| 548 | } |
| 549 | |
| 550 | /** Consumes the current token if it matches the provided one, otherwise throws */ |
| 551 | expect(token) { |
no test coverage detected