Consumes the [`Parser`] and returns the parsed [`Parsed`].
(mut self)
| 133 | |
| 134 | /// Consumes the [`Parser`] and returns the parsed [`Parsed`]. |
| 135 | pub(crate) fn parse(mut self) -> Parsed<Mod> { |
| 136 | let syntax = match self.options.mode { |
| 137 | Mode::Expression | Mode::ParenthesizedExpression => { |
| 138 | Mod::Expression(self.parse_single_expression()) |
| 139 | } |
| 140 | Mode::Module | Mode::Ipython => Mod::Module(self.parse_module()), |
| 141 | }; |
| 142 | |
| 143 | self.finish(syntax) |
| 144 | } |
| 145 | |
| 146 | /// Parses a single expression. |
| 147 | /// |