File tree Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ pub trait Visitor {
48
48
Ok ( ( ) )
49
49
}
50
50
51
+ /// This method is called between child nodes of a concatenation.
52
+ fn visit_concat_in ( & mut self ) -> Result < ( ) , Self :: Err > {
53
+ Ok ( ( ) )
54
+ }
55
+
51
56
/// This method is called on every [`ClassSetItem`](ast::ClassSetItem)
52
57
/// before descending into child nodes.
53
58
fn visit_class_set_item_pre (
@@ -228,8 +233,14 @@ impl<'a> HeapVisitor<'a> {
228
233
// If this is a concat/alternate, then we might have additional
229
234
// inductive steps to process.
230
235
if let Some ( x) = self . pop ( frame) {
231
- if let Frame :: Alternation { .. } = x {
232
- visitor. visit_alternation_in ( ) ?;
236
+ match x {
237
+ Frame :: Alternation { .. } => {
238
+ visitor. visit_alternation_in ( ) ?;
239
+ }
240
+ Frame :: Concat { .. } => {
241
+ visitor. visit_concat_in ( ) ?;
242
+ }
243
+ _ => { }
233
244
}
234
245
ast = x. child ( ) ;
235
246
self . stack . push ( ( post_ast, x) ) ;
Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ pub trait Visitor {
41
41
fn visit_alternation_in ( & mut self ) -> Result < ( ) , Self :: Err > {
42
42
Ok ( ( ) )
43
43
}
44
+
45
+ /// This method is called between child nodes of a concatenation.
46
+ fn visit_concat_in ( & mut self ) -> Result < ( ) , Self :: Err > {
47
+ Ok ( ( ) )
48
+ }
44
49
}
45
50
46
51
/// Executes an implementation of `Visitor` in constant stack space.
@@ -131,8 +136,14 @@ impl<'a> HeapVisitor<'a> {
131
136
// If this is a concat/alternate, then we might have additional
132
137
// inductive steps to process.
133
138
if let Some ( x) = self . pop ( frame) {
134
- if let Frame :: Alternation { .. } = x {
135
- visitor. visit_alternation_in ( ) ?;
139
+ match x {
140
+ Frame :: Alternation { .. } => {
141
+ visitor. visit_alternation_in ( ) ?;
142
+ }
143
+ Frame :: Concat { .. } => {
144
+ visitor. visit_concat_in ( ) ?;
145
+ }
146
+ _ => { }
136
147
}
137
148
hir = x. child ( ) ;
138
149
self . stack . push ( ( post_hir, x) ) ;
You can’t perform that action at this time.
0 commit comments