https://docs.python.org/3/reference/simple_stmts.html#grammar-token-python-grammar-target_list
(&mut self)
| 1699 | |
| 1700 | // https://docs.python.org/3/reference/simple_stmts.html#grammar-token-python-grammar-target_list |
| 1701 | fn parse_target_list(&mut self) -> Result<Expression, ParsingError> { |
| 1702 | let node = self.start_node(); |
| 1703 | let mut targets = vec![]; |
| 1704 | loop { |
| 1705 | targets.push(self.parse_target()?); |
| 1706 | if !self.eat(Kind::Comma) || matches!(self.cur_kind(), Kind::NewLine | Kind::Eof) { |
| 1707 | break; |
| 1708 | } |
| 1709 | } |
| 1710 | if targets.len() == 1 { |
| 1711 | Ok(targets.remove(0)) |
| 1712 | } else { |
| 1713 | Ok(Expression::Tuple(Box::new(Tuple { |
| 1714 | node: self.finish_node(node), |
| 1715 | elements: targets, |
| 1716 | }))) |
| 1717 | } |
| 1718 | } |
| 1719 | |
| 1720 | // https://docs.python.org/3/reference/simple_stmts.html#grammar-token-python-grammar-target |
| 1721 | fn parse_target(&mut self) -> Result<Expression, ParsingError> { |
no test coverage detected