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

Method parse

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

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

(mut self)

Source from the content-addressed store, hash-verified

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 ///

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