MCPcopy Create free account
hub / github.com/astral-sh/ruff / parse

Method parse

crates/ruff_python_parser/src/parser/mod.rs:183–192  ·  view source on GitHub ↗

Consumes the [`Parser`] and returns the parsed [`Parsed`].

(mut self)

Source from the content-addressed store, hash-verified

181
182 /// Consumes the [`Parser`] and returns the parsed [`Parsed`].
183 pub(crate) fn parse(mut self) -> Parsed<Mod> {
184 let syntax = stacker::maybe_grow(STACK_RED_ZONE, STACK_SIZE, || match self.options.mode {
185 Mode::Expression | Mode::ParenthesizedExpression => {
186 Mod::Expression(self.parse_single_expression())
187 }
188 Mode::Module | Mode::Ipython => Mod::Module(self.parse_module()),
189 });
190
191 self.finish(syntax)
192 }
193
194 /// Parses a single expression.
195 ///

Callers 8

parse_moduleFunction · 0.45
parse_expressionFunction · 0.45
parse_expression_rangeFunction · 0.45
parse_uncheckedFunction · 0.45
parse_unchecked_sourceFunction · 0.45
parse_cells_uncheckedFunction · 0.45
number_valuesFunction · 0.45

Calls 5

ExpressionClass · 0.85
parse_moduleMethod · 0.80
ModuleClass · 0.50
finishMethod · 0.45

Tested by 1

number_valuesFunction · 0.36