Consumes the [`Parser`] and returns the parsed [`Parsed`].
(mut self)
| 191 | |
| 192 | /// Consumes the [`Parser`] and returns the parsed [`Parsed`]. |
| 193 | pub(crate) fn parse(mut self) -> Parsed<Mod> { |
| 194 | let syntax = match self.options.mode { |
| 195 | Mode::Expression | Mode::ParenthesizedExpression => { |
| 196 | Mod::Expression(self.parse_single_expression()) |
| 197 | } |
| 198 | Mode::Module | Mode::Ipython => Mod::Module(self.parse_module()), |
| 199 | }; |
| 200 | |
| 201 | self.finish(syntax) |
| 202 | } |
| 203 | |
| 204 | /// Parses a single expression. |
| 205 | /// |