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

Method declare_lambda_parameter

crates/ty_python_core/src/builder.rs:3308–3328  ·  view source on GitHub ↗
(
        &mut self,
        index: usize,
        parameter: &'ast ast::ParameterWithDefault,
        lambda: &'ast ast::ExprLambda,
    )

Source from the content-addressed store, hash-verified

3306 }
3307
3308 fn declare_lambda_parameter(
3309 &mut self,
3310 index: usize,
3311 parameter: &'ast ast::ParameterWithDefault,
3312 lambda: &'ast ast::ExprLambda,
3313 ) {
3314 let symbol = self.add_symbol(parameter.name().id().clone());
3315
3316 self.add_definition(
3317 symbol.into(),
3318 LambdaParameterDefinitionNodeRef {
3319 index,
3320 lambda,
3321 parameter: ParameterDefinitionNodeRef::Parameter(parameter),
3322 },
3323 );
3324
3325 self.current_place_table_mut()
3326 .symbol_mut(symbol)
3327 .mark_parameter();
3328 }
3329
3330 /// Add an unpackable assignment for the given [`Unpackable`].
3331 ///

Callers 1

Calls 9

add_definitionMethod · 0.80
mark_parameterMethod · 0.80
ParameterClass · 0.50
add_symbolMethod · 0.45
cloneMethod · 0.45
idMethod · 0.45
nameMethod · 0.45
symbol_mutMethod · 0.45

Tested by

no test coverage detected