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

Method with_recursion

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

Source from the content-addressed store, hash-verified

109 #[must_use]
110 #[inline]
111 fn with_recursion<T>(&mut self, f: impl FnOnce(&mut Self) -> T) -> Option<T> {
112 if self.depth_remaining == 0 {
113 return None;
114 }
115
116 self.depth_remaining -= 1;
117 let result = f(self);
118 self.depth_remaining += 1;
119 Some(result)
120 }
121
122 #[cold]
123 #[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