https://docs.python.org/3/reference/compound_stmts.html#grammar-token-python-grammar-suite
(&mut self)
| 1119 | |
| 1120 | // https://docs.python.org/3/reference/compound_stmts.html#grammar-token-python-grammar-suite |
| 1121 | fn parse_suite(&mut self) -> Result<Vec<Statement>, ParsingError> { |
| 1122 | if self.eat(Kind::NewLine) { |
| 1123 | self.consume_whitespace_and_newline(); |
| 1124 | self.expect(Kind::Indent)?; |
| 1125 | let mut stmts = vec![]; |
| 1126 | while !self.eat(Kind::Dedent) && !self.at(Kind::Eof) { |
| 1127 | if self.eat(Kind::Comment) || self.consume_whitespace_and_newline() { |
| 1128 | continue; |
| 1129 | } |
| 1130 | let stmt = self.parse_statement()?; |
| 1131 | stmts.extend(stmt); |
| 1132 | } |
| 1133 | Ok(stmts) |
| 1134 | } else { |
| 1135 | let stmt = self.parse_statement_list()?; |
| 1136 | Ok(stmt) |
| 1137 | } |
| 1138 | } |
| 1139 | |
| 1140 | // https://docs.python.org/3/reference/compound_stmts.html#grammar-token-python-grammar-statement |
| 1141 | fn parse_statement(&mut self) -> Result<Vec<Statement>, ParsingError> { |
no test coverage detected