()
| 488 | } |
| 489 | |
| 490 | func (self *_parser) parseThrowStatement() ast.Statement { |
| 491 | idx := self.expect(token.THROW) |
| 492 | |
| 493 | if self.implicitSemicolon { |
| 494 | if self.chr == -1 { // Hackish |
| 495 | self.error(idx, "Unexpected end of input") |
| 496 | } else { |
| 497 | self.error(idx, "Illegal newline after throw") |
| 498 | } |
| 499 | self.nextStatement() |
| 500 | return &ast.BadStatement{From: idx, To: self.idx} |
| 501 | } |
| 502 | |
| 503 | node := &ast.ThrowStatement{ |
| 504 | Throw: idx, |
| 505 | Argument: self.parseExpression(), |
| 506 | } |
| 507 | |
| 508 | self.semicolon() |
| 509 | |
| 510 | return node |
| 511 | } |
| 512 | |
| 513 | func (self *_parser) parseSwitchStatement() ast.Statement { |
| 514 | idx := self.expect(token.SWITCH) |
no test coverage detected