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

Method recurse_binary

crates/ruff_python_formatter/src/expression/binary_like.rs:142–174  ·  view source on GitHub ↗
(
            binary: &'a ExprBinOp,
            leading_comments: &'a [SourceComment],
            trailing_comments: &'a [SourceComment],
            comments: &'a Comments,
            trivia: &Tri

Source from the content-addressed store, hash-verified

140 }
141
142 fn recurse_binary<'a>(
143 binary: &'a ExprBinOp,
144 leading_comments: &'a [SourceComment],
145 trailing_comments: &'a [SourceComment],
146 comments: &'a Comments,
147 trivia: &TriviaRanges,
148 parts: &mut SmallVec<[OperandOrOperator<'a>; 8]>,
149 ) {
150 rec(
151 Operand::Left {
152 leading_comments,
153 expression: &binary.left,
154 },
155 comments,
156 trivia,
157 parts,
158 );
159
160 parts.push(OperandOrOperator::Operator(Operator {
161 symbol: OperatorSymbol::Binary(binary.op),
162 trailing_comments: comments.dangling(binary),
163 }));
164
165 rec(
166 Operand::Right {
167 expression: binary.right.as_ref(),
168 trailing_comments,
169 },
170 comments,
171 trivia,
172 parts,
173 );
174 }
175
176 fn rec<'a>(
177 operand: Operand<'a>,

Callers

nothing calls this directly

Calls 4

OperatorClass · 0.70
pushMethod · 0.45
danglingMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected