Add Decorator node (#7)

This commit is contained in:
Micha Reiser
2023-06-08 07:44:08 +02:00
committed by Charlie Marsh
parent 8a415fa61e
commit 6f65c5cba7
12 changed files with 2328 additions and 2101 deletions

View File

@@ -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#"

View File

@@ -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

File diff suppressed because it is too large Load Diff