()
| 447 | // Quietly expect a comma when in tolerant mode, otherwise delegates to expect(). |
| 448 | |
| 449 | expectCommaSeparator() { |
| 450 | if (this.config.tolerant) { |
| 451 | const token = this.lookahead; |
| 452 | if (token.type === Token.Punctuator && token.value === ',') { |
| 453 | this.nextToken(); |
| 454 | } else if (token.type === Token.Punctuator && token.value === ';') { |
| 455 | this.nextToken(); |
| 456 | this.tolerateUnexpectedToken(token); |
| 457 | } else { |
| 458 | this.tolerateUnexpectedToken(token, Messages.UnexpectedToken); |
| 459 | } |
| 460 | } else { |
| 461 | this.expect(','); |
| 462 | } |
| 463 | } |
| 464 | |
| 465 | // Expect the next token to match the specified keyword. |
| 466 | // If not, an exception will be thrown. |
no test coverage detected