https://docs.python.org/3/reference/simple_stmts.html#the-global-statement
(&mut self)
| 1354 | |
| 1355 | // https://docs.python.org/3/reference/simple_stmts.html#the-global-statement |
| 1356 | fn parse_global_statement(&mut self) -> Result<Statement, ParsingError> { |
| 1357 | let node = self.start_node(); |
| 1358 | self.bump(Kind::Global); |
| 1359 | let mut names = vec![]; |
| 1360 | while self.at(Kind::Identifier) { |
| 1361 | let name = self.cur_token().to_string(self.source); |
| 1362 | names.push(name); |
| 1363 | self.bump(Kind::Identifier); |
| 1364 | if !self.eat(Kind::Comma) { |
| 1365 | break; |
| 1366 | } |
| 1367 | } |
| 1368 | Ok(Statement::Global(Box::new(Global { |
| 1369 | node: self.finish_node(node), |
| 1370 | names, |
| 1371 | }))) |
| 1372 | } |
| 1373 | |
| 1374 | // https://docs.python.org/3/reference/simple_stmts.html#the-nonlocal-statement |
| 1375 | fn parse_nonlocal_statement(&mut self) -> Result<Statement, ParsingError> { |
no test coverage detected