Consumes the [`Parser`] and returns the parsed [`Parsed`].
(mut self)
| 154 | |
| 155 | /// Consumes the [`Parser`] and returns the parsed [`Parsed`]. |
| 156 | pub(crate) fn parse(mut self) -> Parsed<Mod> { |
| 157 | let syntax = self.maybe_grow_stack(|parser| match parser.options.mode { |
| 158 | Mode::Expression | Mode::ParenthesizedExpression => { |
| 159 | Mod::Expression(parser.parse_single_expression()) |
| 160 | } |
| 161 | Mode::Module | Mode::Ipython => Mod::Module(parser.parse_module()), |
| 162 | }); |
| 163 | |
| 164 | self.finish(syntax) |
| 165 | } |
| 166 | |
| 167 | /// Parses a single expression. |
| 168 | /// |