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

Method parse

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

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

(mut self)

Source from the content-addressed store, hash-verified

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

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