mirror of
https://github.com/astral-sh/ruff
synced 2026-01-07 14:44:17 -05:00
Add Decorator node (#7)
This commit is contained in:
committed by
Charlie Marsh
parent
8a415fa61e
commit
6f65c5cba7
@@ -1102,7 +1102,7 @@ def args_to_tuple(*args: *Ts) -> Tuple[*Ts]: ...
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "all-nodes-with-ranges"))]
|
||||
#[cfg(feature = "all-nodes-with-ranges")]
|
||||
fn decorator_ranges() {
|
||||
let parse_ast = parse_program(
|
||||
r#"
|
||||
|
||||
@@ -1151,9 +1151,9 @@ ClassDef: ast::Stmt = {
|
||||
};
|
||||
|
||||
// Decorators:
|
||||
Decorator: ast::Expr = {
|
||||
<location:@L> "@" <p:NamedExpressionTest> "\n" => {
|
||||
p
|
||||
Decorator: ast::Decorator = {
|
||||
<location:@L> "@" <p:NamedExpressionTest> <end_location:@R> "\n" => {
|
||||
ast::Decorator { range: optional_range(location, end_location), expression: p }
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
4221
parser/src/python.rs
generated
4221
parser/src/python.rs
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user