(&mut self)
| 452 | } |
| 453 | |
| 454 | fn parse_with_statement(&mut self) -> Result<Statement, ParsingError> { |
| 455 | let node = self.start_node(); |
| 456 | let is_async = self.eat(Kind::Async); |
| 457 | self.bump(Kind::With); |
| 458 | let items = self.parse_with_items()?; |
| 459 | self.expect(Kind::Colon)?; |
| 460 | let body = self.parse_suite()?; |
| 461 | |
| 462 | if is_async { |
| 463 | Ok(Statement::AsyncWithStatement(Box::new(AsyncWith { |
| 464 | node: self.finish_node_chomped(node), |
| 465 | items, |
| 466 | body, |
| 467 | }))) |
| 468 | } else { |
| 469 | Ok(Statement::WithStatement(Box::new(With { |
| 470 | node: self.finish_node_chomped(node), |
| 471 | items, |
| 472 | body, |
| 473 | }))) |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | fn parse_with_items(&mut self) -> Result<Vec<WithItem>, ParsingError> { |
| 478 | let mut items = vec![]; |
no test coverage detected