@@ -7,7 +7,7 @@ pub use crate::Location;
7
7
8
8
type Ident = String ;
9
9
10
- #[ derive( Debug , PartialEq ) ]
10
+ #[ derive( Clone , Debug , PartialEq ) ]
11
11
pub struct Located < T , U = ( ) > {
12
12
pub location : Location ,
13
13
pub custom : U ,
@@ -24,7 +24,7 @@ impl<T> Located<T> {
24
24
}
25
25
}
26
26
27
- #[ derive( Debug , PartialEq ) ]
27
+ #[ derive( Clone , Debug , PartialEq ) ]
28
28
pub enum Mod < U = ( ) > {
29
29
Module {
30
30
body : Vec < Stmt < U > > ,
@@ -42,7 +42,7 @@ pub enum Mod<U = ()> {
42
42
} ,
43
43
}
44
44
45
- #[ derive( Debug , PartialEq ) ]
45
+ #[ derive( Clone , Debug , PartialEq ) ]
46
46
pub enum StmtKind < U = ( ) > {
47
47
FunctionDef {
48
48
name : Ident ,
@@ -164,7 +164,7 @@ pub enum StmtKind<U = ()> {
164
164
}
165
165
pub type Stmt < U = ( ) > = Located < StmtKind < U > , U > ;
166
166
167
- #[ derive( Debug , PartialEq ) ]
167
+ #[ derive( Clone , Debug , PartialEq ) ]
168
168
pub enum ExprKind < U = ( ) > {
169
169
BoolOp {
170
170
op : Boolop ,
@@ -281,20 +281,20 @@ pub enum ExprKind<U = ()> {
281
281
}
282
282
pub type Expr < U = ( ) > = Located < ExprKind < U > , U > ;
283
283
284
- #[ derive( Debug , PartialEq ) ]
284
+ #[ derive( Clone , Debug , PartialEq ) ]
285
285
pub enum ExprContext {
286
286
Load ,
287
287
Store ,
288
288
Del ,
289
289
}
290
290
291
- #[ derive( Debug , PartialEq ) ]
291
+ #[ derive( Clone , Debug , PartialEq ) ]
292
292
pub enum Boolop {
293
293
And ,
294
294
Or ,
295
295
}
296
296
297
- #[ derive( Debug , PartialEq ) ]
297
+ #[ derive( Clone , Debug , PartialEq ) ]
298
298
pub enum Operator {
299
299
Add ,
300
300
Sub ,
@@ -311,15 +311,15 @@ pub enum Operator {
311
311
FloorDiv ,
312
312
}
313
313
314
- #[ derive( Debug , PartialEq ) ]
314
+ #[ derive( Clone , Debug , PartialEq ) ]
315
315
pub enum Unaryop {
316
316
Invert ,
317
317
Not ,
318
318
UAdd ,
319
319
USub ,
320
320
}
321
321
322
- #[ derive( Debug , PartialEq ) ]
322
+ #[ derive( Clone , Debug , PartialEq ) ]
323
323
pub enum Cmpop {
324
324
Eq ,
325
325
NotEq ,
@@ -333,15 +333,15 @@ pub enum Cmpop {
333
333
NotIn ,
334
334
}
335
335
336
- #[ derive( Debug , PartialEq ) ]
336
+ #[ derive( Clone , Debug , PartialEq ) ]
337
337
pub struct Comprehension < U = ( ) > {
338
338
pub target : Box < Expr < U > > ,
339
339
pub iter : Box < Expr < U > > ,
340
340
pub ifs : Vec < Expr < U > > ,
341
341
pub is_async : usize ,
342
342
}
343
343
344
- #[ derive( Debug , PartialEq ) ]
344
+ #[ derive( Clone , Debug , PartialEq ) ]
345
345
pub enum ExcepthandlerKind < U = ( ) > {
346
346
ExceptHandler {
347
347
type_ : Option < Box < Expr < U > > > ,
@@ -351,7 +351,7 @@ pub enum ExcepthandlerKind<U = ()> {
351
351
}
352
352
pub type Excepthandler < U = ( ) > = Located < ExcepthandlerKind < U > , U > ;
353
353
354
- #[ derive( Debug , PartialEq ) ]
354
+ #[ derive( Clone , Debug , PartialEq ) ]
355
355
pub struct Arguments < U = ( ) > {
356
356
pub posonlyargs : Vec < Arg < U > > ,
357
357
pub args : Vec < Arg < U > > ,
@@ -362,42 +362,42 @@ pub struct Arguments<U = ()> {
362
362
pub defaults : Vec < Expr < U > > ,
363
363
}
364
364
365
- #[ derive( Debug , PartialEq ) ]
365
+ #[ derive( Clone , Debug , PartialEq ) ]
366
366
pub struct ArgData < U = ( ) > {
367
367
pub arg : Ident ,
368
368
pub annotation : Option < Box < Expr < U > > > ,
369
369
pub type_comment : Option < String > ,
370
370
}
371
371
pub type Arg < U = ( ) > = Located < ArgData < U > , U > ;
372
372
373
- #[ derive( Debug , PartialEq ) ]
373
+ #[ derive( Clone , Debug , PartialEq ) ]
374
374
pub struct KeywordData < U = ( ) > {
375
375
pub arg : Option < Ident > ,
376
376
pub value : Box < Expr < U > > ,
377
377
}
378
378
pub type Keyword < U = ( ) > = Located < KeywordData < U > , U > ;
379
379
380
- #[ derive( Debug , PartialEq ) ]
380
+ #[ derive( Clone , Debug , PartialEq ) ]
381
381
pub struct AliasData {
382
382
pub name : Ident ,
383
383
pub asname : Option < Ident > ,
384
384
}
385
385
pub type Alias < U = ( ) > = Located < AliasData , U > ;
386
386
387
- #[ derive( Debug , PartialEq ) ]
387
+ #[ derive( Clone , Debug , PartialEq ) ]
388
388
pub struct Withitem < U = ( ) > {
389
389
pub context_expr : Box < Expr < U > > ,
390
390
pub optional_vars : Option < Box < Expr < U > > > ,
391
391
}
392
392
393
- #[ derive( Debug , PartialEq ) ]
393
+ #[ derive( Clone , Debug , PartialEq ) ]
394
394
pub struct MatchCase < U = ( ) > {
395
395
pub pattern : Box < Pattern < U > > ,
396
396
pub guard : Option < Box < Expr < U > > > ,
397
397
pub body : Vec < Stmt < U > > ,
398
398
}
399
399
400
- #[ derive( Debug , PartialEq ) ]
400
+ #[ derive( Clone , Debug , PartialEq ) ]
401
401
pub enum PatternKind < U = ( ) > {
402
402
MatchValue {
403
403
value : Box < Expr < U > > ,
@@ -432,7 +432,7 @@ pub enum PatternKind<U = ()> {
432
432
}
433
433
pub type Pattern < U = ( ) > = Located < PatternKind < U > , U > ;
434
434
435
- #[ derive( Debug , PartialEq ) ]
435
+ #[ derive( Clone , Debug , PartialEq ) ]
436
436
pub enum TypeIgnore {
437
437
TypeIgnore { lineno : usize , tag : String } ,
438
438
}
0 commit comments