MCPcopy Index your code
hub / github.com/RustPython/RustPython / prepare_decorators

Method prepare_decorators

crates/codegen/src/compile.rs:2831–2836  ·  view source on GitHub ↗

Push decorators onto the stack in source order. For @dec1 @dec2 def foo(): stack becomes [dec1, dec2]

(&mut self, decorator_list: &[ast::Decorator])

Source from the content-addressed store, hash-verified

2829 /// Push decorators onto the stack in source order.
2830 /// For @dec1 @dec2 def foo(): stack becomes [dec1, dec2]
2831 fn prepare_decorators(&mut self, decorator_list: &[ast::Decorator]) -> CompileResult<()> {
2832 for decorator in decorator_list {
2833 self.compile_expression(&decorator.expression)?;
2834 }
2835 Ok(())
2836 }
2837
2838 /// Apply decorators: each decorator calls the function below it.
2839 /// Stack: [dec1, dec2, func] → CALL 0 → [dec1, dec2(func)] → CALL 0 → [dec1(dec2(func))]

Callers 2

compile_function_defMethod · 0.80
compile_class_defMethod · 0.80

Calls 1

compile_expressionMethod · 0.80

Tested by

no test coverage detected