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

Method with_recursion

crates/ruff_python_parser/src/parser/mod.rs:169–178  ·  view source on GitHub ↗
(&mut self, f: impl FnOnce(&mut Self) -> T)

Source from the content-addressed store, hash-verified

167 #[must_use]
168 #[inline]
169 fn with_recursion<T>(&mut self, f: impl FnOnce(&mut Self) -> T) -> Option<T> {
170 if self.depth_remaining == 0 {
171 return None;
172 }
173
174 self.depth_remaining -= 1;
175 let result = f(self);
176 self.depth_remaining += 1;
177 Some(result)
178 }
179
180 #[cold]
181 #[inline(never)]

Callers 8

parse_lhs_expressionMethod · 0.80
parse_lambda_exprMethod · 0.80
parse_if_expressionMethod · 0.80
parse_async_statementMethod · 0.80
parse_blockMethod · 0.80
parse_match_patternMethod · 0.80

Calls 1

fFunction · 0.50

Tested by

no test coverage detected