@@ -21,7 +21,7 @@ impl Default for PrintVisitor {
21
21
}
22
22
}
23
23
24
- impl < ' a > Visitor < ' a > for PrintVisitor {
24
+ impl Visitor for PrintVisitor {
25
25
fn enter_any ( & mut self ) {
26
26
self . level += 1 ;
27
27
}
@@ -30,21 +30,21 @@ impl<'a> Visitor<'a> for PrintVisitor {
30
30
self . level -= 1 ;
31
31
}
32
32
33
- fn enter_stored_definition ( & mut self , _def : & ' a ast:: StoredDefinition ) {
33
+ fn enter_stored_definition ( & mut self , _def : & mut ast:: StoredDefinition ) {
34
34
self . print ( "Stored Definition" ) ;
35
35
}
36
36
37
- fn enter_class_definition ( & mut self , def : & ' a ast:: ClassDefinition ) {
37
+ fn enter_class_definition ( & mut self , def : & mut ast:: ClassDefinition ) {
38
38
if let ast:: ClassSpecifier :: Long { name, .. } = & def. specifier {
39
39
self . print ( & format ! ( "class {}" , name) ) ;
40
40
}
41
41
}
42
42
43
- fn exit_class_definition ( & mut self , _def : & ' a ast:: ClassDefinition ) {
43
+ fn exit_class_definition ( & mut self , _def : & mut ast:: ClassDefinition ) {
44
44
println ! ( "\n " ) ;
45
45
}
46
46
47
- fn enter_expression ( & mut self , def : & ' a ast:: Expression ) {
47
+ fn enter_expression ( & mut self , def : & mut ast:: Expression ) {
48
48
match def {
49
49
ast:: Expression :: Binary { op, .. } => {
50
50
self . print ( & format ! ( "{:?}" , op) ) ;
@@ -79,7 +79,7 @@ impl<'a> Visitor<'a> for PrintVisitor {
79
79
}
80
80
}
81
81
82
- fn enter_equation ( & mut self , def : & ' a ast:: Equation ) {
82
+ fn enter_equation ( & mut self , def : & mut ast:: Equation ) {
83
83
match def {
84
84
ast:: Equation :: Connect { .. } => {
85
85
self . print ( "connect" ) ;
@@ -94,11 +94,11 @@ impl<'a> Visitor<'a> for PrintVisitor {
94
94
}
95
95
}
96
96
97
- fn exit_component_declaration ( & mut self , def : & ' a ast:: ComponentDeclaration ) {
97
+ fn enter_component_declaration ( & mut self , def : & mut ast:: ComponentDeclaration ) {
98
98
self . print ( & format ! ( "component: {}" , def. declaration. name) ) ;
99
99
}
100
100
101
- fn exit_component_reference ( & mut self , def : & ' a ast:: ComponentReference ) {
101
+ fn exit_component_reference ( & mut self , def : & mut ast:: ComponentReference ) {
102
102
let mut s: String = "" . to_string ( ) ;
103
103
for ( index, part) in def. parts . iter ( ) . enumerate ( ) {
104
104
if index != 0 || def. local {
0 commit comments