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