https://docs.python.org/3/reference/simple_stmts.html#the-nonlocal-statement
(&mut self)
| 1373 | |
| 1374 | // https://docs.python.org/3/reference/simple_stmts.html#the-nonlocal-statement |
| 1375 | fn parse_nonlocal_statement(&mut self) -> Result<Statement, ParsingError> { |
| 1376 | let node = self.start_node(); |
| 1377 | self.bump(Kind::Nonlocal); |
| 1378 | let mut names = vec![]; |
| 1379 | while self.at(Kind::Identifier) { |
| 1380 | let name = self.cur_token().to_string(self.source); |
| 1381 | names.push(name); |
| 1382 | self.bump(Kind::Identifier); |
| 1383 | if !self.eat(Kind::Comma) { |
| 1384 | break; |
| 1385 | } |
| 1386 | } |
| 1387 | Ok(Statement::Nonlocal(Box::new(Nonlocal { |
| 1388 | node: self.finish_node(node), |
| 1389 | names, |
| 1390 | }))) |
| 1391 | } |
| 1392 | |
| 1393 | // https://docs.python.org/3/reference/simple_stmts.html#the-import-statement |
| 1394 | fn parse_import_statement(&mut self) -> Result<Statement, ParsingError> { |
no test coverage detected