1#![doc = r" This file is generated by `tools/generate-code`. DO NOT MODIFY."]
2#![allow(unused_variables)]
3#![allow(clippy::all)]
4pub use ::swc_visit::All;
5use swc_ecma_regexp_ast::*;
6#[doc = r" A visitor trait for traversing the AST."]
7pub trait Visit {
8 #[doc = "Visit a node of type `Alternative`.\n\nBy default, this method calls \
9 [`Alternative::visit_children_with`]. If you want to recurse, you need to call it \
10 manually."]
11 #[inline]
12 fn visit_alternative(&mut self, node: &Alternative) {
13 <Alternative as VisitWith<Self>>::visit_children_with(node, self)
14 }
15 #[doc = "Visit a node of type `Vec < Alternative >`.\n\nBy default, this method calls [`Vec < \
16 Alternative >::visit_children_with`]. If you want to recurse, you need to call it \
17 manually."]
18 #[inline]
19 fn visit_alternatives(&mut self, node: &[Alternative]) {
20 <[Alternative] as VisitWith<Self>>::visit_children_with(node, self)
21 }
22 #[doc = "Visit a node of type `swc_atoms :: Atom`.\n\nBy default, this method calls \
23 [`swc_atoms :: Atom::visit_children_with`]. If you want to recurse, you need to call \
24 it manually."]
25 #[inline]
26 fn visit_atom(&mut self, node: &swc_atoms::Atom) {
27 <swc_atoms::Atom as VisitWith<Self>>::visit_children_with(node, self)
28 }
29 #[doc = "Visit a node of type `BoundaryAssertion`.\n\nBy default, this method calls \
30 [`BoundaryAssertion::visit_children_with`]. If you want to recurse, you need to call \
31 it manually."]
32 #[inline]
33 fn visit_boundary_assertion(&mut self, node: &BoundaryAssertion) {
34 <BoundaryAssertion as VisitWith<Self>>::visit_children_with(node, self)
35 }
36 #[doc = "Visit a node of type `BoundaryAssertionKind`.\n\nBy default, this method calls \
37 [`BoundaryAssertionKind::visit_children_with`]. If you want to recurse, you need to \
38 call it manually."]
39 #[inline]
40 fn visit_boundary_assertion_kind(&mut self, node: &BoundaryAssertionKind) {
41 <BoundaryAssertionKind as VisitWith<Self>>::visit_children_with(node, self)
42 }
43 #[doc = "Visit a node of type `CapturingGroup`.\n\nBy default, this method calls \
44 [`CapturingGroup::visit_children_with`]. If you want to recurse, you need to call it \
45 manually."]
46 #[inline]
47 fn visit_capturing_group(&mut self, node: &CapturingGroup) {
48 <CapturingGroup as VisitWith<Self>>::visit_children_with(node, self)
49 }
50 #[doc = "Visit a node of type `Character`.\n\nBy default, this method calls \
51 [`Character::visit_children_with`]. If you want to recurse, you need to call it \
52 manually."]
53 #[inline]
54 fn visit_character(&mut self, node: &Character) {
55 <Character as VisitWith<Self>>::visit_children_with(node, self)
56 }
57 #[doc = "Visit a node of type `CharacterClass`.\n\nBy default, this method calls \
58 [`CharacterClass::visit_children_with`]. If you want to recurse, you need to call it \
59 manually."]
60 #[inline]
61 fn visit_character_class(&mut self, node: &CharacterClass) {
62 <CharacterClass as VisitWith<Self>>::visit_children_with(node, self)
63 }
64 #[doc = "Visit a node of type `CharacterClassContents`.\n\nBy default, this method calls \
65 [`CharacterClassContents::visit_children_with`]. If you want to recurse, you need to \
66 call it manually."]
67 #[inline]
68 fn visit_character_class_contents(&mut self, node: &CharacterClassContents) {
69 <CharacterClassContents as VisitWith<Self>>::visit_children_with(node, self)
70 }
71 #[doc = "Visit a node of type `CharacterClassContentsKind`.\n\nBy default, this method calls \
72 [`CharacterClassContentsKind::visit_children_with`]. If you want to recurse, you need \
73 to call it manually."]
74 #[inline]
75 fn visit_character_class_contents_kind(&mut self, node: &CharacterClassContentsKind) {
76 <CharacterClassContentsKind as VisitWith<Self>>::visit_children_with(node, self)
77 }
78 #[doc = "Visit a node of type `Vec < CharacterClassContents >`.\n\nBy default, this method \
79 calls [`Vec < CharacterClassContents >::visit_children_with`]. If you want to \
80 recurse, you need to call it manually."]
81 #[inline]
82 fn visit_character_class_contentss(&mut self, node: &[CharacterClassContents]) {
83 <[CharacterClassContents] as VisitWith<Self>>::visit_children_with(node, self)
84 }
85 #[doc = "Visit a node of type `CharacterClassEscape`.\n\nBy default, this method calls \
86 [`CharacterClassEscape::visit_children_with`]. If you want to recurse, you need to \
87 call it manually."]
88 #[inline]
89 fn visit_character_class_escape(&mut self, node: &CharacterClassEscape) {
90 <CharacterClassEscape as VisitWith<Self>>::visit_children_with(node, self)
91 }
92 #[doc = "Visit a node of type `CharacterClassEscapeKind`.\n\nBy default, this method calls \
93 [`CharacterClassEscapeKind::visit_children_with`]. If you want to recurse, you need \
94 to call it manually."]
95 #[inline]
96 fn visit_character_class_escape_kind(&mut self, node: &CharacterClassEscapeKind) {
97 <CharacterClassEscapeKind as VisitWith<Self>>::visit_children_with(node, self)
98 }
99 #[doc = "Visit a node of type `CharacterClassRange`.\n\nBy default, this method calls \
100 [`CharacterClassRange::visit_children_with`]. If you want to recurse, you need to \
101 call it manually."]
102 #[inline]
103 fn visit_character_class_range(&mut self, node: &CharacterClassRange) {
104 <CharacterClassRange as VisitWith<Self>>::visit_children_with(node, self)
105 }
106 #[doc = "Visit a node of type `CharacterKind`.\n\nBy default, this method calls \
107 [`CharacterKind::visit_children_with`]. If you want to recurse, you need to call it \
108 manually."]
109 #[inline]
110 fn visit_character_kind(&mut self, node: &CharacterKind) {
111 <CharacterKind as VisitWith<Self>>::visit_children_with(node, self)
112 }
113 #[doc = "Visit a node of type `Vec < Character >`.\n\nBy default, this method calls [`Vec < \
114 Character >::visit_children_with`]. If you want to recurse, you need to call it \
115 manually."]
116 #[inline]
117 fn visit_characters(&mut self, node: &[Character]) {
118 <[Character] as VisitWith<Self>>::visit_children_with(node, self)
119 }
120 #[doc = "Visit a node of type `ClassString`.\n\nBy default, this method calls \
121 [`ClassString::visit_children_with`]. If you want to recurse, you need to call it \
122 manually."]
123 #[inline]
124 fn visit_class_string(&mut self, node: &ClassString) {
125 <ClassString as VisitWith<Self>>::visit_children_with(node, self)
126 }
127 #[doc = "Visit a node of type `ClassStringDisjunction`.\n\nBy default, this method calls \
128 [`ClassStringDisjunction::visit_children_with`]. If you want to recurse, you need to \
129 call it manually."]
130 #[inline]
131 fn visit_class_string_disjunction(&mut self, node: &ClassStringDisjunction) {
132 <ClassStringDisjunction as VisitWith<Self>>::visit_children_with(node, self)
133 }
134 #[doc = "Visit a node of type `Vec < ClassString >`.\n\nBy default, this method calls [`Vec < \
135 ClassString >::visit_children_with`]. If you want to recurse, you need to call it \
136 manually."]
137 #[inline]
138 fn visit_class_strings(&mut self, node: &[ClassString]) {
139 <[ClassString] as VisitWith<Self>>::visit_children_with(node, self)
140 }
141 #[doc = "Visit a node of type `Disjunction`.\n\nBy default, this method calls \
142 [`Disjunction::visit_children_with`]. If you want to recurse, you need to call it \
143 manually."]
144 #[inline]
145 fn visit_disjunction(&mut self, node: &Disjunction) {
146 <Disjunction as VisitWith<Self>>::visit_children_with(node, self)
147 }
148 #[doc = "Visit a node of type `Dot`.\n\nBy default, this method calls \
149 [`Dot::visit_children_with`]. If you want to recurse, you need to call it manually."]
150 #[inline]
151 fn visit_dot(&mut self, node: &Dot) {
152 <Dot as VisitWith<Self>>::visit_children_with(node, self)
153 }
154 #[doc = "Visit a node of type `IgnoreGroup`.\n\nBy default, this method calls \
155 [`IgnoreGroup::visit_children_with`]. If you want to recurse, you need to call it \
156 manually."]
157 #[inline]
158 fn visit_ignore_group(&mut self, node: &IgnoreGroup) {
159 <IgnoreGroup as VisitWith<Self>>::visit_children_with(node, self)
160 }
161 #[doc = "Visit a node of type `IndexedReference`.\n\nBy default, this method calls \
162 [`IndexedReference::visit_children_with`]. If you want to recurse, you need to call \
163 it manually."]
164 #[inline]
165 fn visit_indexed_reference(&mut self, node: &IndexedReference) {
166 <IndexedReference as VisitWith<Self>>::visit_children_with(node, self)
167 }
168 #[doc = "Visit a node of type `LookAroundAssertion`.\n\nBy default, this method calls \
169 [`LookAroundAssertion::visit_children_with`]. If you want to recurse, you need to \
170 call it manually."]
171 #[inline]
172 fn visit_look_around_assertion(&mut self, node: &LookAroundAssertion) {
173 <LookAroundAssertion as VisitWith<Self>>::visit_children_with(node, self)
174 }
175 #[doc = "Visit a node of type `LookAroundAssertionKind`.\n\nBy default, this method calls \
176 [`LookAroundAssertionKind::visit_children_with`]. If you want to recurse, you need to \
177 call it manually."]
178 #[inline]
179 fn visit_look_around_assertion_kind(&mut self, node: &LookAroundAssertionKind) {
180 <LookAroundAssertionKind as VisitWith<Self>>::visit_children_with(node, self)
181 }
182 #[doc = "Visit a node of type `Modifier`.\n\nBy default, this method calls \
183 [`Modifier::visit_children_with`]. If you want to recurse, you need to call it \
184 manually."]
185 #[inline]
186 fn visit_modifier(&mut self, node: &Modifier) {
187 <Modifier as VisitWith<Self>>::visit_children_with(node, self)
188 }
189 #[doc = "Visit a node of type `Modifiers`.\n\nBy default, this method calls \
190 [`Modifiers::visit_children_with`]. If you want to recurse, you need to call it \
191 manually."]
192 #[inline]
193 fn visit_modifiers(&mut self, node: &Modifiers) {
194 <Modifiers as VisitWith<Self>>::visit_children_with(node, self)
195 }
196 #[doc = "Visit a node of type `NamedReference`.\n\nBy default, this method calls \
197 [`NamedReference::visit_children_with`]. If you want to recurse, you need to call it \
198 manually."]
199 #[inline]
200 fn visit_named_reference(&mut self, node: &NamedReference) {
201 <NamedReference as VisitWith<Self>>::visit_children_with(node, self)
202 }
203 #[doc = "Visit a node of type `Option < swc_atoms :: Atom >`.\n\nBy default, this method calls \
204 [`Option < swc_atoms :: Atom >::visit_children_with`]. If you want to recurse, you \
205 need to call it manually."]
206 #[inline]
207 fn visit_opt_atom(&mut self, node: &Option<swc_atoms::Atom>) {
208 <Option<swc_atoms::Atom> as VisitWith<Self>>::visit_children_with(node, self)
209 }
210 #[doc = "Visit a node of type `Option < Modifiers >`.\n\nBy default, this method calls \
211 [`Option < Modifiers >::visit_children_with`]. If you want to recurse, you need to \
212 call it manually."]
213 #[inline]
214 fn visit_opt_modifiers(&mut self, node: &Option<Modifiers>) {
215 <Option<Modifiers> as VisitWith<Self>>::visit_children_with(node, self)
216 }
217 #[doc = "Visit a node of type `Pattern`.\n\nBy default, this method calls \
218 [`Pattern::visit_children_with`]. If you want to recurse, you need to call it \
219 manually."]
220 #[inline]
221 fn visit_pattern(&mut self, node: &Pattern) {
222 <Pattern as VisitWith<Self>>::visit_children_with(node, self)
223 }
224 #[doc = "Visit a node of type `Quantifier`.\n\nBy default, this method calls \
225 [`Quantifier::visit_children_with`]. If you want to recurse, you need to call it \
226 manually."]
227 #[inline]
228 fn visit_quantifier(&mut self, node: &Quantifier) {
229 <Quantifier as VisitWith<Self>>::visit_children_with(node, self)
230 }
231 #[doc = "Visit a node of type `swc_common :: Span`.\n\nBy default, this method calls \
232 [`swc_common :: Span::visit_children_with`]. If you want to recurse, you need to call \
233 it manually."]
234 #[inline]
235 fn visit_span(&mut self, node: &swc_common::Span) {
236 <swc_common::Span as VisitWith<Self>>::visit_children_with(node, self)
237 }
238 #[doc = "Visit a node of type `Term`.\n\nBy default, this method calls \
239 [`Term::visit_children_with`]. If you want to recurse, you need to call it manually."]
240 #[inline]
241 fn visit_term(&mut self, node: &Term) {
242 <Term as VisitWith<Self>>::visit_children_with(node, self)
243 }
244 #[doc = "Visit a node of type `Vec < Term >`.\n\nBy default, this method calls [`Vec < Term \
245 >::visit_children_with`]. If you want to recurse, you need to call it manually."]
246 #[inline]
247 fn visit_terms(&mut self, node: &[Term]) {
248 <[Term] as VisitWith<Self>>::visit_children_with(node, self)
249 }
250 #[doc = "Visit a node of type `UnicodePropertyEscape`.\n\nBy default, this method calls \
251 [`UnicodePropertyEscape::visit_children_with`]. If you want to recurse, you need to \
252 call it manually."]
253 #[inline]
254 fn visit_unicode_property_escape(&mut self, node: &UnicodePropertyEscape) {
255 <UnicodePropertyEscape as VisitWith<Self>>::visit_children_with(node, self)
256 }
257}
258impl<V> Visit for &mut V
259where
260 V: ?Sized + Visit,
261{
262 #[inline]
263 fn visit_alternative(&mut self, node: &Alternative) {
264 <V as Visit>::visit_alternative(&mut **self, node)
265 }
266
267 #[inline]
268 fn visit_alternatives(&mut self, node: &[Alternative]) {
269 <V as Visit>::visit_alternatives(&mut **self, node)
270 }
271
272 #[inline]
273 fn visit_atom(&mut self, node: &swc_atoms::Atom) {
274 <V as Visit>::visit_atom(&mut **self, node)
275 }
276
277 #[inline]
278 fn visit_boundary_assertion(&mut self, node: &BoundaryAssertion) {
279 <V as Visit>::visit_boundary_assertion(&mut **self, node)
280 }
281
282 #[inline]
283 fn visit_boundary_assertion_kind(&mut self, node: &BoundaryAssertionKind) {
284 <V as Visit>::visit_boundary_assertion_kind(&mut **self, node)
285 }
286
287 #[inline]
288 fn visit_capturing_group(&mut self, node: &CapturingGroup) {
289 <V as Visit>::visit_capturing_group(&mut **self, node)
290 }
291
292 #[inline]
293 fn visit_character(&mut self, node: &Character) {
294 <V as Visit>::visit_character(&mut **self, node)
295 }
296
297 #[inline]
298 fn visit_character_class(&mut self, node: &CharacterClass) {
299 <V as Visit>::visit_character_class(&mut **self, node)
300 }
301
302 #[inline]
303 fn visit_character_class_contents(&mut self, node: &CharacterClassContents) {
304 <V as Visit>::visit_character_class_contents(&mut **self, node)
305 }
306
307 #[inline]
308 fn visit_character_class_contents_kind(&mut self, node: &CharacterClassContentsKind) {
309 <V as Visit>::visit_character_class_contents_kind(&mut **self, node)
310 }
311
312 #[inline]
313 fn visit_character_class_contentss(&mut self, node: &[CharacterClassContents]) {
314 <V as Visit>::visit_character_class_contentss(&mut **self, node)
315 }
316
317 #[inline]
318 fn visit_character_class_escape(&mut self, node: &CharacterClassEscape) {
319 <V as Visit>::visit_character_class_escape(&mut **self, node)
320 }
321
322 #[inline]
323 fn visit_character_class_escape_kind(&mut self, node: &CharacterClassEscapeKind) {
324 <V as Visit>::visit_character_class_escape_kind(&mut **self, node)
325 }
326
327 #[inline]
328 fn visit_character_class_range(&mut self, node: &CharacterClassRange) {
329 <V as Visit>::visit_character_class_range(&mut **self, node)
330 }
331
332 #[inline]
333 fn visit_character_kind(&mut self, node: &CharacterKind) {
334 <V as Visit>::visit_character_kind(&mut **self, node)
335 }
336
337 #[inline]
338 fn visit_characters(&mut self, node: &[Character]) {
339 <V as Visit>::visit_characters(&mut **self, node)
340 }
341
342 #[inline]
343 fn visit_class_string(&mut self, node: &ClassString) {
344 <V as Visit>::visit_class_string(&mut **self, node)
345 }
346
347 #[inline]
348 fn visit_class_string_disjunction(&mut self, node: &ClassStringDisjunction) {
349 <V as Visit>::visit_class_string_disjunction(&mut **self, node)
350 }
351
352 #[inline]
353 fn visit_class_strings(&mut self, node: &[ClassString]) {
354 <V as Visit>::visit_class_strings(&mut **self, node)
355 }
356
357 #[inline]
358 fn visit_disjunction(&mut self, node: &Disjunction) {
359 <V as Visit>::visit_disjunction(&mut **self, node)
360 }
361
362 #[inline]
363 fn visit_dot(&mut self, node: &Dot) {
364 <V as Visit>::visit_dot(&mut **self, node)
365 }
366
367 #[inline]
368 fn visit_ignore_group(&mut self, node: &IgnoreGroup) {
369 <V as Visit>::visit_ignore_group(&mut **self, node)
370 }
371
372 #[inline]
373 fn visit_indexed_reference(&mut self, node: &IndexedReference) {
374 <V as Visit>::visit_indexed_reference(&mut **self, node)
375 }
376
377 #[inline]
378 fn visit_look_around_assertion(&mut self, node: &LookAroundAssertion) {
379 <V as Visit>::visit_look_around_assertion(&mut **self, node)
380 }
381
382 #[inline]
383 fn visit_look_around_assertion_kind(&mut self, node: &LookAroundAssertionKind) {
384 <V as Visit>::visit_look_around_assertion_kind(&mut **self, node)
385 }
386
387 #[inline]
388 fn visit_modifier(&mut self, node: &Modifier) {
389 <V as Visit>::visit_modifier(&mut **self, node)
390 }
391
392 #[inline]
393 fn visit_modifiers(&mut self, node: &Modifiers) {
394 <V as Visit>::visit_modifiers(&mut **self, node)
395 }
396
397 #[inline]
398 fn visit_named_reference(&mut self, node: &NamedReference) {
399 <V as Visit>::visit_named_reference(&mut **self, node)
400 }
401
402 #[inline]
403 fn visit_opt_atom(&mut self, node: &Option<swc_atoms::Atom>) {
404 <V as Visit>::visit_opt_atom(&mut **self, node)
405 }
406
407 #[inline]
408 fn visit_opt_modifiers(&mut self, node: &Option<Modifiers>) {
409 <V as Visit>::visit_opt_modifiers(&mut **self, node)
410 }
411
412 #[inline]
413 fn visit_pattern(&mut self, node: &Pattern) {
414 <V as Visit>::visit_pattern(&mut **self, node)
415 }
416
417 #[inline]
418 fn visit_quantifier(&mut self, node: &Quantifier) {
419 <V as Visit>::visit_quantifier(&mut **self, node)
420 }
421
422 #[inline]
423 fn visit_span(&mut self, node: &swc_common::Span) {
424 <V as Visit>::visit_span(&mut **self, node)
425 }
426
427 #[inline]
428 fn visit_term(&mut self, node: &Term) {
429 <V as Visit>::visit_term(&mut **self, node)
430 }
431
432 #[inline]
433 fn visit_terms(&mut self, node: &[Term]) {
434 <V as Visit>::visit_terms(&mut **self, node)
435 }
436
437 #[inline]
438 fn visit_unicode_property_escape(&mut self, node: &UnicodePropertyEscape) {
439 <V as Visit>::visit_unicode_property_escape(&mut **self, node)
440 }
441}
442impl<V> Visit for Box<V>
443where
444 V: ?Sized + Visit,
445{
446 #[inline]
447 fn visit_alternative(&mut self, node: &Alternative) {
448 <V as Visit>::visit_alternative(&mut **self, node)
449 }
450
451 #[inline]
452 fn visit_alternatives(&mut self, node: &[Alternative]) {
453 <V as Visit>::visit_alternatives(&mut **self, node)
454 }
455
456 #[inline]
457 fn visit_atom(&mut self, node: &swc_atoms::Atom) {
458 <V as Visit>::visit_atom(&mut **self, node)
459 }
460
461 #[inline]
462 fn visit_boundary_assertion(&mut self, node: &BoundaryAssertion) {
463 <V as Visit>::visit_boundary_assertion(&mut **self, node)
464 }
465
466 #[inline]
467 fn visit_boundary_assertion_kind(&mut self, node: &BoundaryAssertionKind) {
468 <V as Visit>::visit_boundary_assertion_kind(&mut **self, node)
469 }
470
471 #[inline]
472 fn visit_capturing_group(&mut self, node: &CapturingGroup) {
473 <V as Visit>::visit_capturing_group(&mut **self, node)
474 }
475
476 #[inline]
477 fn visit_character(&mut self, node: &Character) {
478 <V as Visit>::visit_character(&mut **self, node)
479 }
480
481 #[inline]
482 fn visit_character_class(&mut self, node: &CharacterClass) {
483 <V as Visit>::visit_character_class(&mut **self, node)
484 }
485
486 #[inline]
487 fn visit_character_class_contents(&mut self, node: &CharacterClassContents) {
488 <V as Visit>::visit_character_class_contents(&mut **self, node)
489 }
490
491 #[inline]
492 fn visit_character_class_contents_kind(&mut self, node: &CharacterClassContentsKind) {
493 <V as Visit>::visit_character_class_contents_kind(&mut **self, node)
494 }
495
496 #[inline]
497 fn visit_character_class_contentss(&mut self, node: &[CharacterClassContents]) {
498 <V as Visit>::visit_character_class_contentss(&mut **self, node)
499 }
500
501 #[inline]
502 fn visit_character_class_escape(&mut self, node: &CharacterClassEscape) {
503 <V as Visit>::visit_character_class_escape(&mut **self, node)
504 }
505
506 #[inline]
507 fn visit_character_class_escape_kind(&mut self, node: &CharacterClassEscapeKind) {
508 <V as Visit>::visit_character_class_escape_kind(&mut **self, node)
509 }
510
511 #[inline]
512 fn visit_character_class_range(&mut self, node: &CharacterClassRange) {
513 <V as Visit>::visit_character_class_range(&mut **self, node)
514 }
515
516 #[inline]
517 fn visit_character_kind(&mut self, node: &CharacterKind) {
518 <V as Visit>::visit_character_kind(&mut **self, node)
519 }
520
521 #[inline]
522 fn visit_characters(&mut self, node: &[Character]) {
523 <V as Visit>::visit_characters(&mut **self, node)
524 }
525
526 #[inline]
527 fn visit_class_string(&mut self, node: &ClassString) {
528 <V as Visit>::visit_class_string(&mut **self, node)
529 }
530
531 #[inline]
532 fn visit_class_string_disjunction(&mut self, node: &ClassStringDisjunction) {
533 <V as Visit>::visit_class_string_disjunction(&mut **self, node)
534 }
535
536 #[inline]
537 fn visit_class_strings(&mut self, node: &[ClassString]) {
538 <V as Visit>::visit_class_strings(&mut **self, node)
539 }
540
541 #[inline]
542 fn visit_disjunction(&mut self, node: &Disjunction) {
543 <V as Visit>::visit_disjunction(&mut **self, node)
544 }
545
546 #[inline]
547 fn visit_dot(&mut self, node: &Dot) {
548 <V as Visit>::visit_dot(&mut **self, node)
549 }
550
551 #[inline]
552 fn visit_ignore_group(&mut self, node: &IgnoreGroup) {
553 <V as Visit>::visit_ignore_group(&mut **self, node)
554 }
555
556 #[inline]
557 fn visit_indexed_reference(&mut self, node: &IndexedReference) {
558 <V as Visit>::visit_indexed_reference(&mut **self, node)
559 }
560
561 #[inline]
562 fn visit_look_around_assertion(&mut self, node: &LookAroundAssertion) {
563 <V as Visit>::visit_look_around_assertion(&mut **self, node)
564 }
565
566 #[inline]
567 fn visit_look_around_assertion_kind(&mut self, node: &LookAroundAssertionKind) {
568 <V as Visit>::visit_look_around_assertion_kind(&mut **self, node)
569 }
570
571 #[inline]
572 fn visit_modifier(&mut self, node: &Modifier) {
573 <V as Visit>::visit_modifier(&mut **self, node)
574 }
575
576 #[inline]
577 fn visit_modifiers(&mut self, node: &Modifiers) {
578 <V as Visit>::visit_modifiers(&mut **self, node)
579 }
580
581 #[inline]
582 fn visit_named_reference(&mut self, node: &NamedReference) {
583 <V as Visit>::visit_named_reference(&mut **self, node)
584 }
585
586 #[inline]
587 fn visit_opt_atom(&mut self, node: &Option<swc_atoms::Atom>) {
588 <V as Visit>::visit_opt_atom(&mut **self, node)
589 }
590
591 #[inline]
592 fn visit_opt_modifiers(&mut self, node: &Option<Modifiers>) {
593 <V as Visit>::visit_opt_modifiers(&mut **self, node)
594 }
595
596 #[inline]
597 fn visit_pattern(&mut self, node: &Pattern) {
598 <V as Visit>::visit_pattern(&mut **self, node)
599 }
600
601 #[inline]
602 fn visit_quantifier(&mut self, node: &Quantifier) {
603 <V as Visit>::visit_quantifier(&mut **self, node)
604 }
605
606 #[inline]
607 fn visit_span(&mut self, node: &swc_common::Span) {
608 <V as Visit>::visit_span(&mut **self, node)
609 }
610
611 #[inline]
612 fn visit_term(&mut self, node: &Term) {
613 <V as Visit>::visit_term(&mut **self, node)
614 }
615
616 #[inline]
617 fn visit_terms(&mut self, node: &[Term]) {
618 <V as Visit>::visit_terms(&mut **self, node)
619 }
620
621 #[inline]
622 fn visit_unicode_property_escape(&mut self, node: &UnicodePropertyEscape) {
623 <V as Visit>::visit_unicode_property_escape(&mut **self, node)
624 }
625}
626impl<A, B> Visit for ::swc_visit::Either<A, B>
627where
628 A: Visit,
629 B: Visit,
630{
631 #[inline]
632 fn visit_alternative(&mut self, node: &Alternative) {
633 match self {
634 swc_visit::Either::Left(visitor) => Visit::visit_alternative(visitor, node),
635 swc_visit::Either::Right(visitor) => Visit::visit_alternative(visitor, node),
636 }
637 }
638
639 #[inline]
640 fn visit_alternatives(&mut self, node: &[Alternative]) {
641 match self {
642 swc_visit::Either::Left(visitor) => Visit::visit_alternatives(visitor, node),
643 swc_visit::Either::Right(visitor) => Visit::visit_alternatives(visitor, node),
644 }
645 }
646
647 #[inline]
648 fn visit_atom(&mut self, node: &swc_atoms::Atom) {
649 match self {
650 swc_visit::Either::Left(visitor) => Visit::visit_atom(visitor, node),
651 swc_visit::Either::Right(visitor) => Visit::visit_atom(visitor, node),
652 }
653 }
654
655 #[inline]
656 fn visit_boundary_assertion(&mut self, node: &BoundaryAssertion) {
657 match self {
658 swc_visit::Either::Left(visitor) => Visit::visit_boundary_assertion(visitor, node),
659 swc_visit::Either::Right(visitor) => Visit::visit_boundary_assertion(visitor, node),
660 }
661 }
662
663 #[inline]
664 fn visit_boundary_assertion_kind(&mut self, node: &BoundaryAssertionKind) {
665 match self {
666 swc_visit::Either::Left(visitor) => Visit::visit_boundary_assertion_kind(visitor, node),
667 swc_visit::Either::Right(visitor) => {
668 Visit::visit_boundary_assertion_kind(visitor, node)
669 }
670 }
671 }
672
673 #[inline]
674 fn visit_capturing_group(&mut self, node: &CapturingGroup) {
675 match self {
676 swc_visit::Either::Left(visitor) => Visit::visit_capturing_group(visitor, node),
677 swc_visit::Either::Right(visitor) => Visit::visit_capturing_group(visitor, node),
678 }
679 }
680
681 #[inline]
682 fn visit_character(&mut self, node: &Character) {
683 match self {
684 swc_visit::Either::Left(visitor) => Visit::visit_character(visitor, node),
685 swc_visit::Either::Right(visitor) => Visit::visit_character(visitor, node),
686 }
687 }
688
689 #[inline]
690 fn visit_character_class(&mut self, node: &CharacterClass) {
691 match self {
692 swc_visit::Either::Left(visitor) => Visit::visit_character_class(visitor, node),
693 swc_visit::Either::Right(visitor) => Visit::visit_character_class(visitor, node),
694 }
695 }
696
697 #[inline]
698 fn visit_character_class_contents(&mut self, node: &CharacterClassContents) {
699 match self {
700 swc_visit::Either::Left(visitor) => {
701 Visit::visit_character_class_contents(visitor, node)
702 }
703 swc_visit::Either::Right(visitor) => {
704 Visit::visit_character_class_contents(visitor, node)
705 }
706 }
707 }
708
709 #[inline]
710 fn visit_character_class_contents_kind(&mut self, node: &CharacterClassContentsKind) {
711 match self {
712 swc_visit::Either::Left(visitor) => {
713 Visit::visit_character_class_contents_kind(visitor, node)
714 }
715 swc_visit::Either::Right(visitor) => {
716 Visit::visit_character_class_contents_kind(visitor, node)
717 }
718 }
719 }
720
721 #[inline]
722 fn visit_character_class_contentss(&mut self, node: &[CharacterClassContents]) {
723 match self {
724 swc_visit::Either::Left(visitor) => {
725 Visit::visit_character_class_contentss(visitor, node)
726 }
727 swc_visit::Either::Right(visitor) => {
728 Visit::visit_character_class_contentss(visitor, node)
729 }
730 }
731 }
732
733 #[inline]
734 fn visit_character_class_escape(&mut self, node: &CharacterClassEscape) {
735 match self {
736 swc_visit::Either::Left(visitor) => Visit::visit_character_class_escape(visitor, node),
737 swc_visit::Either::Right(visitor) => Visit::visit_character_class_escape(visitor, node),
738 }
739 }
740
741 #[inline]
742 fn visit_character_class_escape_kind(&mut self, node: &CharacterClassEscapeKind) {
743 match self {
744 swc_visit::Either::Left(visitor) => {
745 Visit::visit_character_class_escape_kind(visitor, node)
746 }
747 swc_visit::Either::Right(visitor) => {
748 Visit::visit_character_class_escape_kind(visitor, node)
749 }
750 }
751 }
752
753 #[inline]
754 fn visit_character_class_range(&mut self, node: &CharacterClassRange) {
755 match self {
756 swc_visit::Either::Left(visitor) => Visit::visit_character_class_range(visitor, node),
757 swc_visit::Either::Right(visitor) => Visit::visit_character_class_range(visitor, node),
758 }
759 }
760
761 #[inline]
762 fn visit_character_kind(&mut self, node: &CharacterKind) {
763 match self {
764 swc_visit::Either::Left(visitor) => Visit::visit_character_kind(visitor, node),
765 swc_visit::Either::Right(visitor) => Visit::visit_character_kind(visitor, node),
766 }
767 }
768
769 #[inline]
770 fn visit_characters(&mut self, node: &[Character]) {
771 match self {
772 swc_visit::Either::Left(visitor) => Visit::visit_characters(visitor, node),
773 swc_visit::Either::Right(visitor) => Visit::visit_characters(visitor, node),
774 }
775 }
776
777 #[inline]
778 fn visit_class_string(&mut self, node: &ClassString) {
779 match self {
780 swc_visit::Either::Left(visitor) => Visit::visit_class_string(visitor, node),
781 swc_visit::Either::Right(visitor) => Visit::visit_class_string(visitor, node),
782 }
783 }
784
785 #[inline]
786 fn visit_class_string_disjunction(&mut self, node: &ClassStringDisjunction) {
787 match self {
788 swc_visit::Either::Left(visitor) => {
789 Visit::visit_class_string_disjunction(visitor, node)
790 }
791 swc_visit::Either::Right(visitor) => {
792 Visit::visit_class_string_disjunction(visitor, node)
793 }
794 }
795 }
796
797 #[inline]
798 fn visit_class_strings(&mut self, node: &[ClassString]) {
799 match self {
800 swc_visit::Either::Left(visitor) => Visit::visit_class_strings(visitor, node),
801 swc_visit::Either::Right(visitor) => Visit::visit_class_strings(visitor, node),
802 }
803 }
804
805 #[inline]
806 fn visit_disjunction(&mut self, node: &Disjunction) {
807 match self {
808 swc_visit::Either::Left(visitor) => Visit::visit_disjunction(visitor, node),
809 swc_visit::Either::Right(visitor) => Visit::visit_disjunction(visitor, node),
810 }
811 }
812
813 #[inline]
814 fn visit_dot(&mut self, node: &Dot) {
815 match self {
816 swc_visit::Either::Left(visitor) => Visit::visit_dot(visitor, node),
817 swc_visit::Either::Right(visitor) => Visit::visit_dot(visitor, node),
818 }
819 }
820
821 #[inline]
822 fn visit_ignore_group(&mut self, node: &IgnoreGroup) {
823 match self {
824 swc_visit::Either::Left(visitor) => Visit::visit_ignore_group(visitor, node),
825 swc_visit::Either::Right(visitor) => Visit::visit_ignore_group(visitor, node),
826 }
827 }
828
829 #[inline]
830 fn visit_indexed_reference(&mut self, node: &IndexedReference) {
831 match self {
832 swc_visit::Either::Left(visitor) => Visit::visit_indexed_reference(visitor, node),
833 swc_visit::Either::Right(visitor) => Visit::visit_indexed_reference(visitor, node),
834 }
835 }
836
837 #[inline]
838 fn visit_look_around_assertion(&mut self, node: &LookAroundAssertion) {
839 match self {
840 swc_visit::Either::Left(visitor) => Visit::visit_look_around_assertion(visitor, node),
841 swc_visit::Either::Right(visitor) => Visit::visit_look_around_assertion(visitor, node),
842 }
843 }
844
845 #[inline]
846 fn visit_look_around_assertion_kind(&mut self, node: &LookAroundAssertionKind) {
847 match self {
848 swc_visit::Either::Left(visitor) => {
849 Visit::visit_look_around_assertion_kind(visitor, node)
850 }
851 swc_visit::Either::Right(visitor) => {
852 Visit::visit_look_around_assertion_kind(visitor, node)
853 }
854 }
855 }
856
857 #[inline]
858 fn visit_modifier(&mut self, node: &Modifier) {
859 match self {
860 swc_visit::Either::Left(visitor) => Visit::visit_modifier(visitor, node),
861 swc_visit::Either::Right(visitor) => Visit::visit_modifier(visitor, node),
862 }
863 }
864
865 #[inline]
866 fn visit_modifiers(&mut self, node: &Modifiers) {
867 match self {
868 swc_visit::Either::Left(visitor) => Visit::visit_modifiers(visitor, node),
869 swc_visit::Either::Right(visitor) => Visit::visit_modifiers(visitor, node),
870 }
871 }
872
873 #[inline]
874 fn visit_named_reference(&mut self, node: &NamedReference) {
875 match self {
876 swc_visit::Either::Left(visitor) => Visit::visit_named_reference(visitor, node),
877 swc_visit::Either::Right(visitor) => Visit::visit_named_reference(visitor, node),
878 }
879 }
880
881 #[inline]
882 fn visit_opt_atom(&mut self, node: &Option<swc_atoms::Atom>) {
883 match self {
884 swc_visit::Either::Left(visitor) => Visit::visit_opt_atom(visitor, node),
885 swc_visit::Either::Right(visitor) => Visit::visit_opt_atom(visitor, node),
886 }
887 }
888
889 #[inline]
890 fn visit_opt_modifiers(&mut self, node: &Option<Modifiers>) {
891 match self {
892 swc_visit::Either::Left(visitor) => Visit::visit_opt_modifiers(visitor, node),
893 swc_visit::Either::Right(visitor) => Visit::visit_opt_modifiers(visitor, node),
894 }
895 }
896
897 #[inline]
898 fn visit_pattern(&mut self, node: &Pattern) {
899 match self {
900 swc_visit::Either::Left(visitor) => Visit::visit_pattern(visitor, node),
901 swc_visit::Either::Right(visitor) => Visit::visit_pattern(visitor, node),
902 }
903 }
904
905 #[inline]
906 fn visit_quantifier(&mut self, node: &Quantifier) {
907 match self {
908 swc_visit::Either::Left(visitor) => Visit::visit_quantifier(visitor, node),
909 swc_visit::Either::Right(visitor) => Visit::visit_quantifier(visitor, node),
910 }
911 }
912
913 #[inline]
914 fn visit_span(&mut self, node: &swc_common::Span) {
915 match self {
916 swc_visit::Either::Left(visitor) => Visit::visit_span(visitor, node),
917 swc_visit::Either::Right(visitor) => Visit::visit_span(visitor, node),
918 }
919 }
920
921 #[inline]
922 fn visit_term(&mut self, node: &Term) {
923 match self {
924 swc_visit::Either::Left(visitor) => Visit::visit_term(visitor, node),
925 swc_visit::Either::Right(visitor) => Visit::visit_term(visitor, node),
926 }
927 }
928
929 #[inline]
930 fn visit_terms(&mut self, node: &[Term]) {
931 match self {
932 swc_visit::Either::Left(visitor) => Visit::visit_terms(visitor, node),
933 swc_visit::Either::Right(visitor) => Visit::visit_terms(visitor, node),
934 }
935 }
936
937 #[inline]
938 fn visit_unicode_property_escape(&mut self, node: &UnicodePropertyEscape) {
939 match self {
940 swc_visit::Either::Left(visitor) => Visit::visit_unicode_property_escape(visitor, node),
941 swc_visit::Either::Right(visitor) => {
942 Visit::visit_unicode_property_escape(visitor, node)
943 }
944 }
945 }
946}
947impl<V> Visit for ::swc_visit::Optional<V>
948where
949 V: Visit,
950{
951 #[inline]
952 fn visit_alternative(&mut self, node: &Alternative) {
953 if self.enabled {
954 <V as Visit>::visit_alternative(&mut self.visitor, node)
955 } else {
956 }
957 }
958
959 #[inline]
960 fn visit_alternatives(&mut self, node: &[Alternative]) {
961 if self.enabled {
962 <V as Visit>::visit_alternatives(&mut self.visitor, node)
963 } else {
964 }
965 }
966
967 #[inline]
968 fn visit_atom(&mut self, node: &swc_atoms::Atom) {
969 if self.enabled {
970 <V as Visit>::visit_atom(&mut self.visitor, node)
971 } else {
972 }
973 }
974
975 #[inline]
976 fn visit_boundary_assertion(&mut self, node: &BoundaryAssertion) {
977 if self.enabled {
978 <V as Visit>::visit_boundary_assertion(&mut self.visitor, node)
979 } else {
980 }
981 }
982
983 #[inline]
984 fn visit_boundary_assertion_kind(&mut self, node: &BoundaryAssertionKind) {
985 if self.enabled {
986 <V as Visit>::visit_boundary_assertion_kind(&mut self.visitor, node)
987 } else {
988 }
989 }
990
991 #[inline]
992 fn visit_capturing_group(&mut self, node: &CapturingGroup) {
993 if self.enabled {
994 <V as Visit>::visit_capturing_group(&mut self.visitor, node)
995 } else {
996 }
997 }
998
999 #[inline]
1000 fn visit_character(&mut self, node: &Character) {
1001 if self.enabled {
1002 <V as Visit>::visit_character(&mut self.visitor, node)
1003 } else {
1004 }
1005 }
1006
1007 #[inline]
1008 fn visit_character_class(&mut self, node: &CharacterClass) {
1009 if self.enabled {
1010 <V as Visit>::visit_character_class(&mut self.visitor, node)
1011 } else {
1012 }
1013 }
1014
1015 #[inline]
1016 fn visit_character_class_contents(&mut self, node: &CharacterClassContents) {
1017 if self.enabled {
1018 <V as Visit>::visit_character_class_contents(&mut self.visitor, node)
1019 } else {
1020 }
1021 }
1022
1023 #[inline]
1024 fn visit_character_class_contents_kind(&mut self, node: &CharacterClassContentsKind) {
1025 if self.enabled {
1026 <V as Visit>::visit_character_class_contents_kind(&mut self.visitor, node)
1027 } else {
1028 }
1029 }
1030
1031 #[inline]
1032 fn visit_character_class_contentss(&mut self, node: &[CharacterClassContents]) {
1033 if self.enabled {
1034 <V as Visit>::visit_character_class_contentss(&mut self.visitor, node)
1035 } else {
1036 }
1037 }
1038
1039 #[inline]
1040 fn visit_character_class_escape(&mut self, node: &CharacterClassEscape) {
1041 if self.enabled {
1042 <V as Visit>::visit_character_class_escape(&mut self.visitor, node)
1043 } else {
1044 }
1045 }
1046
1047 #[inline]
1048 fn visit_character_class_escape_kind(&mut self, node: &CharacterClassEscapeKind) {
1049 if self.enabled {
1050 <V as Visit>::visit_character_class_escape_kind(&mut self.visitor, node)
1051 } else {
1052 }
1053 }
1054
1055 #[inline]
1056 fn visit_character_class_range(&mut self, node: &CharacterClassRange) {
1057 if self.enabled {
1058 <V as Visit>::visit_character_class_range(&mut self.visitor, node)
1059 } else {
1060 }
1061 }
1062
1063 #[inline]
1064 fn visit_character_kind(&mut self, node: &CharacterKind) {
1065 if self.enabled {
1066 <V as Visit>::visit_character_kind(&mut self.visitor, node)
1067 } else {
1068 }
1069 }
1070
1071 #[inline]
1072 fn visit_characters(&mut self, node: &[Character]) {
1073 if self.enabled {
1074 <V as Visit>::visit_characters(&mut self.visitor, node)
1075 } else {
1076 }
1077 }
1078
1079 #[inline]
1080 fn visit_class_string(&mut self, node: &ClassString) {
1081 if self.enabled {
1082 <V as Visit>::visit_class_string(&mut self.visitor, node)
1083 } else {
1084 }
1085 }
1086
1087 #[inline]
1088 fn visit_class_string_disjunction(&mut self, node: &ClassStringDisjunction) {
1089 if self.enabled {
1090 <V as Visit>::visit_class_string_disjunction(&mut self.visitor, node)
1091 } else {
1092 }
1093 }
1094
1095 #[inline]
1096 fn visit_class_strings(&mut self, node: &[ClassString]) {
1097 if self.enabled {
1098 <V as Visit>::visit_class_strings(&mut self.visitor, node)
1099 } else {
1100 }
1101 }
1102
1103 #[inline]
1104 fn visit_disjunction(&mut self, node: &Disjunction) {
1105 if self.enabled {
1106 <V as Visit>::visit_disjunction(&mut self.visitor, node)
1107 } else {
1108 }
1109 }
1110
1111 #[inline]
1112 fn visit_dot(&mut self, node: &Dot) {
1113 if self.enabled {
1114 <V as Visit>::visit_dot(&mut self.visitor, node)
1115 } else {
1116 }
1117 }
1118
1119 #[inline]
1120 fn visit_ignore_group(&mut self, node: &IgnoreGroup) {
1121 if self.enabled {
1122 <V as Visit>::visit_ignore_group(&mut self.visitor, node)
1123 } else {
1124 }
1125 }
1126
1127 #[inline]
1128 fn visit_indexed_reference(&mut self, node: &IndexedReference) {
1129 if self.enabled {
1130 <V as Visit>::visit_indexed_reference(&mut self.visitor, node)
1131 } else {
1132 }
1133 }
1134
1135 #[inline]
1136 fn visit_look_around_assertion(&mut self, node: &LookAroundAssertion) {
1137 if self.enabled {
1138 <V as Visit>::visit_look_around_assertion(&mut self.visitor, node)
1139 } else {
1140 }
1141 }
1142
1143 #[inline]
1144 fn visit_look_around_assertion_kind(&mut self, node: &LookAroundAssertionKind) {
1145 if self.enabled {
1146 <V as Visit>::visit_look_around_assertion_kind(&mut self.visitor, node)
1147 } else {
1148 }
1149 }
1150
1151 #[inline]
1152 fn visit_modifier(&mut self, node: &Modifier) {
1153 if self.enabled {
1154 <V as Visit>::visit_modifier(&mut self.visitor, node)
1155 } else {
1156 }
1157 }
1158
1159 #[inline]
1160 fn visit_modifiers(&mut self, node: &Modifiers) {
1161 if self.enabled {
1162 <V as Visit>::visit_modifiers(&mut self.visitor, node)
1163 } else {
1164 }
1165 }
1166
1167 #[inline]
1168 fn visit_named_reference(&mut self, node: &NamedReference) {
1169 if self.enabled {
1170 <V as Visit>::visit_named_reference(&mut self.visitor, node)
1171 } else {
1172 }
1173 }
1174
1175 #[inline]
1176 fn visit_opt_atom(&mut self, node: &Option<swc_atoms::Atom>) {
1177 if self.enabled {
1178 <V as Visit>::visit_opt_atom(&mut self.visitor, node)
1179 } else {
1180 }
1181 }
1182
1183 #[inline]
1184 fn visit_opt_modifiers(&mut self, node: &Option<Modifiers>) {
1185 if self.enabled {
1186 <V as Visit>::visit_opt_modifiers(&mut self.visitor, node)
1187 } else {
1188 }
1189 }
1190
1191 #[inline]
1192 fn visit_pattern(&mut self, node: &Pattern) {
1193 if self.enabled {
1194 <V as Visit>::visit_pattern(&mut self.visitor, node)
1195 } else {
1196 }
1197 }
1198
1199 #[inline]
1200 fn visit_quantifier(&mut self, node: &Quantifier) {
1201 if self.enabled {
1202 <V as Visit>::visit_quantifier(&mut self.visitor, node)
1203 } else {
1204 }
1205 }
1206
1207 #[inline]
1208 fn visit_span(&mut self, node: &swc_common::Span) {
1209 if self.enabled {
1210 <V as Visit>::visit_span(&mut self.visitor, node)
1211 } else {
1212 }
1213 }
1214
1215 #[inline]
1216 fn visit_term(&mut self, node: &Term) {
1217 if self.enabled {
1218 <V as Visit>::visit_term(&mut self.visitor, node)
1219 } else {
1220 }
1221 }
1222
1223 #[inline]
1224 fn visit_terms(&mut self, node: &[Term]) {
1225 if self.enabled {
1226 <V as Visit>::visit_terms(&mut self.visitor, node)
1227 } else {
1228 }
1229 }
1230
1231 #[inline]
1232 fn visit_unicode_property_escape(&mut self, node: &UnicodePropertyEscape) {
1233 if self.enabled {
1234 <V as Visit>::visit_unicode_property_escape(&mut self.visitor, node)
1235 } else {
1236 }
1237 }
1238}
1239#[doc = r" A trait implemented for types that can be visited using a visitor."]
1240pub trait VisitWith<V: ?Sized + Visit> {
1241 #[doc = r" Calls a visitor method (visitor.fold_xxx) with self."]
1242 fn visit_with(&self, visitor: &mut V);
1243 #[doc = r" Visit children nodes of `self`` with `visitor`."]
1244 fn visit_children_with(&self, visitor: &mut V);
1245}
1246impl<V: ?Sized + Visit> VisitWith<V> for Alternative {
1247 #[doc = "Calls [Visit`::visit_alternative`] with `self`."]
1248 fn visit_with(&self, visitor: &mut V) {
1249 <V as Visit>::visit_alternative(visitor, self)
1250 }
1251
1252 fn visit_children_with(&self, visitor: &mut V) {
1253 match self {
1254 Alternative { span, body } => {
1255 {
1256 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1257 };
1258 {
1259 <Vec<Term> as VisitWith<V>>::visit_with(body, visitor)
1260 };
1261 }
1262 }
1263 }
1264}
1265impl<V: ?Sized + Visit> VisitWith<V> for BoundaryAssertion {
1266 #[doc = "Calls [Visit`::visit_boundary_assertion`] with `self`."]
1267 fn visit_with(&self, visitor: &mut V) {
1268 <V as Visit>::visit_boundary_assertion(visitor, self)
1269 }
1270
1271 fn visit_children_with(&self, visitor: &mut V) {
1272 match self {
1273 BoundaryAssertion { span, kind } => {
1274 {
1275 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1276 };
1277 {
1278 <BoundaryAssertionKind as VisitWith<V>>::visit_with(kind, visitor)
1279 };
1280 }
1281 }
1282 }
1283}
1284impl<V: ?Sized + Visit> VisitWith<V> for BoundaryAssertionKind {
1285 #[doc = "Calls [Visit`::visit_boundary_assertion_kind`] with `self`."]
1286 fn visit_with(&self, visitor: &mut V) {
1287 <V as Visit>::visit_boundary_assertion_kind(visitor, self)
1288 }
1289
1290 fn visit_children_with(&self, visitor: &mut V) {
1291 match self {
1292 BoundaryAssertionKind::Start => {}
1293 BoundaryAssertionKind::End => {}
1294 BoundaryAssertionKind::Boundary => {}
1295 BoundaryAssertionKind::NegativeBoundary => {}
1296 }
1297 }
1298}
1299impl<V: ?Sized + Visit> VisitWith<V> for CapturingGroup {
1300 #[doc = "Calls [Visit`::visit_capturing_group`] with `self`."]
1301 fn visit_with(&self, visitor: &mut V) {
1302 <V as Visit>::visit_capturing_group(visitor, self)
1303 }
1304
1305 fn visit_children_with(&self, visitor: &mut V) {
1306 match self {
1307 CapturingGroup { span, name, body } => {
1308 {
1309 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1310 };
1311 {
1312 <Option<swc_atoms::Atom> as VisitWith<V>>::visit_with(name, visitor)
1313 };
1314 {
1315 <Disjunction as VisitWith<V>>::visit_with(body, visitor)
1316 };
1317 }
1318 }
1319 }
1320}
1321impl<V: ?Sized + Visit> VisitWith<V> for Character {
1322 #[doc = "Calls [Visit`::visit_character`] with `self`."]
1323 fn visit_with(&self, visitor: &mut V) {
1324 <V as Visit>::visit_character(visitor, self)
1325 }
1326
1327 fn visit_children_with(&self, visitor: &mut V) {
1328 match self {
1329 Character { span, kind, value } => {
1330 {
1331 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1332 };
1333 {
1334 <CharacterKind as VisitWith<V>>::visit_with(kind, visitor)
1335 };
1336 }
1337 }
1338 }
1339}
1340impl<V: ?Sized + Visit> VisitWith<V> for CharacterClass {
1341 #[doc = "Calls [Visit`::visit_character_class`] with `self`."]
1342 fn visit_with(&self, visitor: &mut V) {
1343 <V as Visit>::visit_character_class(visitor, self)
1344 }
1345
1346 fn visit_children_with(&self, visitor: &mut V) {
1347 match self {
1348 CharacterClass {
1349 span,
1350 negative,
1351 strings,
1352 kind,
1353 body,
1354 } => {
1355 {
1356 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1357 };
1358 {
1359 <CharacterClassContentsKind as VisitWith<V>>::visit_with(kind, visitor)
1360 };
1361 {
1362 <Vec<CharacterClassContents> as VisitWith<V>>::visit_with(body, visitor)
1363 };
1364 }
1365 }
1366 }
1367}
1368impl<V: ?Sized + Visit> VisitWith<V> for CharacterClassContents {
1369 #[doc = "Calls [Visit`::visit_character_class_contents`] with `self`."]
1370 fn visit_with(&self, visitor: &mut V) {
1371 <V as Visit>::visit_character_class_contents(visitor, self)
1372 }
1373
1374 fn visit_children_with(&self, visitor: &mut V) {
1375 match self {
1376 CharacterClassContents::CharacterClassRange { 0: _field_0 } => {
1377 <Box<CharacterClassRange> as VisitWith<V>>::visit_with(_field_0, visitor);
1378 }
1379 CharacterClassContents::CharacterClassEscape { 0: _field_0 } => {
1380 <Box<CharacterClassEscape> as VisitWith<V>>::visit_with(_field_0, visitor);
1381 }
1382 CharacterClassContents::UnicodePropertyEscape { 0: _field_0 } => {
1383 <Box<UnicodePropertyEscape> as VisitWith<V>>::visit_with(_field_0, visitor);
1384 }
1385 CharacterClassContents::Character { 0: _field_0 } => {
1386 <Box<Character> as VisitWith<V>>::visit_with(_field_0, visitor);
1387 }
1388 CharacterClassContents::NestedCharacterClass { 0: _field_0 } => {
1389 <Box<CharacterClass> as VisitWith<V>>::visit_with(_field_0, visitor);
1390 }
1391 CharacterClassContents::ClassStringDisjunction { 0: _field_0 } => {
1392 <Box<ClassStringDisjunction> as VisitWith<V>>::visit_with(_field_0, visitor);
1393 }
1394 }
1395 }
1396}
1397impl<V: ?Sized + Visit> VisitWith<V> for CharacterClassContentsKind {
1398 #[doc = "Calls [Visit`::visit_character_class_contents_kind`] with `self`."]
1399 fn visit_with(&self, visitor: &mut V) {
1400 <V as Visit>::visit_character_class_contents_kind(visitor, self)
1401 }
1402
1403 fn visit_children_with(&self, visitor: &mut V) {
1404 match self {
1405 CharacterClassContentsKind::Union => {}
1406 CharacterClassContentsKind::Intersection => {}
1407 CharacterClassContentsKind::Subtraction => {}
1408 }
1409 }
1410}
1411impl<V: ?Sized + Visit> VisitWith<V> for CharacterClassEscape {
1412 #[doc = "Calls [Visit`::visit_character_class_escape`] with `self`."]
1413 fn visit_with(&self, visitor: &mut V) {
1414 <V as Visit>::visit_character_class_escape(visitor, self)
1415 }
1416
1417 fn visit_children_with(&self, visitor: &mut V) {
1418 match self {
1419 CharacterClassEscape { span, kind } => {
1420 {
1421 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1422 };
1423 {
1424 <CharacterClassEscapeKind as VisitWith<V>>::visit_with(kind, visitor)
1425 };
1426 }
1427 }
1428 }
1429}
1430impl<V: ?Sized + Visit> VisitWith<V> for CharacterClassEscapeKind {
1431 #[doc = "Calls [Visit`::visit_character_class_escape_kind`] with `self`."]
1432 fn visit_with(&self, visitor: &mut V) {
1433 <V as Visit>::visit_character_class_escape_kind(visitor, self)
1434 }
1435
1436 fn visit_children_with(&self, visitor: &mut V) {
1437 match self {
1438 CharacterClassEscapeKind::D => {}
1439 CharacterClassEscapeKind::NegativeD => {}
1440 CharacterClassEscapeKind::S => {}
1441 CharacterClassEscapeKind::NegativeS => {}
1442 CharacterClassEscapeKind::W => {}
1443 CharacterClassEscapeKind::NegativeW => {}
1444 }
1445 }
1446}
1447impl<V: ?Sized + Visit> VisitWith<V> for CharacterClassRange {
1448 #[doc = "Calls [Visit`::visit_character_class_range`] with `self`."]
1449 fn visit_with(&self, visitor: &mut V) {
1450 <V as Visit>::visit_character_class_range(visitor, self)
1451 }
1452
1453 fn visit_children_with(&self, visitor: &mut V) {
1454 match self {
1455 CharacterClassRange { span, min, max } => {
1456 {
1457 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1458 };
1459 {
1460 <Character as VisitWith<V>>::visit_with(min, visitor)
1461 };
1462 {
1463 <Character as VisitWith<V>>::visit_with(max, visitor)
1464 };
1465 }
1466 }
1467 }
1468}
1469impl<V: ?Sized + Visit> VisitWith<V> for CharacterKind {
1470 #[doc = "Calls [Visit`::visit_character_kind`] with `self`."]
1471 fn visit_with(&self, visitor: &mut V) {
1472 <V as Visit>::visit_character_kind(visitor, self)
1473 }
1474
1475 fn visit_children_with(&self, visitor: &mut V) {
1476 match self {
1477 CharacterKind::ControlLetter => {}
1478 CharacterKind::HexadecimalEscape => {}
1479 CharacterKind::Identifier => {}
1480 CharacterKind::Null => {}
1481 CharacterKind::Octal1 => {}
1482 CharacterKind::Octal2 => {}
1483 CharacterKind::Octal3 => {}
1484 CharacterKind::SingleEscape => {}
1485 CharacterKind::Symbol => {}
1486 CharacterKind::UnicodeEscape => {}
1487 }
1488 }
1489}
1490impl<V: ?Sized + Visit> VisitWith<V> for ClassString {
1491 #[doc = "Calls [Visit`::visit_class_string`] with `self`."]
1492 fn visit_with(&self, visitor: &mut V) {
1493 <V as Visit>::visit_class_string(visitor, self)
1494 }
1495
1496 fn visit_children_with(&self, visitor: &mut V) {
1497 match self {
1498 ClassString {
1499 span,
1500 strings,
1501 body,
1502 } => {
1503 {
1504 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1505 };
1506 {
1507 <Vec<Character> as VisitWith<V>>::visit_with(body, visitor)
1508 };
1509 }
1510 }
1511 }
1512}
1513impl<V: ?Sized + Visit> VisitWith<V> for ClassStringDisjunction {
1514 #[doc = "Calls [Visit`::visit_class_string_disjunction`] with `self`."]
1515 fn visit_with(&self, visitor: &mut V) {
1516 <V as Visit>::visit_class_string_disjunction(visitor, self)
1517 }
1518
1519 fn visit_children_with(&self, visitor: &mut V) {
1520 match self {
1521 ClassStringDisjunction {
1522 span,
1523 strings,
1524 body,
1525 } => {
1526 {
1527 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1528 };
1529 {
1530 <Vec<ClassString> as VisitWith<V>>::visit_with(body, visitor)
1531 };
1532 }
1533 }
1534 }
1535}
1536impl<V: ?Sized + Visit> VisitWith<V> for Disjunction {
1537 #[doc = "Calls [Visit`::visit_disjunction`] with `self`."]
1538 fn visit_with(&self, visitor: &mut V) {
1539 <V as Visit>::visit_disjunction(visitor, self)
1540 }
1541
1542 fn visit_children_with(&self, visitor: &mut V) {
1543 match self {
1544 Disjunction { span, body } => {
1545 {
1546 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1547 };
1548 {
1549 <Vec<Alternative> as VisitWith<V>>::visit_with(body, visitor)
1550 };
1551 }
1552 }
1553 }
1554}
1555impl<V: ?Sized + Visit> VisitWith<V> for Dot {
1556 #[doc = "Calls [Visit`::visit_dot`] with `self`."]
1557 fn visit_with(&self, visitor: &mut V) {
1558 <V as Visit>::visit_dot(visitor, self)
1559 }
1560
1561 fn visit_children_with(&self, visitor: &mut V) {
1562 match self {
1563 Dot { span } => {
1564 {
1565 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1566 };
1567 }
1568 }
1569 }
1570}
1571impl<V: ?Sized + Visit> VisitWith<V> for IgnoreGroup {
1572 #[doc = "Calls [Visit`::visit_ignore_group`] with `self`."]
1573 fn visit_with(&self, visitor: &mut V) {
1574 <V as Visit>::visit_ignore_group(visitor, self)
1575 }
1576
1577 fn visit_children_with(&self, visitor: &mut V) {
1578 match self {
1579 IgnoreGroup {
1580 span,
1581 modifiers,
1582 body,
1583 } => {
1584 {
1585 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1586 };
1587 {
1588 <Option<Modifiers> as VisitWith<V>>::visit_with(modifiers, visitor)
1589 };
1590 {
1591 <Disjunction as VisitWith<V>>::visit_with(body, visitor)
1592 };
1593 }
1594 }
1595 }
1596}
1597impl<V: ?Sized + Visit> VisitWith<V> for IndexedReference {
1598 #[doc = "Calls [Visit`::visit_indexed_reference`] with `self`."]
1599 fn visit_with(&self, visitor: &mut V) {
1600 <V as Visit>::visit_indexed_reference(visitor, self)
1601 }
1602
1603 fn visit_children_with(&self, visitor: &mut V) {
1604 match self {
1605 IndexedReference { span, index } => {
1606 {
1607 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1608 };
1609 }
1610 }
1611 }
1612}
1613impl<V: ?Sized + Visit> VisitWith<V> for LookAroundAssertion {
1614 #[doc = "Calls [Visit`::visit_look_around_assertion`] with `self`."]
1615 fn visit_with(&self, visitor: &mut V) {
1616 <V as Visit>::visit_look_around_assertion(visitor, self)
1617 }
1618
1619 fn visit_children_with(&self, visitor: &mut V) {
1620 match self {
1621 LookAroundAssertion { span, kind, body } => {
1622 {
1623 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1624 };
1625 {
1626 <LookAroundAssertionKind as VisitWith<V>>::visit_with(kind, visitor)
1627 };
1628 {
1629 <Disjunction as VisitWith<V>>::visit_with(body, visitor)
1630 };
1631 }
1632 }
1633 }
1634}
1635impl<V: ?Sized + Visit> VisitWith<V> for LookAroundAssertionKind {
1636 #[doc = "Calls [Visit`::visit_look_around_assertion_kind`] with `self`."]
1637 fn visit_with(&self, visitor: &mut V) {
1638 <V as Visit>::visit_look_around_assertion_kind(visitor, self)
1639 }
1640
1641 fn visit_children_with(&self, visitor: &mut V) {
1642 match self {
1643 LookAroundAssertionKind::Lookahead => {}
1644 LookAroundAssertionKind::NegativeLookahead => {}
1645 LookAroundAssertionKind::Lookbehind => {}
1646 LookAroundAssertionKind::NegativeLookbehind => {}
1647 }
1648 }
1649}
1650impl<V: ?Sized + Visit> VisitWith<V> for Modifiers {
1651 #[doc = "Calls [Visit`::visit_modifiers`] with `self`."]
1652 fn visit_with(&self, visitor: &mut V) {
1653 <V as Visit>::visit_modifiers(visitor, self)
1654 }
1655
1656 fn visit_children_with(&self, visitor: &mut V) {
1657 match self {
1658 Modifiers {
1659 span,
1660 enabling,
1661 disabling,
1662 } => {
1663 {
1664 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1665 };
1666 {
1667 <Modifier as VisitWith<V>>::visit_with(enabling, visitor)
1668 };
1669 {
1670 <Modifier as VisitWith<V>>::visit_with(disabling, visitor)
1671 };
1672 }
1673 }
1674 }
1675}
1676impl<V: ?Sized + Visit> VisitWith<V> for NamedReference {
1677 #[doc = "Calls [Visit`::visit_named_reference`] with `self`."]
1678 fn visit_with(&self, visitor: &mut V) {
1679 <V as Visit>::visit_named_reference(visitor, self)
1680 }
1681
1682 fn visit_children_with(&self, visitor: &mut V) {
1683 match self {
1684 NamedReference { span, name } => {
1685 {
1686 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1687 };
1688 {
1689 <swc_atoms::Atom as VisitWith<V>>::visit_with(name, visitor)
1690 };
1691 }
1692 }
1693 }
1694}
1695impl<V: ?Sized + Visit> VisitWith<V> for Pattern {
1696 #[doc = "Calls [Visit`::visit_pattern`] with `self`."]
1697 fn visit_with(&self, visitor: &mut V) {
1698 <V as Visit>::visit_pattern(visitor, self)
1699 }
1700
1701 fn visit_children_with(&self, visitor: &mut V) {
1702 match self {
1703 Pattern { span, body } => {
1704 {
1705 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1706 };
1707 {
1708 <Disjunction as VisitWith<V>>::visit_with(body, visitor)
1709 };
1710 }
1711 }
1712 }
1713}
1714impl<V: ?Sized + Visit> VisitWith<V> for Quantifier {
1715 #[doc = "Calls [Visit`::visit_quantifier`] with `self`."]
1716 fn visit_with(&self, visitor: &mut V) {
1717 <V as Visit>::visit_quantifier(visitor, self)
1718 }
1719
1720 fn visit_children_with(&self, visitor: &mut V) {
1721 match self {
1722 Quantifier {
1723 span,
1724 min,
1725 max,
1726 greedy,
1727 body,
1728 } => {
1729 {
1730 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1731 };
1732 {
1733 <Term as VisitWith<V>>::visit_with(body, visitor)
1734 };
1735 }
1736 }
1737 }
1738}
1739impl<V: ?Sized + Visit> VisitWith<V> for Term {
1740 #[doc = "Calls [Visit`::visit_term`] with `self`."]
1741 fn visit_with(&self, visitor: &mut V) {
1742 <V as Visit>::visit_term(visitor, self)
1743 }
1744
1745 fn visit_children_with(&self, visitor: &mut V) {
1746 match self {
1747 Term::BoundaryAssertion { 0: _field_0 } => {
1748 <Box<BoundaryAssertion> as VisitWith<V>>::visit_with(_field_0, visitor);
1749 }
1750 Term::LookAroundAssertion { 0: _field_0 } => {
1751 <Box<LookAroundAssertion> as VisitWith<V>>::visit_with(_field_0, visitor);
1752 }
1753 Term::Quantifier { 0: _field_0 } => {
1754 <Box<Quantifier> as VisitWith<V>>::visit_with(_field_0, visitor);
1755 }
1756 Term::Character { 0: _field_0 } => {
1757 <Box<Character> as VisitWith<V>>::visit_with(_field_0, visitor);
1758 }
1759 Term::Dot { 0: _field_0 } => {
1760 <Dot as VisitWith<V>>::visit_with(_field_0, visitor);
1761 }
1762 Term::CharacterClassEscape { 0: _field_0 } => {
1763 <Box<CharacterClassEscape> as VisitWith<V>>::visit_with(_field_0, visitor);
1764 }
1765 Term::UnicodePropertyEscape { 0: _field_0 } => {
1766 <Box<UnicodePropertyEscape> as VisitWith<V>>::visit_with(_field_0, visitor);
1767 }
1768 Term::CharacterClass { 0: _field_0 } => {
1769 <Box<CharacterClass> as VisitWith<V>>::visit_with(_field_0, visitor);
1770 }
1771 Term::CapturingGroup { 0: _field_0 } => {
1772 <Box<CapturingGroup> as VisitWith<V>>::visit_with(_field_0, visitor);
1773 }
1774 Term::IgnoreGroup { 0: _field_0 } => {
1775 <Box<IgnoreGroup> as VisitWith<V>>::visit_with(_field_0, visitor);
1776 }
1777 Term::IndexedReference { 0: _field_0 } => {
1778 <Box<IndexedReference> as VisitWith<V>>::visit_with(_field_0, visitor);
1779 }
1780 Term::NamedReference { 0: _field_0 } => {
1781 <Box<NamedReference> as VisitWith<V>>::visit_with(_field_0, visitor);
1782 }
1783 }
1784 }
1785}
1786impl<V: ?Sized + Visit> VisitWith<V> for UnicodePropertyEscape {
1787 #[doc = "Calls [Visit`::visit_unicode_property_escape`] with `self`."]
1788 fn visit_with(&self, visitor: &mut V) {
1789 <V as Visit>::visit_unicode_property_escape(visitor, self)
1790 }
1791
1792 fn visit_children_with(&self, visitor: &mut V) {
1793 match self {
1794 UnicodePropertyEscape {
1795 span,
1796 negative,
1797 strings,
1798 name,
1799 value,
1800 } => {
1801 {
1802 <swc_common::Span as VisitWith<V>>::visit_with(span, visitor)
1803 };
1804 {
1805 <swc_atoms::Atom as VisitWith<V>>::visit_with(name, visitor)
1806 };
1807 {
1808 <Option<swc_atoms::Atom> as VisitWith<V>>::visit_with(value, visitor)
1809 };
1810 }
1811 }
1812 }
1813}
1814impl<V: ?Sized + Visit> VisitWith<V> for [Alternative] {
1815 #[doc = "Calls [Visit`::visit_alternatives`] with `self`. (Extra impl)"]
1816 #[inline]
1817 fn visit_with(&self, visitor: &mut V) {
1818 <V as Visit>::visit_alternatives(visitor, self)
1819 }
1820
1821 #[inline]
1822 fn visit_children_with(&self, visitor: &mut V) {
1823 self.iter()
1824 .for_each(|item| <Alternative as VisitWith<V>>::visit_with(item, visitor))
1825 }
1826}
1827impl<V: ?Sized + Visit> VisitWith<V> for swc_atoms::Atom {
1828 #[doc = "Calls [Visit`::visit_atom`] with `self`. (Extra impl)"]
1829 #[inline]
1830 fn visit_with(&self, visitor: &mut V) {
1831 <V as Visit>::visit_atom(visitor, self)
1832 }
1833
1834 #[inline]
1835 fn visit_children_with(&self, visitor: &mut V) {
1836 {}
1837 }
1838}
1839impl<V: ?Sized + Visit> VisitWith<V> for [CharacterClassContents] {
1840 #[doc = "Calls [Visit`::visit_character_class_contentss`] with `self`. (Extra impl)"]
1841 #[inline]
1842 fn visit_with(&self, visitor: &mut V) {
1843 <V as Visit>::visit_character_class_contentss(visitor, self)
1844 }
1845
1846 #[inline]
1847 fn visit_children_with(&self, visitor: &mut V) {
1848 self.iter()
1849 .for_each(|item| <CharacterClassContents as VisitWith<V>>::visit_with(item, visitor))
1850 }
1851}
1852impl<V: ?Sized + Visit> VisitWith<V> for [Character] {
1853 #[doc = "Calls [Visit`::visit_characters`] with `self`. (Extra impl)"]
1854 #[inline]
1855 fn visit_with(&self, visitor: &mut V) {
1856 <V as Visit>::visit_characters(visitor, self)
1857 }
1858
1859 #[inline]
1860 fn visit_children_with(&self, visitor: &mut V) {
1861 self.iter()
1862 .for_each(|item| <Character as VisitWith<V>>::visit_with(item, visitor))
1863 }
1864}
1865impl<V: ?Sized + Visit> VisitWith<V> for [ClassString] {
1866 #[doc = "Calls [Visit`::visit_class_strings`] with `self`. (Extra impl)"]
1867 #[inline]
1868 fn visit_with(&self, visitor: &mut V) {
1869 <V as Visit>::visit_class_strings(visitor, self)
1870 }
1871
1872 #[inline]
1873 fn visit_children_with(&self, visitor: &mut V) {
1874 self.iter()
1875 .for_each(|item| <ClassString as VisitWith<V>>::visit_with(item, visitor))
1876 }
1877}
1878impl<V: ?Sized + Visit> VisitWith<V> for Modifier {
1879 #[doc = "Calls [Visit`::visit_modifier`] with `self`. (Extra impl)"]
1880 #[inline]
1881 fn visit_with(&self, visitor: &mut V) {
1882 <V as Visit>::visit_modifier(visitor, self)
1883 }
1884
1885 #[inline]
1886 fn visit_children_with(&self, visitor: &mut V) {
1887 {}
1888 }
1889}
1890impl<V: ?Sized + Visit> VisitWith<V> for Option<swc_atoms::Atom> {
1891 #[doc = "Calls [Visit`::visit_opt_atom`] with `self`. (Extra impl)"]
1892 #[inline]
1893 fn visit_with(&self, visitor: &mut V) {
1894 <V as Visit>::visit_opt_atom(visitor, self)
1895 }
1896
1897 #[inline]
1898 fn visit_children_with(&self, visitor: &mut V) {
1899 match self {
1900 Some(inner) => <swc_atoms::Atom as VisitWith<V>>::visit_with(inner, visitor),
1901 None => {}
1902 }
1903 }
1904}
1905impl<V: ?Sized + Visit> VisitWith<V> for Option<Modifiers> {
1906 #[doc = "Calls [Visit`::visit_opt_modifiers`] with `self`. (Extra impl)"]
1907 #[inline]
1908 fn visit_with(&self, visitor: &mut V) {
1909 <V as Visit>::visit_opt_modifiers(visitor, self)
1910 }
1911
1912 #[inline]
1913 fn visit_children_with(&self, visitor: &mut V) {
1914 match self {
1915 Some(inner) => <Modifiers as VisitWith<V>>::visit_with(inner, visitor),
1916 None => {}
1917 }
1918 }
1919}
1920impl<V: ?Sized + Visit> VisitWith<V> for swc_common::Span {
1921 #[doc = "Calls [Visit`::visit_span`] with `self`. (Extra impl)"]
1922 #[inline]
1923 fn visit_with(&self, visitor: &mut V) {
1924 <V as Visit>::visit_span(visitor, self)
1925 }
1926
1927 #[inline]
1928 fn visit_children_with(&self, visitor: &mut V) {
1929 {}
1930 }
1931}
1932impl<V: ?Sized + Visit> VisitWith<V> for [Term] {
1933 #[doc = "Calls [Visit`::visit_terms`] with `self`. (Extra impl)"]
1934 #[inline]
1935 fn visit_with(&self, visitor: &mut V) {
1936 <V as Visit>::visit_terms(visitor, self)
1937 }
1938
1939 #[inline]
1940 fn visit_children_with(&self, visitor: &mut V) {
1941 self.iter()
1942 .for_each(|item| <Term as VisitWith<V>>::visit_with(item, visitor))
1943 }
1944}
1945impl<V, T> VisitWith<V> for std::boxed::Box<T>
1946where
1947 V: ?Sized + Visit,
1948 T: VisitWith<V>,
1949{
1950 #[inline]
1951 fn visit_with(&self, visitor: &mut V) {
1952 let v = <T as VisitWith<V>>::visit_with(&**self, visitor);
1953 v
1954 }
1955
1956 #[inline]
1957 fn visit_children_with(&self, visitor: &mut V) {
1958 let v = <T as VisitWith<V>>::visit_children_with(&**self, visitor);
1959 v
1960 }
1961}
1962impl<V, T> VisitWith<V> for std::vec::Vec<T>
1963where
1964 V: ?Sized + Visit,
1965 [T]: VisitWith<V>,
1966{
1967 #[inline]
1968 fn visit_with(&self, visitor: &mut V) {
1969 let v = <[T] as VisitWith<V>>::visit_with(self, visitor);
1970 v
1971 }
1972
1973 #[inline]
1974 fn visit_children_with(&self, visitor: &mut V) {
1975 let v = <[T] as VisitWith<V>>::visit_children_with(self, visitor);
1976 v
1977 }
1978}
1979#[doc = r" A visitor trait for traversing the AST."]
1980#[cfg(any(docsrs, feature = "path"))]
1981#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
1982pub trait VisitAstPath {
1983 #[doc = "Visit a node of type `Alternative`.\n\nBy default, this method calls \
1984 [`Alternative::visit_children_with_ast_path`]. If you want to recurse, you need to \
1985 call it manually."]
1986 #[inline]
1987 fn visit_alternative<'ast: 'r, 'r>(
1988 &mut self,
1989 node: &'ast Alternative,
1990 __ast_path: &mut AstNodePath<'r>,
1991 ) {
1992 <Alternative as VisitWithAstPath<Self>>::visit_children_with_ast_path(
1993 node, self, __ast_path,
1994 )
1995 }
1996 #[doc = "Visit a node of type `Vec < Alternative >`.\n\nBy default, this method calls [`Vec < \
1997 Alternative >::visit_children_with_ast_path`]. If you want to recurse, you need to \
1998 call it manually."]
1999 #[inline]
2000 fn visit_alternatives<'ast: 'r, 'r>(
2001 &mut self,
2002 node: &'ast [Alternative],
2003 __ast_path: &mut AstNodePath<'r>,
2004 ) {
2005 <[Alternative] as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2006 node, self, __ast_path,
2007 )
2008 }
2009 #[doc = "Visit a node of type `swc_atoms :: Atom`.\n\nBy default, this method calls \
2010 [`swc_atoms :: Atom::visit_children_with_ast_path`]. If you want to recurse, you need \
2011 to call it manually."]
2012 #[inline]
2013 fn visit_atom<'ast: 'r, 'r>(
2014 &mut self,
2015 node: &'ast swc_atoms::Atom,
2016 __ast_path: &mut AstNodePath<'r>,
2017 ) {
2018 <swc_atoms::Atom as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2019 node, self, __ast_path,
2020 )
2021 }
2022 #[doc = "Visit a node of type `BoundaryAssertion`.\n\nBy default, this method calls \
2023 [`BoundaryAssertion::visit_children_with_ast_path`]. If you want to recurse, you need \
2024 to call it manually."]
2025 #[inline]
2026 fn visit_boundary_assertion<'ast: 'r, 'r>(
2027 &mut self,
2028 node: &'ast BoundaryAssertion,
2029 __ast_path: &mut AstNodePath<'r>,
2030 ) {
2031 <BoundaryAssertion as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2032 node, self, __ast_path,
2033 )
2034 }
2035 #[doc = "Visit a node of type `BoundaryAssertionKind`.\n\nBy default, this method calls \
2036 [`BoundaryAssertionKind::visit_children_with_ast_path`]. If you want to recurse, you \
2037 need to call it manually."]
2038 #[inline]
2039 fn visit_boundary_assertion_kind<'ast: 'r, 'r>(
2040 &mut self,
2041 node: &'ast BoundaryAssertionKind,
2042 __ast_path: &mut AstNodePath<'r>,
2043 ) {
2044 <BoundaryAssertionKind as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2045 node, self, __ast_path,
2046 )
2047 }
2048 #[doc = "Visit a node of type `CapturingGroup`.\n\nBy default, this method calls \
2049 [`CapturingGroup::visit_children_with_ast_path`]. If you want to recurse, you need to \
2050 call it manually."]
2051 #[inline]
2052 fn visit_capturing_group<'ast: 'r, 'r>(
2053 &mut self,
2054 node: &'ast CapturingGroup,
2055 __ast_path: &mut AstNodePath<'r>,
2056 ) {
2057 <CapturingGroup as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2058 node, self, __ast_path,
2059 )
2060 }
2061 #[doc = "Visit a node of type `Character`.\n\nBy default, this method calls \
2062 [`Character::visit_children_with_ast_path`]. If you want to recurse, you need to call \
2063 it manually."]
2064 #[inline]
2065 fn visit_character<'ast: 'r, 'r>(
2066 &mut self,
2067 node: &'ast Character,
2068 __ast_path: &mut AstNodePath<'r>,
2069 ) {
2070 <Character as VisitWithAstPath<Self>>::visit_children_with_ast_path(node, self, __ast_path)
2071 }
2072 #[doc = "Visit a node of type `CharacterClass`.\n\nBy default, this method calls \
2073 [`CharacterClass::visit_children_with_ast_path`]. If you want to recurse, you need to \
2074 call it manually."]
2075 #[inline]
2076 fn visit_character_class<'ast: 'r, 'r>(
2077 &mut self,
2078 node: &'ast CharacterClass,
2079 __ast_path: &mut AstNodePath<'r>,
2080 ) {
2081 <CharacterClass as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2082 node, self, __ast_path,
2083 )
2084 }
2085 #[doc = "Visit a node of type `CharacterClassContents`.\n\nBy default, this method calls \
2086 [`CharacterClassContents::visit_children_with_ast_path`]. If you want to recurse, you \
2087 need to call it manually."]
2088 #[inline]
2089 fn visit_character_class_contents<'ast: 'r, 'r>(
2090 &mut self,
2091 node: &'ast CharacterClassContents,
2092 __ast_path: &mut AstNodePath<'r>,
2093 ) {
2094 <CharacterClassContents as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2095 node, self, __ast_path,
2096 )
2097 }
2098 #[doc = "Visit a node of type `CharacterClassContentsKind`.\n\nBy default, this method calls \
2099 [`CharacterClassContentsKind::visit_children_with_ast_path`]. If you want to recurse, \
2100 you need to call it manually."]
2101 #[inline]
2102 fn visit_character_class_contents_kind<'ast: 'r, 'r>(
2103 &mut self,
2104 node: &'ast CharacterClassContentsKind,
2105 __ast_path: &mut AstNodePath<'r>,
2106 ) {
2107 <CharacterClassContentsKind as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2108 node, self, __ast_path,
2109 )
2110 }
2111 #[doc = "Visit a node of type `Vec < CharacterClassContents >`.\n\nBy default, this method \
2112 calls [`Vec < CharacterClassContents >::visit_children_with_ast_path`]. If you want \
2113 to recurse, you need to call it manually."]
2114 #[inline]
2115 fn visit_character_class_contentss<'ast: 'r, 'r>(
2116 &mut self,
2117 node: &'ast [CharacterClassContents],
2118 __ast_path: &mut AstNodePath<'r>,
2119 ) {
2120 <[CharacterClassContents] as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2121 node, self, __ast_path,
2122 )
2123 }
2124 #[doc = "Visit a node of type `CharacterClassEscape`.\n\nBy default, this method calls \
2125 [`CharacterClassEscape::visit_children_with_ast_path`]. If you want to recurse, you \
2126 need to call it manually."]
2127 #[inline]
2128 fn visit_character_class_escape<'ast: 'r, 'r>(
2129 &mut self,
2130 node: &'ast CharacterClassEscape,
2131 __ast_path: &mut AstNodePath<'r>,
2132 ) {
2133 <CharacterClassEscape as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2134 node, self, __ast_path,
2135 )
2136 }
2137 #[doc = "Visit a node of type `CharacterClassEscapeKind`.\n\nBy default, this method calls \
2138 [`CharacterClassEscapeKind::visit_children_with_ast_path`]. If you want to recurse, \
2139 you need to call it manually."]
2140 #[inline]
2141 fn visit_character_class_escape_kind<'ast: 'r, 'r>(
2142 &mut self,
2143 node: &'ast CharacterClassEscapeKind,
2144 __ast_path: &mut AstNodePath<'r>,
2145 ) {
2146 <CharacterClassEscapeKind as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2147 node, self, __ast_path,
2148 )
2149 }
2150 #[doc = "Visit a node of type `CharacterClassRange`.\n\nBy default, this method calls \
2151 [`CharacterClassRange::visit_children_with_ast_path`]. If you want to recurse, you \
2152 need to call it manually."]
2153 #[inline]
2154 fn visit_character_class_range<'ast: 'r, 'r>(
2155 &mut self,
2156 node: &'ast CharacterClassRange,
2157 __ast_path: &mut AstNodePath<'r>,
2158 ) {
2159 <CharacterClassRange as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2160 node, self, __ast_path,
2161 )
2162 }
2163 #[doc = "Visit a node of type `CharacterKind`.\n\nBy default, this method calls \
2164 [`CharacterKind::visit_children_with_ast_path`]. If you want to recurse, you need to \
2165 call it manually."]
2166 #[inline]
2167 fn visit_character_kind<'ast: 'r, 'r>(
2168 &mut self,
2169 node: &'ast CharacterKind,
2170 __ast_path: &mut AstNodePath<'r>,
2171 ) {
2172 <CharacterKind as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2173 node, self, __ast_path,
2174 )
2175 }
2176 #[doc = "Visit a node of type `Vec < Character >`.\n\nBy default, this method calls [`Vec < \
2177 Character >::visit_children_with_ast_path`]. If you want to recurse, you need to call \
2178 it manually."]
2179 #[inline]
2180 fn visit_characters<'ast: 'r, 'r>(
2181 &mut self,
2182 node: &'ast [Character],
2183 __ast_path: &mut AstNodePath<'r>,
2184 ) {
2185 <[Character] as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2186 node, self, __ast_path,
2187 )
2188 }
2189 #[doc = "Visit a node of type `ClassString`.\n\nBy default, this method calls \
2190 [`ClassString::visit_children_with_ast_path`]. If you want to recurse, you need to \
2191 call it manually."]
2192 #[inline]
2193 fn visit_class_string<'ast: 'r, 'r>(
2194 &mut self,
2195 node: &'ast ClassString,
2196 __ast_path: &mut AstNodePath<'r>,
2197 ) {
2198 <ClassString as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2199 node, self, __ast_path,
2200 )
2201 }
2202 #[doc = "Visit a node of type `ClassStringDisjunction`.\n\nBy default, this method calls \
2203 [`ClassStringDisjunction::visit_children_with_ast_path`]. If you want to recurse, you \
2204 need to call it manually."]
2205 #[inline]
2206 fn visit_class_string_disjunction<'ast: 'r, 'r>(
2207 &mut self,
2208 node: &'ast ClassStringDisjunction,
2209 __ast_path: &mut AstNodePath<'r>,
2210 ) {
2211 <ClassStringDisjunction as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2212 node, self, __ast_path,
2213 )
2214 }
2215 #[doc = "Visit a node of type `Vec < ClassString >`.\n\nBy default, this method calls [`Vec < \
2216 ClassString >::visit_children_with_ast_path`]. If you want to recurse, you need to \
2217 call it manually."]
2218 #[inline]
2219 fn visit_class_strings<'ast: 'r, 'r>(
2220 &mut self,
2221 node: &'ast [ClassString],
2222 __ast_path: &mut AstNodePath<'r>,
2223 ) {
2224 <[ClassString] as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2225 node, self, __ast_path,
2226 )
2227 }
2228 #[doc = "Visit a node of type `Disjunction`.\n\nBy default, this method calls \
2229 [`Disjunction::visit_children_with_ast_path`]. If you want to recurse, you need to \
2230 call it manually."]
2231 #[inline]
2232 fn visit_disjunction<'ast: 'r, 'r>(
2233 &mut self,
2234 node: &'ast Disjunction,
2235 __ast_path: &mut AstNodePath<'r>,
2236 ) {
2237 <Disjunction as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2238 node, self, __ast_path,
2239 )
2240 }
2241 #[doc = "Visit a node of type `Dot`.\n\nBy default, this method calls \
2242 [`Dot::visit_children_with_ast_path`]. If you want to recurse, you need to call it \
2243 manually."]
2244 #[inline]
2245 fn visit_dot<'ast: 'r, 'r>(&mut self, node: &'ast Dot, __ast_path: &mut AstNodePath<'r>) {
2246 <Dot as VisitWithAstPath<Self>>::visit_children_with_ast_path(node, self, __ast_path)
2247 }
2248 #[doc = "Visit a node of type `IgnoreGroup`.\n\nBy default, this method calls \
2249 [`IgnoreGroup::visit_children_with_ast_path`]. If you want to recurse, you need to \
2250 call it manually."]
2251 #[inline]
2252 fn visit_ignore_group<'ast: 'r, 'r>(
2253 &mut self,
2254 node: &'ast IgnoreGroup,
2255 __ast_path: &mut AstNodePath<'r>,
2256 ) {
2257 <IgnoreGroup as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2258 node, self, __ast_path,
2259 )
2260 }
2261 #[doc = "Visit a node of type `IndexedReference`.\n\nBy default, this method calls \
2262 [`IndexedReference::visit_children_with_ast_path`]. If you want to recurse, you need \
2263 to call it manually."]
2264 #[inline]
2265 fn visit_indexed_reference<'ast: 'r, 'r>(
2266 &mut self,
2267 node: &'ast IndexedReference,
2268 __ast_path: &mut AstNodePath<'r>,
2269 ) {
2270 <IndexedReference as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2271 node, self, __ast_path,
2272 )
2273 }
2274 #[doc = "Visit a node of type `LookAroundAssertion`.\n\nBy default, this method calls \
2275 [`LookAroundAssertion::visit_children_with_ast_path`]. If you want to recurse, you \
2276 need to call it manually."]
2277 #[inline]
2278 fn visit_look_around_assertion<'ast: 'r, 'r>(
2279 &mut self,
2280 node: &'ast LookAroundAssertion,
2281 __ast_path: &mut AstNodePath<'r>,
2282 ) {
2283 <LookAroundAssertion as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2284 node, self, __ast_path,
2285 )
2286 }
2287 #[doc = "Visit a node of type `LookAroundAssertionKind`.\n\nBy default, this method calls \
2288 [`LookAroundAssertionKind::visit_children_with_ast_path`]. If you want to recurse, \
2289 you need to call it manually."]
2290 #[inline]
2291 fn visit_look_around_assertion_kind<'ast: 'r, 'r>(
2292 &mut self,
2293 node: &'ast LookAroundAssertionKind,
2294 __ast_path: &mut AstNodePath<'r>,
2295 ) {
2296 <LookAroundAssertionKind as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2297 node, self, __ast_path,
2298 )
2299 }
2300 #[doc = "Visit a node of type `Modifier`.\n\nBy default, this method calls \
2301 [`Modifier::visit_children_with_ast_path`]. If you want to recurse, you need to call \
2302 it manually."]
2303 #[inline]
2304 fn visit_modifier<'ast: 'r, 'r>(
2305 &mut self,
2306 node: &'ast Modifier,
2307 __ast_path: &mut AstNodePath<'r>,
2308 ) {
2309 <Modifier as VisitWithAstPath<Self>>::visit_children_with_ast_path(node, self, __ast_path)
2310 }
2311 #[doc = "Visit a node of type `Modifiers`.\n\nBy default, this method calls \
2312 [`Modifiers::visit_children_with_ast_path`]. If you want to recurse, you need to call \
2313 it manually."]
2314 #[inline]
2315 fn visit_modifiers<'ast: 'r, 'r>(
2316 &mut self,
2317 node: &'ast Modifiers,
2318 __ast_path: &mut AstNodePath<'r>,
2319 ) {
2320 <Modifiers as VisitWithAstPath<Self>>::visit_children_with_ast_path(node, self, __ast_path)
2321 }
2322 #[doc = "Visit a node of type `NamedReference`.\n\nBy default, this method calls \
2323 [`NamedReference::visit_children_with_ast_path`]. If you want to recurse, you need to \
2324 call it manually."]
2325 #[inline]
2326 fn visit_named_reference<'ast: 'r, 'r>(
2327 &mut self,
2328 node: &'ast NamedReference,
2329 __ast_path: &mut AstNodePath<'r>,
2330 ) {
2331 <NamedReference as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2332 node, self, __ast_path,
2333 )
2334 }
2335 #[doc = "Visit a node of type `Option < swc_atoms :: Atom >`.\n\nBy default, this method calls \
2336 [`Option < swc_atoms :: Atom >::visit_children_with_ast_path`]. If you want to \
2337 recurse, you need to call it manually."]
2338 #[inline]
2339 fn visit_opt_atom<'ast: 'r, 'r>(
2340 &mut self,
2341 node: &'ast Option<swc_atoms::Atom>,
2342 __ast_path: &mut AstNodePath<'r>,
2343 ) {
2344 <Option<swc_atoms::Atom> as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2345 node, self, __ast_path,
2346 )
2347 }
2348 #[doc = "Visit a node of type `Option < Modifiers >`.\n\nBy default, this method calls \
2349 [`Option < Modifiers >::visit_children_with_ast_path`]. If you want to recurse, you \
2350 need to call it manually."]
2351 #[inline]
2352 fn visit_opt_modifiers<'ast: 'r, 'r>(
2353 &mut self,
2354 node: &'ast Option<Modifiers>,
2355 __ast_path: &mut AstNodePath<'r>,
2356 ) {
2357 <Option<Modifiers> as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2358 node, self, __ast_path,
2359 )
2360 }
2361 #[doc = "Visit a node of type `Pattern`.\n\nBy default, this method calls \
2362 [`Pattern::visit_children_with_ast_path`]. If you want to recurse, you need to call \
2363 it manually."]
2364 #[inline]
2365 fn visit_pattern<'ast: 'r, 'r>(
2366 &mut self,
2367 node: &'ast Pattern,
2368 __ast_path: &mut AstNodePath<'r>,
2369 ) {
2370 <Pattern as VisitWithAstPath<Self>>::visit_children_with_ast_path(node, self, __ast_path)
2371 }
2372 #[doc = "Visit a node of type `Quantifier`.\n\nBy default, this method calls \
2373 [`Quantifier::visit_children_with_ast_path`]. If you want to recurse, you need to \
2374 call it manually."]
2375 #[inline]
2376 fn visit_quantifier<'ast: 'r, 'r>(
2377 &mut self,
2378 node: &'ast Quantifier,
2379 __ast_path: &mut AstNodePath<'r>,
2380 ) {
2381 <Quantifier as VisitWithAstPath<Self>>::visit_children_with_ast_path(node, self, __ast_path)
2382 }
2383 #[doc = "Visit a node of type `swc_common :: Span`.\n\nBy default, this method calls \
2384 [`swc_common :: Span::visit_children_with_ast_path`]. If you want to recurse, you \
2385 need to call it manually."]
2386 #[inline]
2387 fn visit_span<'ast: 'r, 'r>(
2388 &mut self,
2389 node: &'ast swc_common::Span,
2390 __ast_path: &mut AstNodePath<'r>,
2391 ) {
2392 <swc_common::Span as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2393 node, self, __ast_path,
2394 )
2395 }
2396 #[doc = "Visit a node of type `Term`.\n\nBy default, this method calls \
2397 [`Term::visit_children_with_ast_path`]. If you want to recurse, you need to call it \
2398 manually."]
2399 #[inline]
2400 fn visit_term<'ast: 'r, 'r>(&mut self, node: &'ast Term, __ast_path: &mut AstNodePath<'r>) {
2401 <Term as VisitWithAstPath<Self>>::visit_children_with_ast_path(node, self, __ast_path)
2402 }
2403 #[doc = "Visit a node of type `Vec < Term >`.\n\nBy default, this method calls [`Vec < Term \
2404 >::visit_children_with_ast_path`]. If you want to recurse, you need to call it \
2405 manually."]
2406 #[inline]
2407 fn visit_terms<'ast: 'r, 'r>(&mut self, node: &'ast [Term], __ast_path: &mut AstNodePath<'r>) {
2408 <[Term] as VisitWithAstPath<Self>>::visit_children_with_ast_path(node, self, __ast_path)
2409 }
2410 #[doc = "Visit a node of type `UnicodePropertyEscape`.\n\nBy default, this method calls \
2411 [`UnicodePropertyEscape::visit_children_with_ast_path`]. If you want to recurse, you \
2412 need to call it manually."]
2413 #[inline]
2414 fn visit_unicode_property_escape<'ast: 'r, 'r>(
2415 &mut self,
2416 node: &'ast UnicodePropertyEscape,
2417 __ast_path: &mut AstNodePath<'r>,
2418 ) {
2419 <UnicodePropertyEscape as VisitWithAstPath<Self>>::visit_children_with_ast_path(
2420 node, self, __ast_path,
2421 )
2422 }
2423}
2424#[cfg(any(docsrs, feature = "path"))]
2425#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
2426impl<V> VisitAstPath for &mut V
2427where
2428 V: ?Sized + VisitAstPath,
2429{
2430 #[inline]
2431 fn visit_alternative<'ast: 'r, 'r>(
2432 &mut self,
2433 node: &'ast Alternative,
2434 __ast_path: &mut AstNodePath<'r>,
2435 ) {
2436 <V as VisitAstPath>::visit_alternative(&mut **self, node, __ast_path)
2437 }
2438
2439 #[inline]
2440 fn visit_alternatives<'ast: 'r, 'r>(
2441 &mut self,
2442 node: &'ast [Alternative],
2443 __ast_path: &mut AstNodePath<'r>,
2444 ) {
2445 <V as VisitAstPath>::visit_alternatives(&mut **self, node, __ast_path)
2446 }
2447
2448 #[inline]
2449 fn visit_atom<'ast: 'r, 'r>(
2450 &mut self,
2451 node: &'ast swc_atoms::Atom,
2452 __ast_path: &mut AstNodePath<'r>,
2453 ) {
2454 <V as VisitAstPath>::visit_atom(&mut **self, node, __ast_path)
2455 }
2456
2457 #[inline]
2458 fn visit_boundary_assertion<'ast: 'r, 'r>(
2459 &mut self,
2460 node: &'ast BoundaryAssertion,
2461 __ast_path: &mut AstNodePath<'r>,
2462 ) {
2463 <V as VisitAstPath>::visit_boundary_assertion(&mut **self, node, __ast_path)
2464 }
2465
2466 #[inline]
2467 fn visit_boundary_assertion_kind<'ast: 'r, 'r>(
2468 &mut self,
2469 node: &'ast BoundaryAssertionKind,
2470 __ast_path: &mut AstNodePath<'r>,
2471 ) {
2472 <V as VisitAstPath>::visit_boundary_assertion_kind(&mut **self, node, __ast_path)
2473 }
2474
2475 #[inline]
2476 fn visit_capturing_group<'ast: 'r, 'r>(
2477 &mut self,
2478 node: &'ast CapturingGroup,
2479 __ast_path: &mut AstNodePath<'r>,
2480 ) {
2481 <V as VisitAstPath>::visit_capturing_group(&mut **self, node, __ast_path)
2482 }
2483
2484 #[inline]
2485 fn visit_character<'ast: 'r, 'r>(
2486 &mut self,
2487 node: &'ast Character,
2488 __ast_path: &mut AstNodePath<'r>,
2489 ) {
2490 <V as VisitAstPath>::visit_character(&mut **self, node, __ast_path)
2491 }
2492
2493 #[inline]
2494 fn visit_character_class<'ast: 'r, 'r>(
2495 &mut self,
2496 node: &'ast CharacterClass,
2497 __ast_path: &mut AstNodePath<'r>,
2498 ) {
2499 <V as VisitAstPath>::visit_character_class(&mut **self, node, __ast_path)
2500 }
2501
2502 #[inline]
2503 fn visit_character_class_contents<'ast: 'r, 'r>(
2504 &mut self,
2505 node: &'ast CharacterClassContents,
2506 __ast_path: &mut AstNodePath<'r>,
2507 ) {
2508 <V as VisitAstPath>::visit_character_class_contents(&mut **self, node, __ast_path)
2509 }
2510
2511 #[inline]
2512 fn visit_character_class_contents_kind<'ast: 'r, 'r>(
2513 &mut self,
2514 node: &'ast CharacterClassContentsKind,
2515 __ast_path: &mut AstNodePath<'r>,
2516 ) {
2517 <V as VisitAstPath>::visit_character_class_contents_kind(&mut **self, node, __ast_path)
2518 }
2519
2520 #[inline]
2521 fn visit_character_class_contentss<'ast: 'r, 'r>(
2522 &mut self,
2523 node: &'ast [CharacterClassContents],
2524 __ast_path: &mut AstNodePath<'r>,
2525 ) {
2526 <V as VisitAstPath>::visit_character_class_contentss(&mut **self, node, __ast_path)
2527 }
2528
2529 #[inline]
2530 fn visit_character_class_escape<'ast: 'r, 'r>(
2531 &mut self,
2532 node: &'ast CharacterClassEscape,
2533 __ast_path: &mut AstNodePath<'r>,
2534 ) {
2535 <V as VisitAstPath>::visit_character_class_escape(&mut **self, node, __ast_path)
2536 }
2537
2538 #[inline]
2539 fn visit_character_class_escape_kind<'ast: 'r, 'r>(
2540 &mut self,
2541 node: &'ast CharacterClassEscapeKind,
2542 __ast_path: &mut AstNodePath<'r>,
2543 ) {
2544 <V as VisitAstPath>::visit_character_class_escape_kind(&mut **self, node, __ast_path)
2545 }
2546
2547 #[inline]
2548 fn visit_character_class_range<'ast: 'r, 'r>(
2549 &mut self,
2550 node: &'ast CharacterClassRange,
2551 __ast_path: &mut AstNodePath<'r>,
2552 ) {
2553 <V as VisitAstPath>::visit_character_class_range(&mut **self, node, __ast_path)
2554 }
2555
2556 #[inline]
2557 fn visit_character_kind<'ast: 'r, 'r>(
2558 &mut self,
2559 node: &'ast CharacterKind,
2560 __ast_path: &mut AstNodePath<'r>,
2561 ) {
2562 <V as VisitAstPath>::visit_character_kind(&mut **self, node, __ast_path)
2563 }
2564
2565 #[inline]
2566 fn visit_characters<'ast: 'r, 'r>(
2567 &mut self,
2568 node: &'ast [Character],
2569 __ast_path: &mut AstNodePath<'r>,
2570 ) {
2571 <V as VisitAstPath>::visit_characters(&mut **self, node, __ast_path)
2572 }
2573
2574 #[inline]
2575 fn visit_class_string<'ast: 'r, 'r>(
2576 &mut self,
2577 node: &'ast ClassString,
2578 __ast_path: &mut AstNodePath<'r>,
2579 ) {
2580 <V as VisitAstPath>::visit_class_string(&mut **self, node, __ast_path)
2581 }
2582
2583 #[inline]
2584 fn visit_class_string_disjunction<'ast: 'r, 'r>(
2585 &mut self,
2586 node: &'ast ClassStringDisjunction,
2587 __ast_path: &mut AstNodePath<'r>,
2588 ) {
2589 <V as VisitAstPath>::visit_class_string_disjunction(&mut **self, node, __ast_path)
2590 }
2591
2592 #[inline]
2593 fn visit_class_strings<'ast: 'r, 'r>(
2594 &mut self,
2595 node: &'ast [ClassString],
2596 __ast_path: &mut AstNodePath<'r>,
2597 ) {
2598 <V as VisitAstPath>::visit_class_strings(&mut **self, node, __ast_path)
2599 }
2600
2601 #[inline]
2602 fn visit_disjunction<'ast: 'r, 'r>(
2603 &mut self,
2604 node: &'ast Disjunction,
2605 __ast_path: &mut AstNodePath<'r>,
2606 ) {
2607 <V as VisitAstPath>::visit_disjunction(&mut **self, node, __ast_path)
2608 }
2609
2610 #[inline]
2611 fn visit_dot<'ast: 'r, 'r>(&mut self, node: &'ast Dot, __ast_path: &mut AstNodePath<'r>) {
2612 <V as VisitAstPath>::visit_dot(&mut **self, node, __ast_path)
2613 }
2614
2615 #[inline]
2616 fn visit_ignore_group<'ast: 'r, 'r>(
2617 &mut self,
2618 node: &'ast IgnoreGroup,
2619 __ast_path: &mut AstNodePath<'r>,
2620 ) {
2621 <V as VisitAstPath>::visit_ignore_group(&mut **self, node, __ast_path)
2622 }
2623
2624 #[inline]
2625 fn visit_indexed_reference<'ast: 'r, 'r>(
2626 &mut self,
2627 node: &'ast IndexedReference,
2628 __ast_path: &mut AstNodePath<'r>,
2629 ) {
2630 <V as VisitAstPath>::visit_indexed_reference(&mut **self, node, __ast_path)
2631 }
2632
2633 #[inline]
2634 fn visit_look_around_assertion<'ast: 'r, 'r>(
2635 &mut self,
2636 node: &'ast LookAroundAssertion,
2637 __ast_path: &mut AstNodePath<'r>,
2638 ) {
2639 <V as VisitAstPath>::visit_look_around_assertion(&mut **self, node, __ast_path)
2640 }
2641
2642 #[inline]
2643 fn visit_look_around_assertion_kind<'ast: 'r, 'r>(
2644 &mut self,
2645 node: &'ast LookAroundAssertionKind,
2646 __ast_path: &mut AstNodePath<'r>,
2647 ) {
2648 <V as VisitAstPath>::visit_look_around_assertion_kind(&mut **self, node, __ast_path)
2649 }
2650
2651 #[inline]
2652 fn visit_modifier<'ast: 'r, 'r>(
2653 &mut self,
2654 node: &'ast Modifier,
2655 __ast_path: &mut AstNodePath<'r>,
2656 ) {
2657 <V as VisitAstPath>::visit_modifier(&mut **self, node, __ast_path)
2658 }
2659
2660 #[inline]
2661 fn visit_modifiers<'ast: 'r, 'r>(
2662 &mut self,
2663 node: &'ast Modifiers,
2664 __ast_path: &mut AstNodePath<'r>,
2665 ) {
2666 <V as VisitAstPath>::visit_modifiers(&mut **self, node, __ast_path)
2667 }
2668
2669 #[inline]
2670 fn visit_named_reference<'ast: 'r, 'r>(
2671 &mut self,
2672 node: &'ast NamedReference,
2673 __ast_path: &mut AstNodePath<'r>,
2674 ) {
2675 <V as VisitAstPath>::visit_named_reference(&mut **self, node, __ast_path)
2676 }
2677
2678 #[inline]
2679 fn visit_opt_atom<'ast: 'r, 'r>(
2680 &mut self,
2681 node: &'ast Option<swc_atoms::Atom>,
2682 __ast_path: &mut AstNodePath<'r>,
2683 ) {
2684 <V as VisitAstPath>::visit_opt_atom(&mut **self, node, __ast_path)
2685 }
2686
2687 #[inline]
2688 fn visit_opt_modifiers<'ast: 'r, 'r>(
2689 &mut self,
2690 node: &'ast Option<Modifiers>,
2691 __ast_path: &mut AstNodePath<'r>,
2692 ) {
2693 <V as VisitAstPath>::visit_opt_modifiers(&mut **self, node, __ast_path)
2694 }
2695
2696 #[inline]
2697 fn visit_pattern<'ast: 'r, 'r>(
2698 &mut self,
2699 node: &'ast Pattern,
2700 __ast_path: &mut AstNodePath<'r>,
2701 ) {
2702 <V as VisitAstPath>::visit_pattern(&mut **self, node, __ast_path)
2703 }
2704
2705 #[inline]
2706 fn visit_quantifier<'ast: 'r, 'r>(
2707 &mut self,
2708 node: &'ast Quantifier,
2709 __ast_path: &mut AstNodePath<'r>,
2710 ) {
2711 <V as VisitAstPath>::visit_quantifier(&mut **self, node, __ast_path)
2712 }
2713
2714 #[inline]
2715 fn visit_span<'ast: 'r, 'r>(
2716 &mut self,
2717 node: &'ast swc_common::Span,
2718 __ast_path: &mut AstNodePath<'r>,
2719 ) {
2720 <V as VisitAstPath>::visit_span(&mut **self, node, __ast_path)
2721 }
2722
2723 #[inline]
2724 fn visit_term<'ast: 'r, 'r>(&mut self, node: &'ast Term, __ast_path: &mut AstNodePath<'r>) {
2725 <V as VisitAstPath>::visit_term(&mut **self, node, __ast_path)
2726 }
2727
2728 #[inline]
2729 fn visit_terms<'ast: 'r, 'r>(&mut self, node: &'ast [Term], __ast_path: &mut AstNodePath<'r>) {
2730 <V as VisitAstPath>::visit_terms(&mut **self, node, __ast_path)
2731 }
2732
2733 #[inline]
2734 fn visit_unicode_property_escape<'ast: 'r, 'r>(
2735 &mut self,
2736 node: &'ast UnicodePropertyEscape,
2737 __ast_path: &mut AstNodePath<'r>,
2738 ) {
2739 <V as VisitAstPath>::visit_unicode_property_escape(&mut **self, node, __ast_path)
2740 }
2741}
2742#[cfg(any(docsrs, feature = "path"))]
2743#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
2744impl<V> VisitAstPath for Box<V>
2745where
2746 V: ?Sized + VisitAstPath,
2747{
2748 #[inline]
2749 fn visit_alternative<'ast: 'r, 'r>(
2750 &mut self,
2751 node: &'ast Alternative,
2752 __ast_path: &mut AstNodePath<'r>,
2753 ) {
2754 <V as VisitAstPath>::visit_alternative(&mut **self, node, __ast_path)
2755 }
2756
2757 #[inline]
2758 fn visit_alternatives<'ast: 'r, 'r>(
2759 &mut self,
2760 node: &'ast [Alternative],
2761 __ast_path: &mut AstNodePath<'r>,
2762 ) {
2763 <V as VisitAstPath>::visit_alternatives(&mut **self, node, __ast_path)
2764 }
2765
2766 #[inline]
2767 fn visit_atom<'ast: 'r, 'r>(
2768 &mut self,
2769 node: &'ast swc_atoms::Atom,
2770 __ast_path: &mut AstNodePath<'r>,
2771 ) {
2772 <V as VisitAstPath>::visit_atom(&mut **self, node, __ast_path)
2773 }
2774
2775 #[inline]
2776 fn visit_boundary_assertion<'ast: 'r, 'r>(
2777 &mut self,
2778 node: &'ast BoundaryAssertion,
2779 __ast_path: &mut AstNodePath<'r>,
2780 ) {
2781 <V as VisitAstPath>::visit_boundary_assertion(&mut **self, node, __ast_path)
2782 }
2783
2784 #[inline]
2785 fn visit_boundary_assertion_kind<'ast: 'r, 'r>(
2786 &mut self,
2787 node: &'ast BoundaryAssertionKind,
2788 __ast_path: &mut AstNodePath<'r>,
2789 ) {
2790 <V as VisitAstPath>::visit_boundary_assertion_kind(&mut **self, node, __ast_path)
2791 }
2792
2793 #[inline]
2794 fn visit_capturing_group<'ast: 'r, 'r>(
2795 &mut self,
2796 node: &'ast CapturingGroup,
2797 __ast_path: &mut AstNodePath<'r>,
2798 ) {
2799 <V as VisitAstPath>::visit_capturing_group(&mut **self, node, __ast_path)
2800 }
2801
2802 #[inline]
2803 fn visit_character<'ast: 'r, 'r>(
2804 &mut self,
2805 node: &'ast Character,
2806 __ast_path: &mut AstNodePath<'r>,
2807 ) {
2808 <V as VisitAstPath>::visit_character(&mut **self, node, __ast_path)
2809 }
2810
2811 #[inline]
2812 fn visit_character_class<'ast: 'r, 'r>(
2813 &mut self,
2814 node: &'ast CharacterClass,
2815 __ast_path: &mut AstNodePath<'r>,
2816 ) {
2817 <V as VisitAstPath>::visit_character_class(&mut **self, node, __ast_path)
2818 }
2819
2820 #[inline]
2821 fn visit_character_class_contents<'ast: 'r, 'r>(
2822 &mut self,
2823 node: &'ast CharacterClassContents,
2824 __ast_path: &mut AstNodePath<'r>,
2825 ) {
2826 <V as VisitAstPath>::visit_character_class_contents(&mut **self, node, __ast_path)
2827 }
2828
2829 #[inline]
2830 fn visit_character_class_contents_kind<'ast: 'r, 'r>(
2831 &mut self,
2832 node: &'ast CharacterClassContentsKind,
2833 __ast_path: &mut AstNodePath<'r>,
2834 ) {
2835 <V as VisitAstPath>::visit_character_class_contents_kind(&mut **self, node, __ast_path)
2836 }
2837
2838 #[inline]
2839 fn visit_character_class_contentss<'ast: 'r, 'r>(
2840 &mut self,
2841 node: &'ast [CharacterClassContents],
2842 __ast_path: &mut AstNodePath<'r>,
2843 ) {
2844 <V as VisitAstPath>::visit_character_class_contentss(&mut **self, node, __ast_path)
2845 }
2846
2847 #[inline]
2848 fn visit_character_class_escape<'ast: 'r, 'r>(
2849 &mut self,
2850 node: &'ast CharacterClassEscape,
2851 __ast_path: &mut AstNodePath<'r>,
2852 ) {
2853 <V as VisitAstPath>::visit_character_class_escape(&mut **self, node, __ast_path)
2854 }
2855
2856 #[inline]
2857 fn visit_character_class_escape_kind<'ast: 'r, 'r>(
2858 &mut self,
2859 node: &'ast CharacterClassEscapeKind,
2860 __ast_path: &mut AstNodePath<'r>,
2861 ) {
2862 <V as VisitAstPath>::visit_character_class_escape_kind(&mut **self, node, __ast_path)
2863 }
2864
2865 #[inline]
2866 fn visit_character_class_range<'ast: 'r, 'r>(
2867 &mut self,
2868 node: &'ast CharacterClassRange,
2869 __ast_path: &mut AstNodePath<'r>,
2870 ) {
2871 <V as VisitAstPath>::visit_character_class_range(&mut **self, node, __ast_path)
2872 }
2873
2874 #[inline]
2875 fn visit_character_kind<'ast: 'r, 'r>(
2876 &mut self,
2877 node: &'ast CharacterKind,
2878 __ast_path: &mut AstNodePath<'r>,
2879 ) {
2880 <V as VisitAstPath>::visit_character_kind(&mut **self, node, __ast_path)
2881 }
2882
2883 #[inline]
2884 fn visit_characters<'ast: 'r, 'r>(
2885 &mut self,
2886 node: &'ast [Character],
2887 __ast_path: &mut AstNodePath<'r>,
2888 ) {
2889 <V as VisitAstPath>::visit_characters(&mut **self, node, __ast_path)
2890 }
2891
2892 #[inline]
2893 fn visit_class_string<'ast: 'r, 'r>(
2894 &mut self,
2895 node: &'ast ClassString,
2896 __ast_path: &mut AstNodePath<'r>,
2897 ) {
2898 <V as VisitAstPath>::visit_class_string(&mut **self, node, __ast_path)
2899 }
2900
2901 #[inline]
2902 fn visit_class_string_disjunction<'ast: 'r, 'r>(
2903 &mut self,
2904 node: &'ast ClassStringDisjunction,
2905 __ast_path: &mut AstNodePath<'r>,
2906 ) {
2907 <V as VisitAstPath>::visit_class_string_disjunction(&mut **self, node, __ast_path)
2908 }
2909
2910 #[inline]
2911 fn visit_class_strings<'ast: 'r, 'r>(
2912 &mut self,
2913 node: &'ast [ClassString],
2914 __ast_path: &mut AstNodePath<'r>,
2915 ) {
2916 <V as VisitAstPath>::visit_class_strings(&mut **self, node, __ast_path)
2917 }
2918
2919 #[inline]
2920 fn visit_disjunction<'ast: 'r, 'r>(
2921 &mut self,
2922 node: &'ast Disjunction,
2923 __ast_path: &mut AstNodePath<'r>,
2924 ) {
2925 <V as VisitAstPath>::visit_disjunction(&mut **self, node, __ast_path)
2926 }
2927
2928 #[inline]
2929 fn visit_dot<'ast: 'r, 'r>(&mut self, node: &'ast Dot, __ast_path: &mut AstNodePath<'r>) {
2930 <V as VisitAstPath>::visit_dot(&mut **self, node, __ast_path)
2931 }
2932
2933 #[inline]
2934 fn visit_ignore_group<'ast: 'r, 'r>(
2935 &mut self,
2936 node: &'ast IgnoreGroup,
2937 __ast_path: &mut AstNodePath<'r>,
2938 ) {
2939 <V as VisitAstPath>::visit_ignore_group(&mut **self, node, __ast_path)
2940 }
2941
2942 #[inline]
2943 fn visit_indexed_reference<'ast: 'r, 'r>(
2944 &mut self,
2945 node: &'ast IndexedReference,
2946 __ast_path: &mut AstNodePath<'r>,
2947 ) {
2948 <V as VisitAstPath>::visit_indexed_reference(&mut **self, node, __ast_path)
2949 }
2950
2951 #[inline]
2952 fn visit_look_around_assertion<'ast: 'r, 'r>(
2953 &mut self,
2954 node: &'ast LookAroundAssertion,
2955 __ast_path: &mut AstNodePath<'r>,
2956 ) {
2957 <V as VisitAstPath>::visit_look_around_assertion(&mut **self, node, __ast_path)
2958 }
2959
2960 #[inline]
2961 fn visit_look_around_assertion_kind<'ast: 'r, 'r>(
2962 &mut self,
2963 node: &'ast LookAroundAssertionKind,
2964 __ast_path: &mut AstNodePath<'r>,
2965 ) {
2966 <V as VisitAstPath>::visit_look_around_assertion_kind(&mut **self, node, __ast_path)
2967 }
2968
2969 #[inline]
2970 fn visit_modifier<'ast: 'r, 'r>(
2971 &mut self,
2972 node: &'ast Modifier,
2973 __ast_path: &mut AstNodePath<'r>,
2974 ) {
2975 <V as VisitAstPath>::visit_modifier(&mut **self, node, __ast_path)
2976 }
2977
2978 #[inline]
2979 fn visit_modifiers<'ast: 'r, 'r>(
2980 &mut self,
2981 node: &'ast Modifiers,
2982 __ast_path: &mut AstNodePath<'r>,
2983 ) {
2984 <V as VisitAstPath>::visit_modifiers(&mut **self, node, __ast_path)
2985 }
2986
2987 #[inline]
2988 fn visit_named_reference<'ast: 'r, 'r>(
2989 &mut self,
2990 node: &'ast NamedReference,
2991 __ast_path: &mut AstNodePath<'r>,
2992 ) {
2993 <V as VisitAstPath>::visit_named_reference(&mut **self, node, __ast_path)
2994 }
2995
2996 #[inline]
2997 fn visit_opt_atom<'ast: 'r, 'r>(
2998 &mut self,
2999 node: &'ast Option<swc_atoms::Atom>,
3000 __ast_path: &mut AstNodePath<'r>,
3001 ) {
3002 <V as VisitAstPath>::visit_opt_atom(&mut **self, node, __ast_path)
3003 }
3004
3005 #[inline]
3006 fn visit_opt_modifiers<'ast: 'r, 'r>(
3007 &mut self,
3008 node: &'ast Option<Modifiers>,
3009 __ast_path: &mut AstNodePath<'r>,
3010 ) {
3011 <V as VisitAstPath>::visit_opt_modifiers(&mut **self, node, __ast_path)
3012 }
3013
3014 #[inline]
3015 fn visit_pattern<'ast: 'r, 'r>(
3016 &mut self,
3017 node: &'ast Pattern,
3018 __ast_path: &mut AstNodePath<'r>,
3019 ) {
3020 <V as VisitAstPath>::visit_pattern(&mut **self, node, __ast_path)
3021 }
3022
3023 #[inline]
3024 fn visit_quantifier<'ast: 'r, 'r>(
3025 &mut self,
3026 node: &'ast Quantifier,
3027 __ast_path: &mut AstNodePath<'r>,
3028 ) {
3029 <V as VisitAstPath>::visit_quantifier(&mut **self, node, __ast_path)
3030 }
3031
3032 #[inline]
3033 fn visit_span<'ast: 'r, 'r>(
3034 &mut self,
3035 node: &'ast swc_common::Span,
3036 __ast_path: &mut AstNodePath<'r>,
3037 ) {
3038 <V as VisitAstPath>::visit_span(&mut **self, node, __ast_path)
3039 }
3040
3041 #[inline]
3042 fn visit_term<'ast: 'r, 'r>(&mut self, node: &'ast Term, __ast_path: &mut AstNodePath<'r>) {
3043 <V as VisitAstPath>::visit_term(&mut **self, node, __ast_path)
3044 }
3045
3046 #[inline]
3047 fn visit_terms<'ast: 'r, 'r>(&mut self, node: &'ast [Term], __ast_path: &mut AstNodePath<'r>) {
3048 <V as VisitAstPath>::visit_terms(&mut **self, node, __ast_path)
3049 }
3050
3051 #[inline]
3052 fn visit_unicode_property_escape<'ast: 'r, 'r>(
3053 &mut self,
3054 node: &'ast UnicodePropertyEscape,
3055 __ast_path: &mut AstNodePath<'r>,
3056 ) {
3057 <V as VisitAstPath>::visit_unicode_property_escape(&mut **self, node, __ast_path)
3058 }
3059}
3060#[cfg(any(docsrs, feature = "path"))]
3061#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
3062impl<A, B> VisitAstPath for ::swc_visit::Either<A, B>
3063where
3064 A: VisitAstPath,
3065 B: VisitAstPath,
3066{
3067 #[inline]
3068 fn visit_alternative<'ast: 'r, 'r>(
3069 &mut self,
3070 node: &'ast Alternative,
3071 __ast_path: &mut AstNodePath<'r>,
3072 ) {
3073 match self {
3074 swc_visit::Either::Left(visitor) => {
3075 VisitAstPath::visit_alternative(visitor, node, __ast_path)
3076 }
3077 swc_visit::Either::Right(visitor) => {
3078 VisitAstPath::visit_alternative(visitor, node, __ast_path)
3079 }
3080 }
3081 }
3082
3083 #[inline]
3084 fn visit_alternatives<'ast: 'r, 'r>(
3085 &mut self,
3086 node: &'ast [Alternative],
3087 __ast_path: &mut AstNodePath<'r>,
3088 ) {
3089 match self {
3090 swc_visit::Either::Left(visitor) => {
3091 VisitAstPath::visit_alternatives(visitor, node, __ast_path)
3092 }
3093 swc_visit::Either::Right(visitor) => {
3094 VisitAstPath::visit_alternatives(visitor, node, __ast_path)
3095 }
3096 }
3097 }
3098
3099 #[inline]
3100 fn visit_atom<'ast: 'r, 'r>(
3101 &mut self,
3102 node: &'ast swc_atoms::Atom,
3103 __ast_path: &mut AstNodePath<'r>,
3104 ) {
3105 match self {
3106 swc_visit::Either::Left(visitor) => VisitAstPath::visit_atom(visitor, node, __ast_path),
3107 swc_visit::Either::Right(visitor) => {
3108 VisitAstPath::visit_atom(visitor, node, __ast_path)
3109 }
3110 }
3111 }
3112
3113 #[inline]
3114 fn visit_boundary_assertion<'ast: 'r, 'r>(
3115 &mut self,
3116 node: &'ast BoundaryAssertion,
3117 __ast_path: &mut AstNodePath<'r>,
3118 ) {
3119 match self {
3120 swc_visit::Either::Left(visitor) => {
3121 VisitAstPath::visit_boundary_assertion(visitor, node, __ast_path)
3122 }
3123 swc_visit::Either::Right(visitor) => {
3124 VisitAstPath::visit_boundary_assertion(visitor, node, __ast_path)
3125 }
3126 }
3127 }
3128
3129 #[inline]
3130 fn visit_boundary_assertion_kind<'ast: 'r, 'r>(
3131 &mut self,
3132 node: &'ast BoundaryAssertionKind,
3133 __ast_path: &mut AstNodePath<'r>,
3134 ) {
3135 match self {
3136 swc_visit::Either::Left(visitor) => {
3137 VisitAstPath::visit_boundary_assertion_kind(visitor, node, __ast_path)
3138 }
3139 swc_visit::Either::Right(visitor) => {
3140 VisitAstPath::visit_boundary_assertion_kind(visitor, node, __ast_path)
3141 }
3142 }
3143 }
3144
3145 #[inline]
3146 fn visit_capturing_group<'ast: 'r, 'r>(
3147 &mut self,
3148 node: &'ast CapturingGroup,
3149 __ast_path: &mut AstNodePath<'r>,
3150 ) {
3151 match self {
3152 swc_visit::Either::Left(visitor) => {
3153 VisitAstPath::visit_capturing_group(visitor, node, __ast_path)
3154 }
3155 swc_visit::Either::Right(visitor) => {
3156 VisitAstPath::visit_capturing_group(visitor, node, __ast_path)
3157 }
3158 }
3159 }
3160
3161 #[inline]
3162 fn visit_character<'ast: 'r, 'r>(
3163 &mut self,
3164 node: &'ast Character,
3165 __ast_path: &mut AstNodePath<'r>,
3166 ) {
3167 match self {
3168 swc_visit::Either::Left(visitor) => {
3169 VisitAstPath::visit_character(visitor, node, __ast_path)
3170 }
3171 swc_visit::Either::Right(visitor) => {
3172 VisitAstPath::visit_character(visitor, node, __ast_path)
3173 }
3174 }
3175 }
3176
3177 #[inline]
3178 fn visit_character_class<'ast: 'r, 'r>(
3179 &mut self,
3180 node: &'ast CharacterClass,
3181 __ast_path: &mut AstNodePath<'r>,
3182 ) {
3183 match self {
3184 swc_visit::Either::Left(visitor) => {
3185 VisitAstPath::visit_character_class(visitor, node, __ast_path)
3186 }
3187 swc_visit::Either::Right(visitor) => {
3188 VisitAstPath::visit_character_class(visitor, node, __ast_path)
3189 }
3190 }
3191 }
3192
3193 #[inline]
3194 fn visit_character_class_contents<'ast: 'r, 'r>(
3195 &mut self,
3196 node: &'ast CharacterClassContents,
3197 __ast_path: &mut AstNodePath<'r>,
3198 ) {
3199 match self {
3200 swc_visit::Either::Left(visitor) => {
3201 VisitAstPath::visit_character_class_contents(visitor, node, __ast_path)
3202 }
3203 swc_visit::Either::Right(visitor) => {
3204 VisitAstPath::visit_character_class_contents(visitor, node, __ast_path)
3205 }
3206 }
3207 }
3208
3209 #[inline]
3210 fn visit_character_class_contents_kind<'ast: 'r, 'r>(
3211 &mut self,
3212 node: &'ast CharacterClassContentsKind,
3213 __ast_path: &mut AstNodePath<'r>,
3214 ) {
3215 match self {
3216 swc_visit::Either::Left(visitor) => {
3217 VisitAstPath::visit_character_class_contents_kind(visitor, node, __ast_path)
3218 }
3219 swc_visit::Either::Right(visitor) => {
3220 VisitAstPath::visit_character_class_contents_kind(visitor, node, __ast_path)
3221 }
3222 }
3223 }
3224
3225 #[inline]
3226 fn visit_character_class_contentss<'ast: 'r, 'r>(
3227 &mut self,
3228 node: &'ast [CharacterClassContents],
3229 __ast_path: &mut AstNodePath<'r>,
3230 ) {
3231 match self {
3232 swc_visit::Either::Left(visitor) => {
3233 VisitAstPath::visit_character_class_contentss(visitor, node, __ast_path)
3234 }
3235 swc_visit::Either::Right(visitor) => {
3236 VisitAstPath::visit_character_class_contentss(visitor, node, __ast_path)
3237 }
3238 }
3239 }
3240
3241 #[inline]
3242 fn visit_character_class_escape<'ast: 'r, 'r>(
3243 &mut self,
3244 node: &'ast CharacterClassEscape,
3245 __ast_path: &mut AstNodePath<'r>,
3246 ) {
3247 match self {
3248 swc_visit::Either::Left(visitor) => {
3249 VisitAstPath::visit_character_class_escape(visitor, node, __ast_path)
3250 }
3251 swc_visit::Either::Right(visitor) => {
3252 VisitAstPath::visit_character_class_escape(visitor, node, __ast_path)
3253 }
3254 }
3255 }
3256
3257 #[inline]
3258 fn visit_character_class_escape_kind<'ast: 'r, 'r>(
3259 &mut self,
3260 node: &'ast CharacterClassEscapeKind,
3261 __ast_path: &mut AstNodePath<'r>,
3262 ) {
3263 match self {
3264 swc_visit::Either::Left(visitor) => {
3265 VisitAstPath::visit_character_class_escape_kind(visitor, node, __ast_path)
3266 }
3267 swc_visit::Either::Right(visitor) => {
3268 VisitAstPath::visit_character_class_escape_kind(visitor, node, __ast_path)
3269 }
3270 }
3271 }
3272
3273 #[inline]
3274 fn visit_character_class_range<'ast: 'r, 'r>(
3275 &mut self,
3276 node: &'ast CharacterClassRange,
3277 __ast_path: &mut AstNodePath<'r>,
3278 ) {
3279 match self {
3280 swc_visit::Either::Left(visitor) => {
3281 VisitAstPath::visit_character_class_range(visitor, node, __ast_path)
3282 }
3283 swc_visit::Either::Right(visitor) => {
3284 VisitAstPath::visit_character_class_range(visitor, node, __ast_path)
3285 }
3286 }
3287 }
3288
3289 #[inline]
3290 fn visit_character_kind<'ast: 'r, 'r>(
3291 &mut self,
3292 node: &'ast CharacterKind,
3293 __ast_path: &mut AstNodePath<'r>,
3294 ) {
3295 match self {
3296 swc_visit::Either::Left(visitor) => {
3297 VisitAstPath::visit_character_kind(visitor, node, __ast_path)
3298 }
3299 swc_visit::Either::Right(visitor) => {
3300 VisitAstPath::visit_character_kind(visitor, node, __ast_path)
3301 }
3302 }
3303 }
3304
3305 #[inline]
3306 fn visit_characters<'ast: 'r, 'r>(
3307 &mut self,
3308 node: &'ast [Character],
3309 __ast_path: &mut AstNodePath<'r>,
3310 ) {
3311 match self {
3312 swc_visit::Either::Left(visitor) => {
3313 VisitAstPath::visit_characters(visitor, node, __ast_path)
3314 }
3315 swc_visit::Either::Right(visitor) => {
3316 VisitAstPath::visit_characters(visitor, node, __ast_path)
3317 }
3318 }
3319 }
3320
3321 #[inline]
3322 fn visit_class_string<'ast: 'r, 'r>(
3323 &mut self,
3324 node: &'ast ClassString,
3325 __ast_path: &mut AstNodePath<'r>,
3326 ) {
3327 match self {
3328 swc_visit::Either::Left(visitor) => {
3329 VisitAstPath::visit_class_string(visitor, node, __ast_path)
3330 }
3331 swc_visit::Either::Right(visitor) => {
3332 VisitAstPath::visit_class_string(visitor, node, __ast_path)
3333 }
3334 }
3335 }
3336
3337 #[inline]
3338 fn visit_class_string_disjunction<'ast: 'r, 'r>(
3339 &mut self,
3340 node: &'ast ClassStringDisjunction,
3341 __ast_path: &mut AstNodePath<'r>,
3342 ) {
3343 match self {
3344 swc_visit::Either::Left(visitor) => {
3345 VisitAstPath::visit_class_string_disjunction(visitor, node, __ast_path)
3346 }
3347 swc_visit::Either::Right(visitor) => {
3348 VisitAstPath::visit_class_string_disjunction(visitor, node, __ast_path)
3349 }
3350 }
3351 }
3352
3353 #[inline]
3354 fn visit_class_strings<'ast: 'r, 'r>(
3355 &mut self,
3356 node: &'ast [ClassString],
3357 __ast_path: &mut AstNodePath<'r>,
3358 ) {
3359 match self {
3360 swc_visit::Either::Left(visitor) => {
3361 VisitAstPath::visit_class_strings(visitor, node, __ast_path)
3362 }
3363 swc_visit::Either::Right(visitor) => {
3364 VisitAstPath::visit_class_strings(visitor, node, __ast_path)
3365 }
3366 }
3367 }
3368
3369 #[inline]
3370 fn visit_disjunction<'ast: 'r, 'r>(
3371 &mut self,
3372 node: &'ast Disjunction,
3373 __ast_path: &mut AstNodePath<'r>,
3374 ) {
3375 match self {
3376 swc_visit::Either::Left(visitor) => {
3377 VisitAstPath::visit_disjunction(visitor, node, __ast_path)
3378 }
3379 swc_visit::Either::Right(visitor) => {
3380 VisitAstPath::visit_disjunction(visitor, node, __ast_path)
3381 }
3382 }
3383 }
3384
3385 #[inline]
3386 fn visit_dot<'ast: 'r, 'r>(&mut self, node: &'ast Dot, __ast_path: &mut AstNodePath<'r>) {
3387 match self {
3388 swc_visit::Either::Left(visitor) => VisitAstPath::visit_dot(visitor, node, __ast_path),
3389 swc_visit::Either::Right(visitor) => VisitAstPath::visit_dot(visitor, node, __ast_path),
3390 }
3391 }
3392
3393 #[inline]
3394 fn visit_ignore_group<'ast: 'r, 'r>(
3395 &mut self,
3396 node: &'ast IgnoreGroup,
3397 __ast_path: &mut AstNodePath<'r>,
3398 ) {
3399 match self {
3400 swc_visit::Either::Left(visitor) => {
3401 VisitAstPath::visit_ignore_group(visitor, node, __ast_path)
3402 }
3403 swc_visit::Either::Right(visitor) => {
3404 VisitAstPath::visit_ignore_group(visitor, node, __ast_path)
3405 }
3406 }
3407 }
3408
3409 #[inline]
3410 fn visit_indexed_reference<'ast: 'r, 'r>(
3411 &mut self,
3412 node: &'ast IndexedReference,
3413 __ast_path: &mut AstNodePath<'r>,
3414 ) {
3415 match self {
3416 swc_visit::Either::Left(visitor) => {
3417 VisitAstPath::visit_indexed_reference(visitor, node, __ast_path)
3418 }
3419 swc_visit::Either::Right(visitor) => {
3420 VisitAstPath::visit_indexed_reference(visitor, node, __ast_path)
3421 }
3422 }
3423 }
3424
3425 #[inline]
3426 fn visit_look_around_assertion<'ast: 'r, 'r>(
3427 &mut self,
3428 node: &'ast LookAroundAssertion,
3429 __ast_path: &mut AstNodePath<'r>,
3430 ) {
3431 match self {
3432 swc_visit::Either::Left(visitor) => {
3433 VisitAstPath::visit_look_around_assertion(visitor, node, __ast_path)
3434 }
3435 swc_visit::Either::Right(visitor) => {
3436 VisitAstPath::visit_look_around_assertion(visitor, node, __ast_path)
3437 }
3438 }
3439 }
3440
3441 #[inline]
3442 fn visit_look_around_assertion_kind<'ast: 'r, 'r>(
3443 &mut self,
3444 node: &'ast LookAroundAssertionKind,
3445 __ast_path: &mut AstNodePath<'r>,
3446 ) {
3447 match self {
3448 swc_visit::Either::Left(visitor) => {
3449 VisitAstPath::visit_look_around_assertion_kind(visitor, node, __ast_path)
3450 }
3451 swc_visit::Either::Right(visitor) => {
3452 VisitAstPath::visit_look_around_assertion_kind(visitor, node, __ast_path)
3453 }
3454 }
3455 }
3456
3457 #[inline]
3458 fn visit_modifier<'ast: 'r, 'r>(
3459 &mut self,
3460 node: &'ast Modifier,
3461 __ast_path: &mut AstNodePath<'r>,
3462 ) {
3463 match self {
3464 swc_visit::Either::Left(visitor) => {
3465 VisitAstPath::visit_modifier(visitor, node, __ast_path)
3466 }
3467 swc_visit::Either::Right(visitor) => {
3468 VisitAstPath::visit_modifier(visitor, node, __ast_path)
3469 }
3470 }
3471 }
3472
3473 #[inline]
3474 fn visit_modifiers<'ast: 'r, 'r>(
3475 &mut self,
3476 node: &'ast Modifiers,
3477 __ast_path: &mut AstNodePath<'r>,
3478 ) {
3479 match self {
3480 swc_visit::Either::Left(visitor) => {
3481 VisitAstPath::visit_modifiers(visitor, node, __ast_path)
3482 }
3483 swc_visit::Either::Right(visitor) => {
3484 VisitAstPath::visit_modifiers(visitor, node, __ast_path)
3485 }
3486 }
3487 }
3488
3489 #[inline]
3490 fn visit_named_reference<'ast: 'r, 'r>(
3491 &mut self,
3492 node: &'ast NamedReference,
3493 __ast_path: &mut AstNodePath<'r>,
3494 ) {
3495 match self {
3496 swc_visit::Either::Left(visitor) => {
3497 VisitAstPath::visit_named_reference(visitor, node, __ast_path)
3498 }
3499 swc_visit::Either::Right(visitor) => {
3500 VisitAstPath::visit_named_reference(visitor, node, __ast_path)
3501 }
3502 }
3503 }
3504
3505 #[inline]
3506 fn visit_opt_atom<'ast: 'r, 'r>(
3507 &mut self,
3508 node: &'ast Option<swc_atoms::Atom>,
3509 __ast_path: &mut AstNodePath<'r>,
3510 ) {
3511 match self {
3512 swc_visit::Either::Left(visitor) => {
3513 VisitAstPath::visit_opt_atom(visitor, node, __ast_path)
3514 }
3515 swc_visit::Either::Right(visitor) => {
3516 VisitAstPath::visit_opt_atom(visitor, node, __ast_path)
3517 }
3518 }
3519 }
3520
3521 #[inline]
3522 fn visit_opt_modifiers<'ast: 'r, 'r>(
3523 &mut self,
3524 node: &'ast Option<Modifiers>,
3525 __ast_path: &mut AstNodePath<'r>,
3526 ) {
3527 match self {
3528 swc_visit::Either::Left(visitor) => {
3529 VisitAstPath::visit_opt_modifiers(visitor, node, __ast_path)
3530 }
3531 swc_visit::Either::Right(visitor) => {
3532 VisitAstPath::visit_opt_modifiers(visitor, node, __ast_path)
3533 }
3534 }
3535 }
3536
3537 #[inline]
3538 fn visit_pattern<'ast: 'r, 'r>(
3539 &mut self,
3540 node: &'ast Pattern,
3541 __ast_path: &mut AstNodePath<'r>,
3542 ) {
3543 match self {
3544 swc_visit::Either::Left(visitor) => {
3545 VisitAstPath::visit_pattern(visitor, node, __ast_path)
3546 }
3547 swc_visit::Either::Right(visitor) => {
3548 VisitAstPath::visit_pattern(visitor, node, __ast_path)
3549 }
3550 }
3551 }
3552
3553 #[inline]
3554 fn visit_quantifier<'ast: 'r, 'r>(
3555 &mut self,
3556 node: &'ast Quantifier,
3557 __ast_path: &mut AstNodePath<'r>,
3558 ) {
3559 match self {
3560 swc_visit::Either::Left(visitor) => {
3561 VisitAstPath::visit_quantifier(visitor, node, __ast_path)
3562 }
3563 swc_visit::Either::Right(visitor) => {
3564 VisitAstPath::visit_quantifier(visitor, node, __ast_path)
3565 }
3566 }
3567 }
3568
3569 #[inline]
3570 fn visit_span<'ast: 'r, 'r>(
3571 &mut self,
3572 node: &'ast swc_common::Span,
3573 __ast_path: &mut AstNodePath<'r>,
3574 ) {
3575 match self {
3576 swc_visit::Either::Left(visitor) => VisitAstPath::visit_span(visitor, node, __ast_path),
3577 swc_visit::Either::Right(visitor) => {
3578 VisitAstPath::visit_span(visitor, node, __ast_path)
3579 }
3580 }
3581 }
3582
3583 #[inline]
3584 fn visit_term<'ast: 'r, 'r>(&mut self, node: &'ast Term, __ast_path: &mut AstNodePath<'r>) {
3585 match self {
3586 swc_visit::Either::Left(visitor) => VisitAstPath::visit_term(visitor, node, __ast_path),
3587 swc_visit::Either::Right(visitor) => {
3588 VisitAstPath::visit_term(visitor, node, __ast_path)
3589 }
3590 }
3591 }
3592
3593 #[inline]
3594 fn visit_terms<'ast: 'r, 'r>(&mut self, node: &'ast [Term], __ast_path: &mut AstNodePath<'r>) {
3595 match self {
3596 swc_visit::Either::Left(visitor) => {
3597 VisitAstPath::visit_terms(visitor, node, __ast_path)
3598 }
3599 swc_visit::Either::Right(visitor) => {
3600 VisitAstPath::visit_terms(visitor, node, __ast_path)
3601 }
3602 }
3603 }
3604
3605 #[inline]
3606 fn visit_unicode_property_escape<'ast: 'r, 'r>(
3607 &mut self,
3608 node: &'ast UnicodePropertyEscape,
3609 __ast_path: &mut AstNodePath<'r>,
3610 ) {
3611 match self {
3612 swc_visit::Either::Left(visitor) => {
3613 VisitAstPath::visit_unicode_property_escape(visitor, node, __ast_path)
3614 }
3615 swc_visit::Either::Right(visitor) => {
3616 VisitAstPath::visit_unicode_property_escape(visitor, node, __ast_path)
3617 }
3618 }
3619 }
3620}
3621#[cfg(any(docsrs, feature = "path"))]
3622#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
3623impl<V> VisitAstPath for ::swc_visit::Optional<V>
3624where
3625 V: VisitAstPath,
3626{
3627 #[inline]
3628 fn visit_alternative<'ast: 'r, 'r>(
3629 &mut self,
3630 node: &'ast Alternative,
3631 __ast_path: &mut AstNodePath<'r>,
3632 ) {
3633 if self.enabled {
3634 <V as VisitAstPath>::visit_alternative(&mut self.visitor, node, __ast_path)
3635 } else {
3636 }
3637 }
3638
3639 #[inline]
3640 fn visit_alternatives<'ast: 'r, 'r>(
3641 &mut self,
3642 node: &'ast [Alternative],
3643 __ast_path: &mut AstNodePath<'r>,
3644 ) {
3645 if self.enabled {
3646 <V as VisitAstPath>::visit_alternatives(&mut self.visitor, node, __ast_path)
3647 } else {
3648 }
3649 }
3650
3651 #[inline]
3652 fn visit_atom<'ast: 'r, 'r>(
3653 &mut self,
3654 node: &'ast swc_atoms::Atom,
3655 __ast_path: &mut AstNodePath<'r>,
3656 ) {
3657 if self.enabled {
3658 <V as VisitAstPath>::visit_atom(&mut self.visitor, node, __ast_path)
3659 } else {
3660 }
3661 }
3662
3663 #[inline]
3664 fn visit_boundary_assertion<'ast: 'r, 'r>(
3665 &mut self,
3666 node: &'ast BoundaryAssertion,
3667 __ast_path: &mut AstNodePath<'r>,
3668 ) {
3669 if self.enabled {
3670 <V as VisitAstPath>::visit_boundary_assertion(&mut self.visitor, node, __ast_path)
3671 } else {
3672 }
3673 }
3674
3675 #[inline]
3676 fn visit_boundary_assertion_kind<'ast: 'r, 'r>(
3677 &mut self,
3678 node: &'ast BoundaryAssertionKind,
3679 __ast_path: &mut AstNodePath<'r>,
3680 ) {
3681 if self.enabled {
3682 <V as VisitAstPath>::visit_boundary_assertion_kind(&mut self.visitor, node, __ast_path)
3683 } else {
3684 }
3685 }
3686
3687 #[inline]
3688 fn visit_capturing_group<'ast: 'r, 'r>(
3689 &mut self,
3690 node: &'ast CapturingGroup,
3691 __ast_path: &mut AstNodePath<'r>,
3692 ) {
3693 if self.enabled {
3694 <V as VisitAstPath>::visit_capturing_group(&mut self.visitor, node, __ast_path)
3695 } else {
3696 }
3697 }
3698
3699 #[inline]
3700 fn visit_character<'ast: 'r, 'r>(
3701 &mut self,
3702 node: &'ast Character,
3703 __ast_path: &mut AstNodePath<'r>,
3704 ) {
3705 if self.enabled {
3706 <V as VisitAstPath>::visit_character(&mut self.visitor, node, __ast_path)
3707 } else {
3708 }
3709 }
3710
3711 #[inline]
3712 fn visit_character_class<'ast: 'r, 'r>(
3713 &mut self,
3714 node: &'ast CharacterClass,
3715 __ast_path: &mut AstNodePath<'r>,
3716 ) {
3717 if self.enabled {
3718 <V as VisitAstPath>::visit_character_class(&mut self.visitor, node, __ast_path)
3719 } else {
3720 }
3721 }
3722
3723 #[inline]
3724 fn visit_character_class_contents<'ast: 'r, 'r>(
3725 &mut self,
3726 node: &'ast CharacterClassContents,
3727 __ast_path: &mut AstNodePath<'r>,
3728 ) {
3729 if self.enabled {
3730 <V as VisitAstPath>::visit_character_class_contents(&mut self.visitor, node, __ast_path)
3731 } else {
3732 }
3733 }
3734
3735 #[inline]
3736 fn visit_character_class_contents_kind<'ast: 'r, 'r>(
3737 &mut self,
3738 node: &'ast CharacterClassContentsKind,
3739 __ast_path: &mut AstNodePath<'r>,
3740 ) {
3741 if self.enabled {
3742 <V as VisitAstPath>::visit_character_class_contents_kind(
3743 &mut self.visitor,
3744 node,
3745 __ast_path,
3746 )
3747 } else {
3748 }
3749 }
3750
3751 #[inline]
3752 fn visit_character_class_contentss<'ast: 'r, 'r>(
3753 &mut self,
3754 node: &'ast [CharacterClassContents],
3755 __ast_path: &mut AstNodePath<'r>,
3756 ) {
3757 if self.enabled {
3758 <V as VisitAstPath>::visit_character_class_contentss(
3759 &mut self.visitor,
3760 node,
3761 __ast_path,
3762 )
3763 } else {
3764 }
3765 }
3766
3767 #[inline]
3768 fn visit_character_class_escape<'ast: 'r, 'r>(
3769 &mut self,
3770 node: &'ast CharacterClassEscape,
3771 __ast_path: &mut AstNodePath<'r>,
3772 ) {
3773 if self.enabled {
3774 <V as VisitAstPath>::visit_character_class_escape(&mut self.visitor, node, __ast_path)
3775 } else {
3776 }
3777 }
3778
3779 #[inline]
3780 fn visit_character_class_escape_kind<'ast: 'r, 'r>(
3781 &mut self,
3782 node: &'ast CharacterClassEscapeKind,
3783 __ast_path: &mut AstNodePath<'r>,
3784 ) {
3785 if self.enabled {
3786 <V as VisitAstPath>::visit_character_class_escape_kind(
3787 &mut self.visitor,
3788 node,
3789 __ast_path,
3790 )
3791 } else {
3792 }
3793 }
3794
3795 #[inline]
3796 fn visit_character_class_range<'ast: 'r, 'r>(
3797 &mut self,
3798 node: &'ast CharacterClassRange,
3799 __ast_path: &mut AstNodePath<'r>,
3800 ) {
3801 if self.enabled {
3802 <V as VisitAstPath>::visit_character_class_range(&mut self.visitor, node, __ast_path)
3803 } else {
3804 }
3805 }
3806
3807 #[inline]
3808 fn visit_character_kind<'ast: 'r, 'r>(
3809 &mut self,
3810 node: &'ast CharacterKind,
3811 __ast_path: &mut AstNodePath<'r>,
3812 ) {
3813 if self.enabled {
3814 <V as VisitAstPath>::visit_character_kind(&mut self.visitor, node, __ast_path)
3815 } else {
3816 }
3817 }
3818
3819 #[inline]
3820 fn visit_characters<'ast: 'r, 'r>(
3821 &mut self,
3822 node: &'ast [Character],
3823 __ast_path: &mut AstNodePath<'r>,
3824 ) {
3825 if self.enabled {
3826 <V as VisitAstPath>::visit_characters(&mut self.visitor, node, __ast_path)
3827 } else {
3828 }
3829 }
3830
3831 #[inline]
3832 fn visit_class_string<'ast: 'r, 'r>(
3833 &mut self,
3834 node: &'ast ClassString,
3835 __ast_path: &mut AstNodePath<'r>,
3836 ) {
3837 if self.enabled {
3838 <V as VisitAstPath>::visit_class_string(&mut self.visitor, node, __ast_path)
3839 } else {
3840 }
3841 }
3842
3843 #[inline]
3844 fn visit_class_string_disjunction<'ast: 'r, 'r>(
3845 &mut self,
3846 node: &'ast ClassStringDisjunction,
3847 __ast_path: &mut AstNodePath<'r>,
3848 ) {
3849 if self.enabled {
3850 <V as VisitAstPath>::visit_class_string_disjunction(&mut self.visitor, node, __ast_path)
3851 } else {
3852 }
3853 }
3854
3855 #[inline]
3856 fn visit_class_strings<'ast: 'r, 'r>(
3857 &mut self,
3858 node: &'ast [ClassString],
3859 __ast_path: &mut AstNodePath<'r>,
3860 ) {
3861 if self.enabled {
3862 <V as VisitAstPath>::visit_class_strings(&mut self.visitor, node, __ast_path)
3863 } else {
3864 }
3865 }
3866
3867 #[inline]
3868 fn visit_disjunction<'ast: 'r, 'r>(
3869 &mut self,
3870 node: &'ast Disjunction,
3871 __ast_path: &mut AstNodePath<'r>,
3872 ) {
3873 if self.enabled {
3874 <V as VisitAstPath>::visit_disjunction(&mut self.visitor, node, __ast_path)
3875 } else {
3876 }
3877 }
3878
3879 #[inline]
3880 fn visit_dot<'ast: 'r, 'r>(&mut self, node: &'ast Dot, __ast_path: &mut AstNodePath<'r>) {
3881 if self.enabled {
3882 <V as VisitAstPath>::visit_dot(&mut self.visitor, node, __ast_path)
3883 } else {
3884 }
3885 }
3886
3887 #[inline]
3888 fn visit_ignore_group<'ast: 'r, 'r>(
3889 &mut self,
3890 node: &'ast IgnoreGroup,
3891 __ast_path: &mut AstNodePath<'r>,
3892 ) {
3893 if self.enabled {
3894 <V as VisitAstPath>::visit_ignore_group(&mut self.visitor, node, __ast_path)
3895 } else {
3896 }
3897 }
3898
3899 #[inline]
3900 fn visit_indexed_reference<'ast: 'r, 'r>(
3901 &mut self,
3902 node: &'ast IndexedReference,
3903 __ast_path: &mut AstNodePath<'r>,
3904 ) {
3905 if self.enabled {
3906 <V as VisitAstPath>::visit_indexed_reference(&mut self.visitor, node, __ast_path)
3907 } else {
3908 }
3909 }
3910
3911 #[inline]
3912 fn visit_look_around_assertion<'ast: 'r, 'r>(
3913 &mut self,
3914 node: &'ast LookAroundAssertion,
3915 __ast_path: &mut AstNodePath<'r>,
3916 ) {
3917 if self.enabled {
3918 <V as VisitAstPath>::visit_look_around_assertion(&mut self.visitor, node, __ast_path)
3919 } else {
3920 }
3921 }
3922
3923 #[inline]
3924 fn visit_look_around_assertion_kind<'ast: 'r, 'r>(
3925 &mut self,
3926 node: &'ast LookAroundAssertionKind,
3927 __ast_path: &mut AstNodePath<'r>,
3928 ) {
3929 if self.enabled {
3930 <V as VisitAstPath>::visit_look_around_assertion_kind(
3931 &mut self.visitor,
3932 node,
3933 __ast_path,
3934 )
3935 } else {
3936 }
3937 }
3938
3939 #[inline]
3940 fn visit_modifier<'ast: 'r, 'r>(
3941 &mut self,
3942 node: &'ast Modifier,
3943 __ast_path: &mut AstNodePath<'r>,
3944 ) {
3945 if self.enabled {
3946 <V as VisitAstPath>::visit_modifier(&mut self.visitor, node, __ast_path)
3947 } else {
3948 }
3949 }
3950
3951 #[inline]
3952 fn visit_modifiers<'ast: 'r, 'r>(
3953 &mut self,
3954 node: &'ast Modifiers,
3955 __ast_path: &mut AstNodePath<'r>,
3956 ) {
3957 if self.enabled {
3958 <V as VisitAstPath>::visit_modifiers(&mut self.visitor, node, __ast_path)
3959 } else {
3960 }
3961 }
3962
3963 #[inline]
3964 fn visit_named_reference<'ast: 'r, 'r>(
3965 &mut self,
3966 node: &'ast NamedReference,
3967 __ast_path: &mut AstNodePath<'r>,
3968 ) {
3969 if self.enabled {
3970 <V as VisitAstPath>::visit_named_reference(&mut self.visitor, node, __ast_path)
3971 } else {
3972 }
3973 }
3974
3975 #[inline]
3976 fn visit_opt_atom<'ast: 'r, 'r>(
3977 &mut self,
3978 node: &'ast Option<swc_atoms::Atom>,
3979 __ast_path: &mut AstNodePath<'r>,
3980 ) {
3981 if self.enabled {
3982 <V as VisitAstPath>::visit_opt_atom(&mut self.visitor, node, __ast_path)
3983 } else {
3984 }
3985 }
3986
3987 #[inline]
3988 fn visit_opt_modifiers<'ast: 'r, 'r>(
3989 &mut self,
3990 node: &'ast Option<Modifiers>,
3991 __ast_path: &mut AstNodePath<'r>,
3992 ) {
3993 if self.enabled {
3994 <V as VisitAstPath>::visit_opt_modifiers(&mut self.visitor, node, __ast_path)
3995 } else {
3996 }
3997 }
3998
3999 #[inline]
4000 fn visit_pattern<'ast: 'r, 'r>(
4001 &mut self,
4002 node: &'ast Pattern,
4003 __ast_path: &mut AstNodePath<'r>,
4004 ) {
4005 if self.enabled {
4006 <V as VisitAstPath>::visit_pattern(&mut self.visitor, node, __ast_path)
4007 } else {
4008 }
4009 }
4010
4011 #[inline]
4012 fn visit_quantifier<'ast: 'r, 'r>(
4013 &mut self,
4014 node: &'ast Quantifier,
4015 __ast_path: &mut AstNodePath<'r>,
4016 ) {
4017 if self.enabled {
4018 <V as VisitAstPath>::visit_quantifier(&mut self.visitor, node, __ast_path)
4019 } else {
4020 }
4021 }
4022
4023 #[inline]
4024 fn visit_span<'ast: 'r, 'r>(
4025 &mut self,
4026 node: &'ast swc_common::Span,
4027 __ast_path: &mut AstNodePath<'r>,
4028 ) {
4029 if self.enabled {
4030 <V as VisitAstPath>::visit_span(&mut self.visitor, node, __ast_path)
4031 } else {
4032 }
4033 }
4034
4035 #[inline]
4036 fn visit_term<'ast: 'r, 'r>(&mut self, node: &'ast Term, __ast_path: &mut AstNodePath<'r>) {
4037 if self.enabled {
4038 <V as VisitAstPath>::visit_term(&mut self.visitor, node, __ast_path)
4039 } else {
4040 }
4041 }
4042
4043 #[inline]
4044 fn visit_terms<'ast: 'r, 'r>(&mut self, node: &'ast [Term], __ast_path: &mut AstNodePath<'r>) {
4045 if self.enabled {
4046 <V as VisitAstPath>::visit_terms(&mut self.visitor, node, __ast_path)
4047 } else {
4048 }
4049 }
4050
4051 #[inline]
4052 fn visit_unicode_property_escape<'ast: 'r, 'r>(
4053 &mut self,
4054 node: &'ast UnicodePropertyEscape,
4055 __ast_path: &mut AstNodePath<'r>,
4056 ) {
4057 if self.enabled {
4058 <V as VisitAstPath>::visit_unicode_property_escape(&mut self.visitor, node, __ast_path)
4059 } else {
4060 }
4061 }
4062}
4063#[doc = r" A trait implemented for types that can be visited using a visitor."]
4064#[cfg(any(docsrs, feature = "path"))]
4065#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4066pub trait VisitWithAstPath<V: ?Sized + VisitAstPath> {
4067 #[doc = r" Calls a visitor method (visitor.fold_xxx) with self."]
4068 fn visit_with_ast_path<'ast: 'r, 'r>(
4069 &'ast self,
4070 visitor: &mut V,
4071 __ast_path: &mut AstNodePath<'r>,
4072 );
4073 #[doc = r" Visit children nodes of `self`` with `visitor`."]
4074 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4075 &'ast self,
4076 visitor: &mut V,
4077 __ast_path: &mut AstNodePath<'r>,
4078 );
4079}
4080#[cfg(any(docsrs, feature = "path"))]
4081#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4082impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for Alternative {
4083 #[doc = "Calls [VisitAstPath`::visit_alternative`] with `self`."]
4084 fn visit_with_ast_path<'ast: 'r, 'r>(
4085 &'ast self,
4086 visitor: &mut V,
4087 __ast_path: &mut AstNodePath<'r>,
4088 ) {
4089 <V as VisitAstPath>::visit_alternative(visitor, self, __ast_path)
4090 }
4091
4092 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4093 &'ast self,
4094 visitor: &mut V,
4095 __ast_path: &mut AstNodePath<'r>,
4096 ) {
4097 match self {
4098 Alternative { span, body } => {
4099 {
4100 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Alternative(
4101 self,
4102 self::fields::AlternativeField::Span,
4103 ));
4104 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
4105 span,
4106 visitor,
4107 &mut *__ast_path,
4108 )
4109 };
4110 {
4111 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Alternative(
4112 self,
4113 self::fields::AlternativeField::Body(usize::MAX),
4114 ));
4115 <Vec<Term> as VisitWithAstPath<V>>::visit_with_ast_path(
4116 body,
4117 visitor,
4118 &mut *__ast_path,
4119 )
4120 };
4121 }
4122 }
4123 }
4124}
4125#[cfg(any(docsrs, feature = "path"))]
4126#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4127impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for BoundaryAssertion {
4128 #[doc = "Calls [VisitAstPath`::visit_boundary_assertion`] with `self`."]
4129 fn visit_with_ast_path<'ast: 'r, 'r>(
4130 &'ast self,
4131 visitor: &mut V,
4132 __ast_path: &mut AstNodePath<'r>,
4133 ) {
4134 <V as VisitAstPath>::visit_boundary_assertion(visitor, self, __ast_path)
4135 }
4136
4137 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4138 &'ast self,
4139 visitor: &mut V,
4140 __ast_path: &mut AstNodePath<'r>,
4141 ) {
4142 match self {
4143 BoundaryAssertion { span, kind } => {
4144 {
4145 let mut __ast_path =
4146 __ast_path.with_guard(AstParentNodeRef::BoundaryAssertion(
4147 self,
4148 self::fields::BoundaryAssertionField::Span,
4149 ));
4150 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
4151 span,
4152 visitor,
4153 &mut *__ast_path,
4154 )
4155 };
4156 {
4157 let mut __ast_path =
4158 __ast_path.with_guard(AstParentNodeRef::BoundaryAssertion(
4159 self,
4160 self::fields::BoundaryAssertionField::Kind,
4161 ));
4162 <BoundaryAssertionKind as VisitWithAstPath<V>>::visit_with_ast_path(
4163 kind,
4164 visitor,
4165 &mut *__ast_path,
4166 )
4167 };
4168 }
4169 }
4170 }
4171}
4172#[cfg(any(docsrs, feature = "path"))]
4173#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4174impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for BoundaryAssertionKind {
4175 #[doc = "Calls [VisitAstPath`::visit_boundary_assertion_kind`] with `self`."]
4176 fn visit_with_ast_path<'ast: 'r, 'r>(
4177 &'ast self,
4178 visitor: &mut V,
4179 __ast_path: &mut AstNodePath<'r>,
4180 ) {
4181 <V as VisitAstPath>::visit_boundary_assertion_kind(visitor, self, __ast_path)
4182 }
4183
4184 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4185 &'ast self,
4186 visitor: &mut V,
4187 __ast_path: &mut AstNodePath<'r>,
4188 ) {
4189 match self {
4190 BoundaryAssertionKind::Start => {}
4191 BoundaryAssertionKind::End => {}
4192 BoundaryAssertionKind::Boundary => {}
4193 BoundaryAssertionKind::NegativeBoundary => {}
4194 }
4195 }
4196}
4197#[cfg(any(docsrs, feature = "path"))]
4198#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4199impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for CapturingGroup {
4200 #[doc = "Calls [VisitAstPath`::visit_capturing_group`] with `self`."]
4201 fn visit_with_ast_path<'ast: 'r, 'r>(
4202 &'ast self,
4203 visitor: &mut V,
4204 __ast_path: &mut AstNodePath<'r>,
4205 ) {
4206 <V as VisitAstPath>::visit_capturing_group(visitor, self, __ast_path)
4207 }
4208
4209 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4210 &'ast self,
4211 visitor: &mut V,
4212 __ast_path: &mut AstNodePath<'r>,
4213 ) {
4214 match self {
4215 CapturingGroup { span, name, body } => {
4216 {
4217 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::CapturingGroup(
4218 self,
4219 self::fields::CapturingGroupField::Span,
4220 ));
4221 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
4222 span,
4223 visitor,
4224 &mut *__ast_path,
4225 )
4226 };
4227 {
4228 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::CapturingGroup(
4229 self,
4230 self::fields::CapturingGroupField::Name,
4231 ));
4232 <Option<swc_atoms::Atom> as VisitWithAstPath<V>>::visit_with_ast_path(
4233 name,
4234 visitor,
4235 &mut *__ast_path,
4236 )
4237 };
4238 {
4239 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::CapturingGroup(
4240 self,
4241 self::fields::CapturingGroupField::Body,
4242 ));
4243 <Disjunction as VisitWithAstPath<V>>::visit_with_ast_path(
4244 body,
4245 visitor,
4246 &mut *__ast_path,
4247 )
4248 };
4249 }
4250 }
4251 }
4252}
4253#[cfg(any(docsrs, feature = "path"))]
4254#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4255impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for Character {
4256 #[doc = "Calls [VisitAstPath`::visit_character`] with `self`."]
4257 fn visit_with_ast_path<'ast: 'r, 'r>(
4258 &'ast self,
4259 visitor: &mut V,
4260 __ast_path: &mut AstNodePath<'r>,
4261 ) {
4262 <V as VisitAstPath>::visit_character(visitor, self, __ast_path)
4263 }
4264
4265 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4266 &'ast self,
4267 visitor: &mut V,
4268 __ast_path: &mut AstNodePath<'r>,
4269 ) {
4270 match self {
4271 Character { span, kind, value } => {
4272 {
4273 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Character(
4274 self,
4275 self::fields::CharacterField::Span,
4276 ));
4277 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
4278 span,
4279 visitor,
4280 &mut *__ast_path,
4281 )
4282 };
4283 {
4284 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Character(
4285 self,
4286 self::fields::CharacterField::Kind,
4287 ));
4288 <CharacterKind as VisitWithAstPath<V>>::visit_with_ast_path(
4289 kind,
4290 visitor,
4291 &mut *__ast_path,
4292 )
4293 };
4294 }
4295 }
4296 }
4297}
4298#[cfg(any(docsrs, feature = "path"))]
4299#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4300impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for CharacterClass {
4301 #[doc = "Calls [VisitAstPath`::visit_character_class`] with `self`."]
4302 fn visit_with_ast_path<'ast: 'r, 'r>(
4303 &'ast self,
4304 visitor: &mut V,
4305 __ast_path: &mut AstNodePath<'r>,
4306 ) {
4307 <V as VisitAstPath>::visit_character_class(visitor, self, __ast_path)
4308 }
4309
4310 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4311 &'ast self,
4312 visitor: &mut V,
4313 __ast_path: &mut AstNodePath<'r>,
4314 ) {
4315 match self {
4316 CharacterClass {
4317 span,
4318 negative,
4319 strings,
4320 kind,
4321 body,
4322 } => {
4323 {
4324 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::CharacterClass(
4325 self,
4326 self::fields::CharacterClassField::Span,
4327 ));
4328 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
4329 span,
4330 visitor,
4331 &mut *__ast_path,
4332 )
4333 };
4334 {
4335 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::CharacterClass(
4336 self,
4337 self::fields::CharacterClassField::Kind,
4338 ));
4339 <CharacterClassContentsKind as VisitWithAstPath<V>>::visit_with_ast_path(
4340 kind,
4341 visitor,
4342 &mut *__ast_path,
4343 )
4344 };
4345 {
4346 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::CharacterClass(
4347 self,
4348 self::fields::CharacterClassField::Body(usize::MAX),
4349 ));
4350 <Vec<CharacterClassContents> as VisitWithAstPath<V>>::visit_with_ast_path(
4351 body,
4352 visitor,
4353 &mut *__ast_path,
4354 )
4355 };
4356 }
4357 }
4358 }
4359}
4360#[cfg(any(docsrs, feature = "path"))]
4361#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4362impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for CharacterClassContents {
4363 #[doc = "Calls [VisitAstPath`::visit_character_class_contents`] with `self`."]
4364 fn visit_with_ast_path<'ast: 'r, 'r>(
4365 &'ast self,
4366 visitor: &mut V,
4367 __ast_path: &mut AstNodePath<'r>,
4368 ) {
4369 <V as VisitAstPath>::visit_character_class_contents(visitor, self, __ast_path)
4370 }
4371
4372 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4373 &'ast self,
4374 visitor: &mut V,
4375 __ast_path: &mut AstNodePath<'r>,
4376 ) {
4377 match self {
4378 CharacterClassContents::CharacterClassRange { 0: _field_0 } => {
4379 let mut __ast_path =
4380 __ast_path.with_guard(AstParentNodeRef::CharacterClassContents(
4381 self,
4382 self::fields::CharacterClassContentsField::CharacterClassRange,
4383 ));
4384 <Box<CharacterClassRange> as VisitWithAstPath<V>>::visit_with_ast_path(
4385 _field_0,
4386 visitor,
4387 &mut *__ast_path,
4388 );
4389 }
4390 CharacterClassContents::CharacterClassEscape { 0: _field_0 } => {
4391 let mut __ast_path =
4392 __ast_path.with_guard(AstParentNodeRef::CharacterClassContents(
4393 self,
4394 self::fields::CharacterClassContentsField::CharacterClassEscape,
4395 ));
4396 <Box<CharacterClassEscape> as VisitWithAstPath<V>>::visit_with_ast_path(
4397 _field_0,
4398 visitor,
4399 &mut *__ast_path,
4400 );
4401 }
4402 CharacterClassContents::UnicodePropertyEscape { 0: _field_0 } => {
4403 let mut __ast_path =
4404 __ast_path.with_guard(AstParentNodeRef::CharacterClassContents(
4405 self,
4406 self::fields::CharacterClassContentsField::UnicodePropertyEscape,
4407 ));
4408 <Box<UnicodePropertyEscape> as VisitWithAstPath<V>>::visit_with_ast_path(
4409 _field_0,
4410 visitor,
4411 &mut *__ast_path,
4412 );
4413 }
4414 CharacterClassContents::Character { 0: _field_0 } => {
4415 let mut __ast_path =
4416 __ast_path.with_guard(AstParentNodeRef::CharacterClassContents(
4417 self,
4418 self::fields::CharacterClassContentsField::Character,
4419 ));
4420 <Box<Character> as VisitWithAstPath<V>>::visit_with_ast_path(
4421 _field_0,
4422 visitor,
4423 &mut *__ast_path,
4424 );
4425 }
4426 CharacterClassContents::NestedCharacterClass { 0: _field_0 } => {
4427 let mut __ast_path =
4428 __ast_path.with_guard(AstParentNodeRef::CharacterClassContents(
4429 self,
4430 self::fields::CharacterClassContentsField::NestedCharacterClass,
4431 ));
4432 <Box<CharacterClass> as VisitWithAstPath<V>>::visit_with_ast_path(
4433 _field_0,
4434 visitor,
4435 &mut *__ast_path,
4436 );
4437 }
4438 CharacterClassContents::ClassStringDisjunction { 0: _field_0 } => {
4439 let mut __ast_path =
4440 __ast_path.with_guard(AstParentNodeRef::CharacterClassContents(
4441 self,
4442 self::fields::CharacterClassContentsField::ClassStringDisjunction,
4443 ));
4444 <Box<ClassStringDisjunction> as VisitWithAstPath<V>>::visit_with_ast_path(
4445 _field_0,
4446 visitor,
4447 &mut *__ast_path,
4448 );
4449 }
4450 }
4451 }
4452}
4453#[cfg(any(docsrs, feature = "path"))]
4454#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4455impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for CharacterClassContentsKind {
4456 #[doc = "Calls [VisitAstPath`::visit_character_class_contents_kind`] with `self`."]
4457 fn visit_with_ast_path<'ast: 'r, 'r>(
4458 &'ast self,
4459 visitor: &mut V,
4460 __ast_path: &mut AstNodePath<'r>,
4461 ) {
4462 <V as VisitAstPath>::visit_character_class_contents_kind(visitor, self, __ast_path)
4463 }
4464
4465 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4466 &'ast self,
4467 visitor: &mut V,
4468 __ast_path: &mut AstNodePath<'r>,
4469 ) {
4470 match self {
4471 CharacterClassContentsKind::Union => {}
4472 CharacterClassContentsKind::Intersection => {}
4473 CharacterClassContentsKind::Subtraction => {}
4474 }
4475 }
4476}
4477#[cfg(any(docsrs, feature = "path"))]
4478#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4479impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for CharacterClassEscape {
4480 #[doc = "Calls [VisitAstPath`::visit_character_class_escape`] with `self`."]
4481 fn visit_with_ast_path<'ast: 'r, 'r>(
4482 &'ast self,
4483 visitor: &mut V,
4484 __ast_path: &mut AstNodePath<'r>,
4485 ) {
4486 <V as VisitAstPath>::visit_character_class_escape(visitor, self, __ast_path)
4487 }
4488
4489 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4490 &'ast self,
4491 visitor: &mut V,
4492 __ast_path: &mut AstNodePath<'r>,
4493 ) {
4494 match self {
4495 CharacterClassEscape { span, kind } => {
4496 {
4497 let mut __ast_path =
4498 __ast_path.with_guard(AstParentNodeRef::CharacterClassEscape(
4499 self,
4500 self::fields::CharacterClassEscapeField::Span,
4501 ));
4502 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
4503 span,
4504 visitor,
4505 &mut *__ast_path,
4506 )
4507 };
4508 {
4509 let mut __ast_path =
4510 __ast_path.with_guard(AstParentNodeRef::CharacterClassEscape(
4511 self,
4512 self::fields::CharacterClassEscapeField::Kind,
4513 ));
4514 <CharacterClassEscapeKind as VisitWithAstPath<V>>::visit_with_ast_path(
4515 kind,
4516 visitor,
4517 &mut *__ast_path,
4518 )
4519 };
4520 }
4521 }
4522 }
4523}
4524#[cfg(any(docsrs, feature = "path"))]
4525#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4526impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for CharacterClassEscapeKind {
4527 #[doc = "Calls [VisitAstPath`::visit_character_class_escape_kind`] with `self`."]
4528 fn visit_with_ast_path<'ast: 'r, 'r>(
4529 &'ast self,
4530 visitor: &mut V,
4531 __ast_path: &mut AstNodePath<'r>,
4532 ) {
4533 <V as VisitAstPath>::visit_character_class_escape_kind(visitor, self, __ast_path)
4534 }
4535
4536 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4537 &'ast self,
4538 visitor: &mut V,
4539 __ast_path: &mut AstNodePath<'r>,
4540 ) {
4541 match self {
4542 CharacterClassEscapeKind::D => {}
4543 CharacterClassEscapeKind::NegativeD => {}
4544 CharacterClassEscapeKind::S => {}
4545 CharacterClassEscapeKind::NegativeS => {}
4546 CharacterClassEscapeKind::W => {}
4547 CharacterClassEscapeKind::NegativeW => {}
4548 }
4549 }
4550}
4551#[cfg(any(docsrs, feature = "path"))]
4552#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4553impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for CharacterClassRange {
4554 #[doc = "Calls [VisitAstPath`::visit_character_class_range`] with `self`."]
4555 fn visit_with_ast_path<'ast: 'r, 'r>(
4556 &'ast self,
4557 visitor: &mut V,
4558 __ast_path: &mut AstNodePath<'r>,
4559 ) {
4560 <V as VisitAstPath>::visit_character_class_range(visitor, self, __ast_path)
4561 }
4562
4563 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4564 &'ast self,
4565 visitor: &mut V,
4566 __ast_path: &mut AstNodePath<'r>,
4567 ) {
4568 match self {
4569 CharacterClassRange { span, min, max } => {
4570 {
4571 let mut __ast_path =
4572 __ast_path.with_guard(AstParentNodeRef::CharacterClassRange(
4573 self,
4574 self::fields::CharacterClassRangeField::Span,
4575 ));
4576 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
4577 span,
4578 visitor,
4579 &mut *__ast_path,
4580 )
4581 };
4582 {
4583 let mut __ast_path =
4584 __ast_path.with_guard(AstParentNodeRef::CharacterClassRange(
4585 self,
4586 self::fields::CharacterClassRangeField::Min,
4587 ));
4588 <Character as VisitWithAstPath<V>>::visit_with_ast_path(
4589 min,
4590 visitor,
4591 &mut *__ast_path,
4592 )
4593 };
4594 {
4595 let mut __ast_path =
4596 __ast_path.with_guard(AstParentNodeRef::CharacterClassRange(
4597 self,
4598 self::fields::CharacterClassRangeField::Max,
4599 ));
4600 <Character as VisitWithAstPath<V>>::visit_with_ast_path(
4601 max,
4602 visitor,
4603 &mut *__ast_path,
4604 )
4605 };
4606 }
4607 }
4608 }
4609}
4610#[cfg(any(docsrs, feature = "path"))]
4611#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4612impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for CharacterKind {
4613 #[doc = "Calls [VisitAstPath`::visit_character_kind`] with `self`."]
4614 fn visit_with_ast_path<'ast: 'r, 'r>(
4615 &'ast self,
4616 visitor: &mut V,
4617 __ast_path: &mut AstNodePath<'r>,
4618 ) {
4619 <V as VisitAstPath>::visit_character_kind(visitor, self, __ast_path)
4620 }
4621
4622 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4623 &'ast self,
4624 visitor: &mut V,
4625 __ast_path: &mut AstNodePath<'r>,
4626 ) {
4627 match self {
4628 CharacterKind::ControlLetter => {}
4629 CharacterKind::HexadecimalEscape => {}
4630 CharacterKind::Identifier => {}
4631 CharacterKind::Null => {}
4632 CharacterKind::Octal1 => {}
4633 CharacterKind::Octal2 => {}
4634 CharacterKind::Octal3 => {}
4635 CharacterKind::SingleEscape => {}
4636 CharacterKind::Symbol => {}
4637 CharacterKind::UnicodeEscape => {}
4638 }
4639 }
4640}
4641#[cfg(any(docsrs, feature = "path"))]
4642#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4643impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for ClassString {
4644 #[doc = "Calls [VisitAstPath`::visit_class_string`] with `self`."]
4645 fn visit_with_ast_path<'ast: 'r, 'r>(
4646 &'ast self,
4647 visitor: &mut V,
4648 __ast_path: &mut AstNodePath<'r>,
4649 ) {
4650 <V as VisitAstPath>::visit_class_string(visitor, self, __ast_path)
4651 }
4652
4653 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4654 &'ast self,
4655 visitor: &mut V,
4656 __ast_path: &mut AstNodePath<'r>,
4657 ) {
4658 match self {
4659 ClassString {
4660 span,
4661 strings,
4662 body,
4663 } => {
4664 {
4665 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::ClassString(
4666 self,
4667 self::fields::ClassStringField::Span,
4668 ));
4669 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
4670 span,
4671 visitor,
4672 &mut *__ast_path,
4673 )
4674 };
4675 {
4676 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::ClassString(
4677 self,
4678 self::fields::ClassStringField::Body(usize::MAX),
4679 ));
4680 <Vec<Character> as VisitWithAstPath<V>>::visit_with_ast_path(
4681 body,
4682 visitor,
4683 &mut *__ast_path,
4684 )
4685 };
4686 }
4687 }
4688 }
4689}
4690#[cfg(any(docsrs, feature = "path"))]
4691#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4692impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for ClassStringDisjunction {
4693 #[doc = "Calls [VisitAstPath`::visit_class_string_disjunction`] with `self`."]
4694 fn visit_with_ast_path<'ast: 'r, 'r>(
4695 &'ast self,
4696 visitor: &mut V,
4697 __ast_path: &mut AstNodePath<'r>,
4698 ) {
4699 <V as VisitAstPath>::visit_class_string_disjunction(visitor, self, __ast_path)
4700 }
4701
4702 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4703 &'ast self,
4704 visitor: &mut V,
4705 __ast_path: &mut AstNodePath<'r>,
4706 ) {
4707 match self {
4708 ClassStringDisjunction {
4709 span,
4710 strings,
4711 body,
4712 } => {
4713 {
4714 let mut __ast_path =
4715 __ast_path.with_guard(AstParentNodeRef::ClassStringDisjunction(
4716 self,
4717 self::fields::ClassStringDisjunctionField::Span,
4718 ));
4719 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
4720 span,
4721 visitor,
4722 &mut *__ast_path,
4723 )
4724 };
4725 {
4726 let mut __ast_path =
4727 __ast_path.with_guard(AstParentNodeRef::ClassStringDisjunction(
4728 self,
4729 self::fields::ClassStringDisjunctionField::Body(usize::MAX),
4730 ));
4731 <Vec<ClassString> as VisitWithAstPath<V>>::visit_with_ast_path(
4732 body,
4733 visitor,
4734 &mut *__ast_path,
4735 )
4736 };
4737 }
4738 }
4739 }
4740}
4741#[cfg(any(docsrs, feature = "path"))]
4742#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4743impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for Disjunction {
4744 #[doc = "Calls [VisitAstPath`::visit_disjunction`] with `self`."]
4745 fn visit_with_ast_path<'ast: 'r, 'r>(
4746 &'ast self,
4747 visitor: &mut V,
4748 __ast_path: &mut AstNodePath<'r>,
4749 ) {
4750 <V as VisitAstPath>::visit_disjunction(visitor, self, __ast_path)
4751 }
4752
4753 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4754 &'ast self,
4755 visitor: &mut V,
4756 __ast_path: &mut AstNodePath<'r>,
4757 ) {
4758 match self {
4759 Disjunction { span, body } => {
4760 {
4761 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Disjunction(
4762 self,
4763 self::fields::DisjunctionField::Span,
4764 ));
4765 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
4766 span,
4767 visitor,
4768 &mut *__ast_path,
4769 )
4770 };
4771 {
4772 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Disjunction(
4773 self,
4774 self::fields::DisjunctionField::Body(usize::MAX),
4775 ));
4776 <Vec<Alternative> as VisitWithAstPath<V>>::visit_with_ast_path(
4777 body,
4778 visitor,
4779 &mut *__ast_path,
4780 )
4781 };
4782 }
4783 }
4784 }
4785}
4786#[cfg(any(docsrs, feature = "path"))]
4787#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4788impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for Dot {
4789 #[doc = "Calls [VisitAstPath`::visit_dot`] with `self`."]
4790 fn visit_with_ast_path<'ast: 'r, 'r>(
4791 &'ast self,
4792 visitor: &mut V,
4793 __ast_path: &mut AstNodePath<'r>,
4794 ) {
4795 <V as VisitAstPath>::visit_dot(visitor, self, __ast_path)
4796 }
4797
4798 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4799 &'ast self,
4800 visitor: &mut V,
4801 __ast_path: &mut AstNodePath<'r>,
4802 ) {
4803 match self {
4804 Dot { span } => {
4805 {
4806 let mut __ast_path = __ast_path
4807 .with_guard(AstParentNodeRef::Dot(self, self::fields::DotField::Span));
4808 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
4809 span,
4810 visitor,
4811 &mut *__ast_path,
4812 )
4813 };
4814 }
4815 }
4816 }
4817}
4818#[cfg(any(docsrs, feature = "path"))]
4819#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4820impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for IgnoreGroup {
4821 #[doc = "Calls [VisitAstPath`::visit_ignore_group`] with `self`."]
4822 fn visit_with_ast_path<'ast: 'r, 'r>(
4823 &'ast self,
4824 visitor: &mut V,
4825 __ast_path: &mut AstNodePath<'r>,
4826 ) {
4827 <V as VisitAstPath>::visit_ignore_group(visitor, self, __ast_path)
4828 }
4829
4830 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4831 &'ast self,
4832 visitor: &mut V,
4833 __ast_path: &mut AstNodePath<'r>,
4834 ) {
4835 match self {
4836 IgnoreGroup {
4837 span,
4838 modifiers,
4839 body,
4840 } => {
4841 {
4842 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::IgnoreGroup(
4843 self,
4844 self::fields::IgnoreGroupField::Span,
4845 ));
4846 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
4847 span,
4848 visitor,
4849 &mut *__ast_path,
4850 )
4851 };
4852 {
4853 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::IgnoreGroup(
4854 self,
4855 self::fields::IgnoreGroupField::Modifiers,
4856 ));
4857 <Option<Modifiers> as VisitWithAstPath<V>>::visit_with_ast_path(
4858 modifiers,
4859 visitor,
4860 &mut *__ast_path,
4861 )
4862 };
4863 {
4864 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::IgnoreGroup(
4865 self,
4866 self::fields::IgnoreGroupField::Body,
4867 ));
4868 <Disjunction as VisitWithAstPath<V>>::visit_with_ast_path(
4869 body,
4870 visitor,
4871 &mut *__ast_path,
4872 )
4873 };
4874 }
4875 }
4876 }
4877}
4878#[cfg(any(docsrs, feature = "path"))]
4879#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4880impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for IndexedReference {
4881 #[doc = "Calls [VisitAstPath`::visit_indexed_reference`] with `self`."]
4882 fn visit_with_ast_path<'ast: 'r, 'r>(
4883 &'ast self,
4884 visitor: &mut V,
4885 __ast_path: &mut AstNodePath<'r>,
4886 ) {
4887 <V as VisitAstPath>::visit_indexed_reference(visitor, self, __ast_path)
4888 }
4889
4890 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4891 &'ast self,
4892 visitor: &mut V,
4893 __ast_path: &mut AstNodePath<'r>,
4894 ) {
4895 match self {
4896 IndexedReference { span, index } => {
4897 {
4898 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::IndexedReference(
4899 self,
4900 self::fields::IndexedReferenceField::Span,
4901 ));
4902 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
4903 span,
4904 visitor,
4905 &mut *__ast_path,
4906 )
4907 };
4908 }
4909 }
4910 }
4911}
4912#[cfg(any(docsrs, feature = "path"))]
4913#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4914impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for LookAroundAssertion {
4915 #[doc = "Calls [VisitAstPath`::visit_look_around_assertion`] with `self`."]
4916 fn visit_with_ast_path<'ast: 'r, 'r>(
4917 &'ast self,
4918 visitor: &mut V,
4919 __ast_path: &mut AstNodePath<'r>,
4920 ) {
4921 <V as VisitAstPath>::visit_look_around_assertion(visitor, self, __ast_path)
4922 }
4923
4924 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4925 &'ast self,
4926 visitor: &mut V,
4927 __ast_path: &mut AstNodePath<'r>,
4928 ) {
4929 match self {
4930 LookAroundAssertion { span, kind, body } => {
4931 {
4932 let mut __ast_path =
4933 __ast_path.with_guard(AstParentNodeRef::LookAroundAssertion(
4934 self,
4935 self::fields::LookAroundAssertionField::Span,
4936 ));
4937 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
4938 span,
4939 visitor,
4940 &mut *__ast_path,
4941 )
4942 };
4943 {
4944 let mut __ast_path =
4945 __ast_path.with_guard(AstParentNodeRef::LookAroundAssertion(
4946 self,
4947 self::fields::LookAroundAssertionField::Kind,
4948 ));
4949 <LookAroundAssertionKind as VisitWithAstPath<V>>::visit_with_ast_path(
4950 kind,
4951 visitor,
4952 &mut *__ast_path,
4953 )
4954 };
4955 {
4956 let mut __ast_path =
4957 __ast_path.with_guard(AstParentNodeRef::LookAroundAssertion(
4958 self,
4959 self::fields::LookAroundAssertionField::Body,
4960 ));
4961 <Disjunction as VisitWithAstPath<V>>::visit_with_ast_path(
4962 body,
4963 visitor,
4964 &mut *__ast_path,
4965 )
4966 };
4967 }
4968 }
4969 }
4970}
4971#[cfg(any(docsrs, feature = "path"))]
4972#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4973impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for LookAroundAssertionKind {
4974 #[doc = "Calls [VisitAstPath`::visit_look_around_assertion_kind`] with `self`."]
4975 fn visit_with_ast_path<'ast: 'r, 'r>(
4976 &'ast self,
4977 visitor: &mut V,
4978 __ast_path: &mut AstNodePath<'r>,
4979 ) {
4980 <V as VisitAstPath>::visit_look_around_assertion_kind(visitor, self, __ast_path)
4981 }
4982
4983 fn visit_children_with_ast_path<'ast: 'r, 'r>(
4984 &'ast self,
4985 visitor: &mut V,
4986 __ast_path: &mut AstNodePath<'r>,
4987 ) {
4988 match self {
4989 LookAroundAssertionKind::Lookahead => {}
4990 LookAroundAssertionKind::NegativeLookahead => {}
4991 LookAroundAssertionKind::Lookbehind => {}
4992 LookAroundAssertionKind::NegativeLookbehind => {}
4993 }
4994 }
4995}
4996#[cfg(any(docsrs, feature = "path"))]
4997#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
4998impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for Modifiers {
4999 #[doc = "Calls [VisitAstPath`::visit_modifiers`] with `self`."]
5000 fn visit_with_ast_path<'ast: 'r, 'r>(
5001 &'ast self,
5002 visitor: &mut V,
5003 __ast_path: &mut AstNodePath<'r>,
5004 ) {
5005 <V as VisitAstPath>::visit_modifiers(visitor, self, __ast_path)
5006 }
5007
5008 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5009 &'ast self,
5010 visitor: &mut V,
5011 __ast_path: &mut AstNodePath<'r>,
5012 ) {
5013 match self {
5014 Modifiers {
5015 span,
5016 enabling,
5017 disabling,
5018 } => {
5019 {
5020 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Modifiers(
5021 self,
5022 self::fields::ModifiersField::Span,
5023 ));
5024 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
5025 span,
5026 visitor,
5027 &mut *__ast_path,
5028 )
5029 };
5030 {
5031 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Modifiers(
5032 self,
5033 self::fields::ModifiersField::Enabling,
5034 ));
5035 <Modifier as VisitWithAstPath<V>>::visit_with_ast_path(
5036 enabling,
5037 visitor,
5038 &mut *__ast_path,
5039 )
5040 };
5041 {
5042 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Modifiers(
5043 self,
5044 self::fields::ModifiersField::Disabling,
5045 ));
5046 <Modifier as VisitWithAstPath<V>>::visit_with_ast_path(
5047 disabling,
5048 visitor,
5049 &mut *__ast_path,
5050 )
5051 };
5052 }
5053 }
5054 }
5055}
5056#[cfg(any(docsrs, feature = "path"))]
5057#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5058impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for NamedReference {
5059 #[doc = "Calls [VisitAstPath`::visit_named_reference`] with `self`."]
5060 fn visit_with_ast_path<'ast: 'r, 'r>(
5061 &'ast self,
5062 visitor: &mut V,
5063 __ast_path: &mut AstNodePath<'r>,
5064 ) {
5065 <V as VisitAstPath>::visit_named_reference(visitor, self, __ast_path)
5066 }
5067
5068 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5069 &'ast self,
5070 visitor: &mut V,
5071 __ast_path: &mut AstNodePath<'r>,
5072 ) {
5073 match self {
5074 NamedReference { span, name } => {
5075 {
5076 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::NamedReference(
5077 self,
5078 self::fields::NamedReferenceField::Span,
5079 ));
5080 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
5081 span,
5082 visitor,
5083 &mut *__ast_path,
5084 )
5085 };
5086 {
5087 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::NamedReference(
5088 self,
5089 self::fields::NamedReferenceField::Name,
5090 ));
5091 <swc_atoms::Atom as VisitWithAstPath<V>>::visit_with_ast_path(
5092 name,
5093 visitor,
5094 &mut *__ast_path,
5095 )
5096 };
5097 }
5098 }
5099 }
5100}
5101#[cfg(any(docsrs, feature = "path"))]
5102#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5103impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for Pattern {
5104 #[doc = "Calls [VisitAstPath`::visit_pattern`] with `self`."]
5105 fn visit_with_ast_path<'ast: 'r, 'r>(
5106 &'ast self,
5107 visitor: &mut V,
5108 __ast_path: &mut AstNodePath<'r>,
5109 ) {
5110 <V as VisitAstPath>::visit_pattern(visitor, self, __ast_path)
5111 }
5112
5113 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5114 &'ast self,
5115 visitor: &mut V,
5116 __ast_path: &mut AstNodePath<'r>,
5117 ) {
5118 match self {
5119 Pattern { span, body } => {
5120 {
5121 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Pattern(
5122 self,
5123 self::fields::PatternField::Span,
5124 ));
5125 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
5126 span,
5127 visitor,
5128 &mut *__ast_path,
5129 )
5130 };
5131 {
5132 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Pattern(
5133 self,
5134 self::fields::PatternField::Body,
5135 ));
5136 <Disjunction as VisitWithAstPath<V>>::visit_with_ast_path(
5137 body,
5138 visitor,
5139 &mut *__ast_path,
5140 )
5141 };
5142 }
5143 }
5144 }
5145}
5146#[cfg(any(docsrs, feature = "path"))]
5147#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5148impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for Quantifier {
5149 #[doc = "Calls [VisitAstPath`::visit_quantifier`] with `self`."]
5150 fn visit_with_ast_path<'ast: 'r, 'r>(
5151 &'ast self,
5152 visitor: &mut V,
5153 __ast_path: &mut AstNodePath<'r>,
5154 ) {
5155 <V as VisitAstPath>::visit_quantifier(visitor, self, __ast_path)
5156 }
5157
5158 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5159 &'ast self,
5160 visitor: &mut V,
5161 __ast_path: &mut AstNodePath<'r>,
5162 ) {
5163 match self {
5164 Quantifier {
5165 span,
5166 min,
5167 max,
5168 greedy,
5169 body,
5170 } => {
5171 {
5172 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Quantifier(
5173 self,
5174 self::fields::QuantifierField::Span,
5175 ));
5176 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
5177 span,
5178 visitor,
5179 &mut *__ast_path,
5180 )
5181 };
5182 {
5183 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Quantifier(
5184 self,
5185 self::fields::QuantifierField::Body,
5186 ));
5187 <Term as VisitWithAstPath<V>>::visit_with_ast_path(
5188 body,
5189 visitor,
5190 &mut *__ast_path,
5191 )
5192 };
5193 }
5194 }
5195 }
5196}
5197#[cfg(any(docsrs, feature = "path"))]
5198#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5199impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for Term {
5200 #[doc = "Calls [VisitAstPath`::visit_term`] with `self`."]
5201 fn visit_with_ast_path<'ast: 'r, 'r>(
5202 &'ast self,
5203 visitor: &mut V,
5204 __ast_path: &mut AstNodePath<'r>,
5205 ) {
5206 <V as VisitAstPath>::visit_term(visitor, self, __ast_path)
5207 }
5208
5209 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5210 &'ast self,
5211 visitor: &mut V,
5212 __ast_path: &mut AstNodePath<'r>,
5213 ) {
5214 match self {
5215 Term::BoundaryAssertion { 0: _field_0 } => {
5216 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term(
5217 self,
5218 self::fields::TermField::BoundaryAssertion,
5219 ));
5220 <Box<BoundaryAssertion> as VisitWithAstPath<V>>::visit_with_ast_path(
5221 _field_0,
5222 visitor,
5223 &mut *__ast_path,
5224 );
5225 }
5226 Term::LookAroundAssertion { 0: _field_0 } => {
5227 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term(
5228 self,
5229 self::fields::TermField::LookAroundAssertion,
5230 ));
5231 <Box<LookAroundAssertion> as VisitWithAstPath<V>>::visit_with_ast_path(
5232 _field_0,
5233 visitor,
5234 &mut *__ast_path,
5235 );
5236 }
5237 Term::Quantifier { 0: _field_0 } => {
5238 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term(
5239 self,
5240 self::fields::TermField::Quantifier,
5241 ));
5242 <Box<Quantifier> as VisitWithAstPath<V>>::visit_with_ast_path(
5243 _field_0,
5244 visitor,
5245 &mut *__ast_path,
5246 );
5247 }
5248 Term::Character { 0: _field_0 } => {
5249 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term(
5250 self,
5251 self::fields::TermField::Character,
5252 ));
5253 <Box<Character> as VisitWithAstPath<V>>::visit_with_ast_path(
5254 _field_0,
5255 visitor,
5256 &mut *__ast_path,
5257 );
5258 }
5259 Term::Dot { 0: _field_0 } => {
5260 let mut __ast_path = __ast_path
5261 .with_guard(AstParentNodeRef::Term(self, self::fields::TermField::Dot));
5262 <Dot as VisitWithAstPath<V>>::visit_with_ast_path(
5263 _field_0,
5264 visitor,
5265 &mut *__ast_path,
5266 );
5267 }
5268 Term::CharacterClassEscape { 0: _field_0 } => {
5269 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term(
5270 self,
5271 self::fields::TermField::CharacterClassEscape,
5272 ));
5273 <Box<CharacterClassEscape> as VisitWithAstPath<V>>::visit_with_ast_path(
5274 _field_0,
5275 visitor,
5276 &mut *__ast_path,
5277 );
5278 }
5279 Term::UnicodePropertyEscape { 0: _field_0 } => {
5280 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term(
5281 self,
5282 self::fields::TermField::UnicodePropertyEscape,
5283 ));
5284 <Box<UnicodePropertyEscape> as VisitWithAstPath<V>>::visit_with_ast_path(
5285 _field_0,
5286 visitor,
5287 &mut *__ast_path,
5288 );
5289 }
5290 Term::CharacterClass { 0: _field_0 } => {
5291 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term(
5292 self,
5293 self::fields::TermField::CharacterClass,
5294 ));
5295 <Box<CharacterClass> as VisitWithAstPath<V>>::visit_with_ast_path(
5296 _field_0,
5297 visitor,
5298 &mut *__ast_path,
5299 );
5300 }
5301 Term::CapturingGroup { 0: _field_0 } => {
5302 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term(
5303 self,
5304 self::fields::TermField::CapturingGroup,
5305 ));
5306 <Box<CapturingGroup> as VisitWithAstPath<V>>::visit_with_ast_path(
5307 _field_0,
5308 visitor,
5309 &mut *__ast_path,
5310 );
5311 }
5312 Term::IgnoreGroup { 0: _field_0 } => {
5313 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term(
5314 self,
5315 self::fields::TermField::IgnoreGroup,
5316 ));
5317 <Box<IgnoreGroup> as VisitWithAstPath<V>>::visit_with_ast_path(
5318 _field_0,
5319 visitor,
5320 &mut *__ast_path,
5321 );
5322 }
5323 Term::IndexedReference { 0: _field_0 } => {
5324 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term(
5325 self,
5326 self::fields::TermField::IndexedReference,
5327 ));
5328 <Box<IndexedReference> as VisitWithAstPath<V>>::visit_with_ast_path(
5329 _field_0,
5330 visitor,
5331 &mut *__ast_path,
5332 );
5333 }
5334 Term::NamedReference { 0: _field_0 } => {
5335 let mut __ast_path = __ast_path.with_guard(AstParentNodeRef::Term(
5336 self,
5337 self::fields::TermField::NamedReference,
5338 ));
5339 <Box<NamedReference> as VisitWithAstPath<V>>::visit_with_ast_path(
5340 _field_0,
5341 visitor,
5342 &mut *__ast_path,
5343 );
5344 }
5345 }
5346 }
5347}
5348#[cfg(any(docsrs, feature = "path"))]
5349#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5350impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for UnicodePropertyEscape {
5351 #[doc = "Calls [VisitAstPath`::visit_unicode_property_escape`] with `self`."]
5352 fn visit_with_ast_path<'ast: 'r, 'r>(
5353 &'ast self,
5354 visitor: &mut V,
5355 __ast_path: &mut AstNodePath<'r>,
5356 ) {
5357 <V as VisitAstPath>::visit_unicode_property_escape(visitor, self, __ast_path)
5358 }
5359
5360 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5361 &'ast self,
5362 visitor: &mut V,
5363 __ast_path: &mut AstNodePath<'r>,
5364 ) {
5365 match self {
5366 UnicodePropertyEscape {
5367 span,
5368 negative,
5369 strings,
5370 name,
5371 value,
5372 } => {
5373 {
5374 let mut __ast_path =
5375 __ast_path.with_guard(AstParentNodeRef::UnicodePropertyEscape(
5376 self,
5377 self::fields::UnicodePropertyEscapeField::Span,
5378 ));
5379 <swc_common::Span as VisitWithAstPath<V>>::visit_with_ast_path(
5380 span,
5381 visitor,
5382 &mut *__ast_path,
5383 )
5384 };
5385 {
5386 let mut __ast_path =
5387 __ast_path.with_guard(AstParentNodeRef::UnicodePropertyEscape(
5388 self,
5389 self::fields::UnicodePropertyEscapeField::Name,
5390 ));
5391 <swc_atoms::Atom as VisitWithAstPath<V>>::visit_with_ast_path(
5392 name,
5393 visitor,
5394 &mut *__ast_path,
5395 )
5396 };
5397 {
5398 let mut __ast_path =
5399 __ast_path.with_guard(AstParentNodeRef::UnicodePropertyEscape(
5400 self,
5401 self::fields::UnicodePropertyEscapeField::Value,
5402 ));
5403 <Option<swc_atoms::Atom> as VisitWithAstPath<V>>::visit_with_ast_path(
5404 value,
5405 visitor,
5406 &mut *__ast_path,
5407 )
5408 };
5409 }
5410 }
5411 }
5412}
5413#[cfg(any(docsrs, feature = "path"))]
5414#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5415impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for [Alternative] {
5416 #[doc = "Calls [VisitAstPath`::visit_alternatives`] with `self`. (Extra impl)"]
5417 #[inline]
5418 fn visit_with_ast_path<'ast: 'r, 'r>(
5419 &'ast self,
5420 visitor: &mut V,
5421 __ast_path: &mut AstNodePath<'r>,
5422 ) {
5423 <V as VisitAstPath>::visit_alternatives(visitor, self, __ast_path)
5424 }
5425
5426 #[inline]
5427 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5428 &'ast self,
5429 visitor: &mut V,
5430 __ast_path: &mut AstNodePath<'r>,
5431 ) {
5432 self.iter().enumerate().for_each(|(__idx, item)| {
5433 let mut __ast_path = __ast_path.with_index_guard(__idx);
5434 <Alternative as VisitWithAstPath<V>>::visit_with_ast_path(
5435 item,
5436 visitor,
5437 &mut *__ast_path,
5438 )
5439 })
5440 }
5441}
5442#[cfg(any(docsrs, feature = "path"))]
5443#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5444impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for swc_atoms::Atom {
5445 #[doc = "Calls [VisitAstPath`::visit_atom`] with `self`. (Extra impl)"]
5446 #[inline]
5447 fn visit_with_ast_path<'ast: 'r, 'r>(
5448 &'ast self,
5449 visitor: &mut V,
5450 __ast_path: &mut AstNodePath<'r>,
5451 ) {
5452 <V as VisitAstPath>::visit_atom(visitor, self, __ast_path)
5453 }
5454
5455 #[inline]
5456 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5457 &'ast self,
5458 visitor: &mut V,
5459 __ast_path: &mut AstNodePath<'r>,
5460 ) {
5461 {}
5462 }
5463}
5464#[cfg(any(docsrs, feature = "path"))]
5465#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5466impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for [CharacterClassContents] {
5467 #[doc = "Calls [VisitAstPath`::visit_character_class_contentss`] with `self`. (Extra impl)"]
5468 #[inline]
5469 fn visit_with_ast_path<'ast: 'r, 'r>(
5470 &'ast self,
5471 visitor: &mut V,
5472 __ast_path: &mut AstNodePath<'r>,
5473 ) {
5474 <V as VisitAstPath>::visit_character_class_contentss(visitor, self, __ast_path)
5475 }
5476
5477 #[inline]
5478 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5479 &'ast self,
5480 visitor: &mut V,
5481 __ast_path: &mut AstNodePath<'r>,
5482 ) {
5483 self.iter().enumerate().for_each(|(__idx, item)| {
5484 let mut __ast_path = __ast_path.with_index_guard(__idx);
5485 <CharacterClassContents as VisitWithAstPath<V>>::visit_with_ast_path(
5486 item,
5487 visitor,
5488 &mut *__ast_path,
5489 )
5490 })
5491 }
5492}
5493#[cfg(any(docsrs, feature = "path"))]
5494#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5495impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for [Character] {
5496 #[doc = "Calls [VisitAstPath`::visit_characters`] with `self`. (Extra impl)"]
5497 #[inline]
5498 fn visit_with_ast_path<'ast: 'r, 'r>(
5499 &'ast self,
5500 visitor: &mut V,
5501 __ast_path: &mut AstNodePath<'r>,
5502 ) {
5503 <V as VisitAstPath>::visit_characters(visitor, self, __ast_path)
5504 }
5505
5506 #[inline]
5507 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5508 &'ast self,
5509 visitor: &mut V,
5510 __ast_path: &mut AstNodePath<'r>,
5511 ) {
5512 self.iter().enumerate().for_each(|(__idx, item)| {
5513 let mut __ast_path = __ast_path.with_index_guard(__idx);
5514 <Character as VisitWithAstPath<V>>::visit_with_ast_path(item, visitor, &mut *__ast_path)
5515 })
5516 }
5517}
5518#[cfg(any(docsrs, feature = "path"))]
5519#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5520impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for [ClassString] {
5521 #[doc = "Calls [VisitAstPath`::visit_class_strings`] with `self`. (Extra impl)"]
5522 #[inline]
5523 fn visit_with_ast_path<'ast: 'r, 'r>(
5524 &'ast self,
5525 visitor: &mut V,
5526 __ast_path: &mut AstNodePath<'r>,
5527 ) {
5528 <V as VisitAstPath>::visit_class_strings(visitor, self, __ast_path)
5529 }
5530
5531 #[inline]
5532 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5533 &'ast self,
5534 visitor: &mut V,
5535 __ast_path: &mut AstNodePath<'r>,
5536 ) {
5537 self.iter().enumerate().for_each(|(__idx, item)| {
5538 let mut __ast_path = __ast_path.with_index_guard(__idx);
5539 <ClassString as VisitWithAstPath<V>>::visit_with_ast_path(
5540 item,
5541 visitor,
5542 &mut *__ast_path,
5543 )
5544 })
5545 }
5546}
5547#[cfg(any(docsrs, feature = "path"))]
5548#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5549impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for Modifier {
5550 #[doc = "Calls [VisitAstPath`::visit_modifier`] with `self`. (Extra impl)"]
5551 #[inline]
5552 fn visit_with_ast_path<'ast: 'r, 'r>(
5553 &'ast self,
5554 visitor: &mut V,
5555 __ast_path: &mut AstNodePath<'r>,
5556 ) {
5557 <V as VisitAstPath>::visit_modifier(visitor, self, __ast_path)
5558 }
5559
5560 #[inline]
5561 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5562 &'ast self,
5563 visitor: &mut V,
5564 __ast_path: &mut AstNodePath<'r>,
5565 ) {
5566 {}
5567 }
5568}
5569#[cfg(any(docsrs, feature = "path"))]
5570#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5571impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for Option<swc_atoms::Atom> {
5572 #[doc = "Calls [VisitAstPath`::visit_opt_atom`] with `self`. (Extra impl)"]
5573 #[inline]
5574 fn visit_with_ast_path<'ast: 'r, 'r>(
5575 &'ast self,
5576 visitor: &mut V,
5577 __ast_path: &mut AstNodePath<'r>,
5578 ) {
5579 <V as VisitAstPath>::visit_opt_atom(visitor, self, __ast_path)
5580 }
5581
5582 #[inline]
5583 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5584 &'ast self,
5585 visitor: &mut V,
5586 __ast_path: &mut AstNodePath<'r>,
5587 ) {
5588 match self {
5589 Some(inner) => <swc_atoms::Atom as VisitWithAstPath<V>>::visit_with_ast_path(
5590 inner, visitor, __ast_path,
5591 ),
5592 None => {}
5593 }
5594 }
5595}
5596#[cfg(any(docsrs, feature = "path"))]
5597#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5598impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for Option<Modifiers> {
5599 #[doc = "Calls [VisitAstPath`::visit_opt_modifiers`] with `self`. (Extra impl)"]
5600 #[inline]
5601 fn visit_with_ast_path<'ast: 'r, 'r>(
5602 &'ast self,
5603 visitor: &mut V,
5604 __ast_path: &mut AstNodePath<'r>,
5605 ) {
5606 <V as VisitAstPath>::visit_opt_modifiers(visitor, self, __ast_path)
5607 }
5608
5609 #[inline]
5610 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5611 &'ast self,
5612 visitor: &mut V,
5613 __ast_path: &mut AstNodePath<'r>,
5614 ) {
5615 match self {
5616 Some(inner) => {
5617 <Modifiers as VisitWithAstPath<V>>::visit_with_ast_path(inner, visitor, __ast_path)
5618 }
5619 None => {}
5620 }
5621 }
5622}
5623#[cfg(any(docsrs, feature = "path"))]
5624#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5625impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for swc_common::Span {
5626 #[doc = "Calls [VisitAstPath`::visit_span`] with `self`. (Extra impl)"]
5627 #[inline]
5628 fn visit_with_ast_path<'ast: 'r, 'r>(
5629 &'ast self,
5630 visitor: &mut V,
5631 __ast_path: &mut AstNodePath<'r>,
5632 ) {
5633 <V as VisitAstPath>::visit_span(visitor, self, __ast_path)
5634 }
5635
5636 #[inline]
5637 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5638 &'ast self,
5639 visitor: &mut V,
5640 __ast_path: &mut AstNodePath<'r>,
5641 ) {
5642 {}
5643 }
5644}
5645#[cfg(any(docsrs, feature = "path"))]
5646#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5647impl<V: ?Sized + VisitAstPath> VisitWithAstPath<V> for [Term] {
5648 #[doc = "Calls [VisitAstPath`::visit_terms`] with `self`. (Extra impl)"]
5649 #[inline]
5650 fn visit_with_ast_path<'ast: 'r, 'r>(
5651 &'ast self,
5652 visitor: &mut V,
5653 __ast_path: &mut AstNodePath<'r>,
5654 ) {
5655 <V as VisitAstPath>::visit_terms(visitor, self, __ast_path)
5656 }
5657
5658 #[inline]
5659 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5660 &'ast self,
5661 visitor: &mut V,
5662 __ast_path: &mut AstNodePath<'r>,
5663 ) {
5664 self.iter().enumerate().for_each(|(__idx, item)| {
5665 let mut __ast_path = __ast_path.with_index_guard(__idx);
5666 <Term as VisitWithAstPath<V>>::visit_with_ast_path(item, visitor, &mut *__ast_path)
5667 })
5668 }
5669}
5670#[cfg(any(docsrs, feature = "path"))]
5671#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5672impl<V, T> VisitWithAstPath<V> for std::boxed::Box<T>
5673where
5674 V: ?Sized + VisitAstPath,
5675 T: VisitWithAstPath<V>,
5676{
5677 #[inline]
5678 fn visit_with_ast_path<'ast: 'r, 'r>(
5679 &'ast self,
5680 visitor: &mut V,
5681 __ast_path: &mut AstNodePath<'r>,
5682 ) {
5683 let v = <T as VisitWithAstPath<V>>::visit_with_ast_path(&**self, visitor, __ast_path);
5684 v
5685 }
5686
5687 #[inline]
5688 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5689 &'ast self,
5690 visitor: &mut V,
5691 __ast_path: &mut AstNodePath<'r>,
5692 ) {
5693 let v =
5694 <T as VisitWithAstPath<V>>::visit_children_with_ast_path(&**self, visitor, __ast_path);
5695 v
5696 }
5697}
5698#[cfg(any(docsrs, feature = "path"))]
5699#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
5700impl<V, T> VisitWithAstPath<V> for std::vec::Vec<T>
5701where
5702 V: ?Sized + VisitAstPath,
5703 [T]: VisitWithAstPath<V>,
5704{
5705 #[inline]
5706 fn visit_with_ast_path<'ast: 'r, 'r>(
5707 &'ast self,
5708 visitor: &mut V,
5709 __ast_path: &mut AstNodePath<'r>,
5710 ) {
5711 let v = <[T] as VisitWithAstPath<V>>::visit_with_ast_path(self, visitor, __ast_path);
5712 v
5713 }
5714
5715 #[inline]
5716 fn visit_children_with_ast_path<'ast: 'r, 'r>(
5717 &'ast self,
5718 visitor: &mut V,
5719 __ast_path: &mut AstNodePath<'r>,
5720 ) {
5721 let v =
5722 <[T] as VisitWithAstPath<V>>::visit_children_with_ast_path(self, visitor, __ast_path);
5723 v
5724 }
5725}
5726#[doc = r" A visitor trait for traversing the AST."]
5727pub trait VisitMut {
5728 #[doc = "Visit a node of type `Alternative`.\n\nBy default, this method calls \
5729 [`Alternative::visit_mut_children_with`]. If you want to recurse, you need to call it \
5730 manually."]
5731 #[inline]
5732 fn visit_mut_alternative(&mut self, node: &mut Alternative) {
5733 <Alternative as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5734 }
5735 #[doc = "Visit a node of type `Vec < Alternative >`.\n\nBy default, this method calls [`Vec < \
5736 Alternative >::visit_mut_children_with`]. If you want to recurse, you need to call it \
5737 manually."]
5738 #[inline]
5739 fn visit_mut_alternatives(&mut self, node: &mut Vec<Alternative>) {
5740 <Vec<Alternative> as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5741 }
5742 #[doc = "Visit a node of type `swc_atoms :: Atom`.\n\nBy default, this method calls \
5743 [`swc_atoms :: Atom::visit_mut_children_with`]. If you want to recurse, you need to \
5744 call it manually."]
5745 #[inline]
5746 fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom) {
5747 <swc_atoms::Atom as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5748 }
5749 #[doc = "Visit a node of type `BoundaryAssertion`.\n\nBy default, this method calls \
5750 [`BoundaryAssertion::visit_mut_children_with`]. If you want to recurse, you need to \
5751 call it manually."]
5752 #[inline]
5753 fn visit_mut_boundary_assertion(&mut self, node: &mut BoundaryAssertion) {
5754 <BoundaryAssertion as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5755 }
5756 #[doc = "Visit a node of type `BoundaryAssertionKind`.\n\nBy default, this method calls \
5757 [`BoundaryAssertionKind::visit_mut_children_with`]. If you want to recurse, you need \
5758 to call it manually."]
5759 #[inline]
5760 fn visit_mut_boundary_assertion_kind(&mut self, node: &mut BoundaryAssertionKind) {
5761 <BoundaryAssertionKind as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5762 }
5763 #[doc = "Visit a node of type `CapturingGroup`.\n\nBy default, this method calls \
5764 [`CapturingGroup::visit_mut_children_with`]. If you want to recurse, you need to call \
5765 it manually."]
5766 #[inline]
5767 fn visit_mut_capturing_group(&mut self, node: &mut CapturingGroup) {
5768 <CapturingGroup as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5769 }
5770 #[doc = "Visit a node of type `Character`.\n\nBy default, this method calls \
5771 [`Character::visit_mut_children_with`]. If you want to recurse, you need to call it \
5772 manually."]
5773 #[inline]
5774 fn visit_mut_character(&mut self, node: &mut Character) {
5775 <Character as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5776 }
5777 #[doc = "Visit a node of type `CharacterClass`.\n\nBy default, this method calls \
5778 [`CharacterClass::visit_mut_children_with`]. If you want to recurse, you need to call \
5779 it manually."]
5780 #[inline]
5781 fn visit_mut_character_class(&mut self, node: &mut CharacterClass) {
5782 <CharacterClass as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5783 }
5784 #[doc = "Visit a node of type `CharacterClassContents`.\n\nBy default, this method calls \
5785 [`CharacterClassContents::visit_mut_children_with`]. If you want to recurse, you need \
5786 to call it manually."]
5787 #[inline]
5788 fn visit_mut_character_class_contents(&mut self, node: &mut CharacterClassContents) {
5789 <CharacterClassContents as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5790 }
5791 #[doc = "Visit a node of type `CharacterClassContentsKind`.\n\nBy default, this method calls \
5792 [`CharacterClassContentsKind::visit_mut_children_with`]. If you want to recurse, you \
5793 need to call it manually."]
5794 #[inline]
5795 fn visit_mut_character_class_contents_kind(&mut self, node: &mut CharacterClassContentsKind) {
5796 <CharacterClassContentsKind as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5797 }
5798 #[doc = "Visit a node of type `Vec < CharacterClassContents >`.\n\nBy default, this method \
5799 calls [`Vec < CharacterClassContents >::visit_mut_children_with`]. If you want to \
5800 recurse, you need to call it manually."]
5801 #[inline]
5802 fn visit_mut_character_class_contentss(&mut self, node: &mut Vec<CharacterClassContents>) {
5803 <Vec<CharacterClassContents> as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5804 }
5805 #[doc = "Visit a node of type `CharacterClassEscape`.\n\nBy default, this method calls \
5806 [`CharacterClassEscape::visit_mut_children_with`]. If you want to recurse, you need \
5807 to call it manually."]
5808 #[inline]
5809 fn visit_mut_character_class_escape(&mut self, node: &mut CharacterClassEscape) {
5810 <CharacterClassEscape as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5811 }
5812 #[doc = "Visit a node of type `CharacterClassEscapeKind`.\n\nBy default, this method calls \
5813 [`CharacterClassEscapeKind::visit_mut_children_with`]. If you want to recurse, you \
5814 need to call it manually."]
5815 #[inline]
5816 fn visit_mut_character_class_escape_kind(&mut self, node: &mut CharacterClassEscapeKind) {
5817 <CharacterClassEscapeKind as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5818 }
5819 #[doc = "Visit a node of type `CharacterClassRange`.\n\nBy default, this method calls \
5820 [`CharacterClassRange::visit_mut_children_with`]. If you want to recurse, you need to \
5821 call it manually."]
5822 #[inline]
5823 fn visit_mut_character_class_range(&mut self, node: &mut CharacterClassRange) {
5824 <CharacterClassRange as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5825 }
5826 #[doc = "Visit a node of type `CharacterKind`.\n\nBy default, this method calls \
5827 [`CharacterKind::visit_mut_children_with`]. If you want to recurse, you need to call \
5828 it manually."]
5829 #[inline]
5830 fn visit_mut_character_kind(&mut self, node: &mut CharacterKind) {
5831 <CharacterKind as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5832 }
5833 #[doc = "Visit a node of type `Vec < Character >`.\n\nBy default, this method calls [`Vec < \
5834 Character >::visit_mut_children_with`]. If you want to recurse, you need to call it \
5835 manually."]
5836 #[inline]
5837 fn visit_mut_characters(&mut self, node: &mut Vec<Character>) {
5838 <Vec<Character> as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5839 }
5840 #[doc = "Visit a node of type `ClassString`.\n\nBy default, this method calls \
5841 [`ClassString::visit_mut_children_with`]. If you want to recurse, you need to call it \
5842 manually."]
5843 #[inline]
5844 fn visit_mut_class_string(&mut self, node: &mut ClassString) {
5845 <ClassString as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5846 }
5847 #[doc = "Visit a node of type `ClassStringDisjunction`.\n\nBy default, this method calls \
5848 [`ClassStringDisjunction::visit_mut_children_with`]. If you want to recurse, you need \
5849 to call it manually."]
5850 #[inline]
5851 fn visit_mut_class_string_disjunction(&mut self, node: &mut ClassStringDisjunction) {
5852 <ClassStringDisjunction as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5853 }
5854 #[doc = "Visit a node of type `Vec < ClassString >`.\n\nBy default, this method calls [`Vec < \
5855 ClassString >::visit_mut_children_with`]. If you want to recurse, you need to call it \
5856 manually."]
5857 #[inline]
5858 fn visit_mut_class_strings(&mut self, node: &mut Vec<ClassString>) {
5859 <Vec<ClassString> as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5860 }
5861 #[doc = "Visit a node of type `Disjunction`.\n\nBy default, this method calls \
5862 [`Disjunction::visit_mut_children_with`]. If you want to recurse, you need to call it \
5863 manually."]
5864 #[inline]
5865 fn visit_mut_disjunction(&mut self, node: &mut Disjunction) {
5866 <Disjunction as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5867 }
5868 #[doc = "Visit a node of type `Dot`.\n\nBy default, this method calls \
5869 [`Dot::visit_mut_children_with`]. If you want to recurse, you need to call it \
5870 manually."]
5871 #[inline]
5872 fn visit_mut_dot(&mut self, node: &mut Dot) {
5873 <Dot as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5874 }
5875 #[doc = "Visit a node of type `IgnoreGroup`.\n\nBy default, this method calls \
5876 [`IgnoreGroup::visit_mut_children_with`]. If you want to recurse, you need to call it \
5877 manually."]
5878 #[inline]
5879 fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup) {
5880 <IgnoreGroup as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5881 }
5882 #[doc = "Visit a node of type `IndexedReference`.\n\nBy default, this method calls \
5883 [`IndexedReference::visit_mut_children_with`]. If you want to recurse, you need to \
5884 call it manually."]
5885 #[inline]
5886 fn visit_mut_indexed_reference(&mut self, node: &mut IndexedReference) {
5887 <IndexedReference as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5888 }
5889 #[doc = "Visit a node of type `LookAroundAssertion`.\n\nBy default, this method calls \
5890 [`LookAroundAssertion::visit_mut_children_with`]. If you want to recurse, you need to \
5891 call it manually."]
5892 #[inline]
5893 fn visit_mut_look_around_assertion(&mut self, node: &mut LookAroundAssertion) {
5894 <LookAroundAssertion as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5895 }
5896 #[doc = "Visit a node of type `LookAroundAssertionKind`.\n\nBy default, this method calls \
5897 [`LookAroundAssertionKind::visit_mut_children_with`]. If you want to recurse, you \
5898 need to call it manually."]
5899 #[inline]
5900 fn visit_mut_look_around_assertion_kind(&mut self, node: &mut LookAroundAssertionKind) {
5901 <LookAroundAssertionKind as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5902 }
5903 #[doc = "Visit a node of type `Modifier`.\n\nBy default, this method calls \
5904 [`Modifier::visit_mut_children_with`]. If you want to recurse, you need to call it \
5905 manually."]
5906 #[inline]
5907 fn visit_mut_modifier(&mut self, node: &mut Modifier) {
5908 <Modifier as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5909 }
5910 #[doc = "Visit a node of type `Modifiers`.\n\nBy default, this method calls \
5911 [`Modifiers::visit_mut_children_with`]. If you want to recurse, you need to call it \
5912 manually."]
5913 #[inline]
5914 fn visit_mut_modifiers(&mut self, node: &mut Modifiers) {
5915 <Modifiers as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5916 }
5917 #[doc = "Visit a node of type `NamedReference`.\n\nBy default, this method calls \
5918 [`NamedReference::visit_mut_children_with`]. If you want to recurse, you need to call \
5919 it manually."]
5920 #[inline]
5921 fn visit_mut_named_reference(&mut self, node: &mut NamedReference) {
5922 <NamedReference as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5923 }
5924 #[doc = "Visit a node of type `Option < swc_atoms :: Atom >`.\n\nBy default, this method calls \
5925 [`Option < swc_atoms :: Atom >::visit_mut_children_with`]. If you want to recurse, \
5926 you need to call it manually."]
5927 #[inline]
5928 fn visit_mut_opt_atom(&mut self, node: &mut Option<swc_atoms::Atom>) {
5929 <Option<swc_atoms::Atom> as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5930 }
5931 #[doc = "Visit a node of type `Option < Modifiers >`.\n\nBy default, this method calls \
5932 [`Option < Modifiers >::visit_mut_children_with`]. If you want to recurse, you need \
5933 to call it manually."]
5934 #[inline]
5935 fn visit_mut_opt_modifiers(&mut self, node: &mut Option<Modifiers>) {
5936 <Option<Modifiers> as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5937 }
5938 #[doc = "Visit a node of type `Pattern`.\n\nBy default, this method calls \
5939 [`Pattern::visit_mut_children_with`]. If you want to recurse, you need to call it \
5940 manually."]
5941 #[inline]
5942 fn visit_mut_pattern(&mut self, node: &mut Pattern) {
5943 <Pattern as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5944 }
5945 #[doc = "Visit a node of type `Quantifier`.\n\nBy default, this method calls \
5946 [`Quantifier::visit_mut_children_with`]. If you want to recurse, you need to call it \
5947 manually."]
5948 #[inline]
5949 fn visit_mut_quantifier(&mut self, node: &mut Quantifier) {
5950 <Quantifier as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5951 }
5952 #[doc = "Visit a node of type `swc_common :: Span`.\n\nBy default, this method calls \
5953 [`swc_common :: Span::visit_mut_children_with`]. If you want to recurse, you need to \
5954 call it manually."]
5955 #[inline]
5956 fn visit_mut_span(&mut self, node: &mut swc_common::Span) {
5957 <swc_common::Span as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5958 }
5959 #[doc = "Visit a node of type `Term`.\n\nBy default, this method calls \
5960 [`Term::visit_mut_children_with`]. If you want to recurse, you need to call it \
5961 manually."]
5962 #[inline]
5963 fn visit_mut_term(&mut self, node: &mut Term) {
5964 <Term as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5965 }
5966 #[doc = "Visit a node of type `Vec < Term >`.\n\nBy default, this method calls [`Vec < Term \
5967 >::visit_mut_children_with`]. If you want to recurse, you need to call it manually."]
5968 #[inline]
5969 fn visit_mut_terms(&mut self, node: &mut Vec<Term>) {
5970 <Vec<Term> as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5971 }
5972 #[doc = "Visit a node of type `UnicodePropertyEscape`.\n\nBy default, this method calls \
5973 [`UnicodePropertyEscape::visit_mut_children_with`]. If you want to recurse, you need \
5974 to call it manually."]
5975 #[inline]
5976 fn visit_mut_unicode_property_escape(&mut self, node: &mut UnicodePropertyEscape) {
5977 <UnicodePropertyEscape as VisitMutWith<Self>>::visit_mut_children_with(node, self)
5978 }
5979}
5980impl<V> VisitMut for &mut V
5981where
5982 V: ?Sized + VisitMut,
5983{
5984 #[inline]
5985 fn visit_mut_alternative(&mut self, node: &mut Alternative) {
5986 <V as VisitMut>::visit_mut_alternative(&mut **self, node)
5987 }
5988
5989 #[inline]
5990 fn visit_mut_alternatives(&mut self, node: &mut Vec<Alternative>) {
5991 <V as VisitMut>::visit_mut_alternatives(&mut **self, node)
5992 }
5993
5994 #[inline]
5995 fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom) {
5996 <V as VisitMut>::visit_mut_atom(&mut **self, node)
5997 }
5998
5999 #[inline]
6000 fn visit_mut_boundary_assertion(&mut self, node: &mut BoundaryAssertion) {
6001 <V as VisitMut>::visit_mut_boundary_assertion(&mut **self, node)
6002 }
6003
6004 #[inline]
6005 fn visit_mut_boundary_assertion_kind(&mut self, node: &mut BoundaryAssertionKind) {
6006 <V as VisitMut>::visit_mut_boundary_assertion_kind(&mut **self, node)
6007 }
6008
6009 #[inline]
6010 fn visit_mut_capturing_group(&mut self, node: &mut CapturingGroup) {
6011 <V as VisitMut>::visit_mut_capturing_group(&mut **self, node)
6012 }
6013
6014 #[inline]
6015 fn visit_mut_character(&mut self, node: &mut Character) {
6016 <V as VisitMut>::visit_mut_character(&mut **self, node)
6017 }
6018
6019 #[inline]
6020 fn visit_mut_character_class(&mut self, node: &mut CharacterClass) {
6021 <V as VisitMut>::visit_mut_character_class(&mut **self, node)
6022 }
6023
6024 #[inline]
6025 fn visit_mut_character_class_contents(&mut self, node: &mut CharacterClassContents) {
6026 <V as VisitMut>::visit_mut_character_class_contents(&mut **self, node)
6027 }
6028
6029 #[inline]
6030 fn visit_mut_character_class_contents_kind(&mut self, node: &mut CharacterClassContentsKind) {
6031 <V as VisitMut>::visit_mut_character_class_contents_kind(&mut **self, node)
6032 }
6033
6034 #[inline]
6035 fn visit_mut_character_class_contentss(&mut self, node: &mut Vec<CharacterClassContents>) {
6036 <V as VisitMut>::visit_mut_character_class_contentss(&mut **self, node)
6037 }
6038
6039 #[inline]
6040 fn visit_mut_character_class_escape(&mut self, node: &mut CharacterClassEscape) {
6041 <V as VisitMut>::visit_mut_character_class_escape(&mut **self, node)
6042 }
6043
6044 #[inline]
6045 fn visit_mut_character_class_escape_kind(&mut self, node: &mut CharacterClassEscapeKind) {
6046 <V as VisitMut>::visit_mut_character_class_escape_kind(&mut **self, node)
6047 }
6048
6049 #[inline]
6050 fn visit_mut_character_class_range(&mut self, node: &mut CharacterClassRange) {
6051 <V as VisitMut>::visit_mut_character_class_range(&mut **self, node)
6052 }
6053
6054 #[inline]
6055 fn visit_mut_character_kind(&mut self, node: &mut CharacterKind) {
6056 <V as VisitMut>::visit_mut_character_kind(&mut **self, node)
6057 }
6058
6059 #[inline]
6060 fn visit_mut_characters(&mut self, node: &mut Vec<Character>) {
6061 <V as VisitMut>::visit_mut_characters(&mut **self, node)
6062 }
6063
6064 #[inline]
6065 fn visit_mut_class_string(&mut self, node: &mut ClassString) {
6066 <V as VisitMut>::visit_mut_class_string(&mut **self, node)
6067 }
6068
6069 #[inline]
6070 fn visit_mut_class_string_disjunction(&mut self, node: &mut ClassStringDisjunction) {
6071 <V as VisitMut>::visit_mut_class_string_disjunction(&mut **self, node)
6072 }
6073
6074 #[inline]
6075 fn visit_mut_class_strings(&mut self, node: &mut Vec<ClassString>) {
6076 <V as VisitMut>::visit_mut_class_strings(&mut **self, node)
6077 }
6078
6079 #[inline]
6080 fn visit_mut_disjunction(&mut self, node: &mut Disjunction) {
6081 <V as VisitMut>::visit_mut_disjunction(&mut **self, node)
6082 }
6083
6084 #[inline]
6085 fn visit_mut_dot(&mut self, node: &mut Dot) {
6086 <V as VisitMut>::visit_mut_dot(&mut **self, node)
6087 }
6088
6089 #[inline]
6090 fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup) {
6091 <V as VisitMut>::visit_mut_ignore_group(&mut **self, node)
6092 }
6093
6094 #[inline]
6095 fn visit_mut_indexed_reference(&mut self, node: &mut IndexedReference) {
6096 <V as VisitMut>::visit_mut_indexed_reference(&mut **self, node)
6097 }
6098
6099 #[inline]
6100 fn visit_mut_look_around_assertion(&mut self, node: &mut LookAroundAssertion) {
6101 <V as VisitMut>::visit_mut_look_around_assertion(&mut **self, node)
6102 }
6103
6104 #[inline]
6105 fn visit_mut_look_around_assertion_kind(&mut self, node: &mut LookAroundAssertionKind) {
6106 <V as VisitMut>::visit_mut_look_around_assertion_kind(&mut **self, node)
6107 }
6108
6109 #[inline]
6110 fn visit_mut_modifier(&mut self, node: &mut Modifier) {
6111 <V as VisitMut>::visit_mut_modifier(&mut **self, node)
6112 }
6113
6114 #[inline]
6115 fn visit_mut_modifiers(&mut self, node: &mut Modifiers) {
6116 <V as VisitMut>::visit_mut_modifiers(&mut **self, node)
6117 }
6118
6119 #[inline]
6120 fn visit_mut_named_reference(&mut self, node: &mut NamedReference) {
6121 <V as VisitMut>::visit_mut_named_reference(&mut **self, node)
6122 }
6123
6124 #[inline]
6125 fn visit_mut_opt_atom(&mut self, node: &mut Option<swc_atoms::Atom>) {
6126 <V as VisitMut>::visit_mut_opt_atom(&mut **self, node)
6127 }
6128
6129 #[inline]
6130 fn visit_mut_opt_modifiers(&mut self, node: &mut Option<Modifiers>) {
6131 <V as VisitMut>::visit_mut_opt_modifiers(&mut **self, node)
6132 }
6133
6134 #[inline]
6135 fn visit_mut_pattern(&mut self, node: &mut Pattern) {
6136 <V as VisitMut>::visit_mut_pattern(&mut **self, node)
6137 }
6138
6139 #[inline]
6140 fn visit_mut_quantifier(&mut self, node: &mut Quantifier) {
6141 <V as VisitMut>::visit_mut_quantifier(&mut **self, node)
6142 }
6143
6144 #[inline]
6145 fn visit_mut_span(&mut self, node: &mut swc_common::Span) {
6146 <V as VisitMut>::visit_mut_span(&mut **self, node)
6147 }
6148
6149 #[inline]
6150 fn visit_mut_term(&mut self, node: &mut Term) {
6151 <V as VisitMut>::visit_mut_term(&mut **self, node)
6152 }
6153
6154 #[inline]
6155 fn visit_mut_terms(&mut self, node: &mut Vec<Term>) {
6156 <V as VisitMut>::visit_mut_terms(&mut **self, node)
6157 }
6158
6159 #[inline]
6160 fn visit_mut_unicode_property_escape(&mut self, node: &mut UnicodePropertyEscape) {
6161 <V as VisitMut>::visit_mut_unicode_property_escape(&mut **self, node)
6162 }
6163}
6164impl<V> VisitMut for Box<V>
6165where
6166 V: ?Sized + VisitMut,
6167{
6168 #[inline]
6169 fn visit_mut_alternative(&mut self, node: &mut Alternative) {
6170 <V as VisitMut>::visit_mut_alternative(&mut **self, node)
6171 }
6172
6173 #[inline]
6174 fn visit_mut_alternatives(&mut self, node: &mut Vec<Alternative>) {
6175 <V as VisitMut>::visit_mut_alternatives(&mut **self, node)
6176 }
6177
6178 #[inline]
6179 fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom) {
6180 <V as VisitMut>::visit_mut_atom(&mut **self, node)
6181 }
6182
6183 #[inline]
6184 fn visit_mut_boundary_assertion(&mut self, node: &mut BoundaryAssertion) {
6185 <V as VisitMut>::visit_mut_boundary_assertion(&mut **self, node)
6186 }
6187
6188 #[inline]
6189 fn visit_mut_boundary_assertion_kind(&mut self, node: &mut BoundaryAssertionKind) {
6190 <V as VisitMut>::visit_mut_boundary_assertion_kind(&mut **self, node)
6191 }
6192
6193 #[inline]
6194 fn visit_mut_capturing_group(&mut self, node: &mut CapturingGroup) {
6195 <V as VisitMut>::visit_mut_capturing_group(&mut **self, node)
6196 }
6197
6198 #[inline]
6199 fn visit_mut_character(&mut self, node: &mut Character) {
6200 <V as VisitMut>::visit_mut_character(&mut **self, node)
6201 }
6202
6203 #[inline]
6204 fn visit_mut_character_class(&mut self, node: &mut CharacterClass) {
6205 <V as VisitMut>::visit_mut_character_class(&mut **self, node)
6206 }
6207
6208 #[inline]
6209 fn visit_mut_character_class_contents(&mut self, node: &mut CharacterClassContents) {
6210 <V as VisitMut>::visit_mut_character_class_contents(&mut **self, node)
6211 }
6212
6213 #[inline]
6214 fn visit_mut_character_class_contents_kind(&mut self, node: &mut CharacterClassContentsKind) {
6215 <V as VisitMut>::visit_mut_character_class_contents_kind(&mut **self, node)
6216 }
6217
6218 #[inline]
6219 fn visit_mut_character_class_contentss(&mut self, node: &mut Vec<CharacterClassContents>) {
6220 <V as VisitMut>::visit_mut_character_class_contentss(&mut **self, node)
6221 }
6222
6223 #[inline]
6224 fn visit_mut_character_class_escape(&mut self, node: &mut CharacterClassEscape) {
6225 <V as VisitMut>::visit_mut_character_class_escape(&mut **self, node)
6226 }
6227
6228 #[inline]
6229 fn visit_mut_character_class_escape_kind(&mut self, node: &mut CharacterClassEscapeKind) {
6230 <V as VisitMut>::visit_mut_character_class_escape_kind(&mut **self, node)
6231 }
6232
6233 #[inline]
6234 fn visit_mut_character_class_range(&mut self, node: &mut CharacterClassRange) {
6235 <V as VisitMut>::visit_mut_character_class_range(&mut **self, node)
6236 }
6237
6238 #[inline]
6239 fn visit_mut_character_kind(&mut self, node: &mut CharacterKind) {
6240 <V as VisitMut>::visit_mut_character_kind(&mut **self, node)
6241 }
6242
6243 #[inline]
6244 fn visit_mut_characters(&mut self, node: &mut Vec<Character>) {
6245 <V as VisitMut>::visit_mut_characters(&mut **self, node)
6246 }
6247
6248 #[inline]
6249 fn visit_mut_class_string(&mut self, node: &mut ClassString) {
6250 <V as VisitMut>::visit_mut_class_string(&mut **self, node)
6251 }
6252
6253 #[inline]
6254 fn visit_mut_class_string_disjunction(&mut self, node: &mut ClassStringDisjunction) {
6255 <V as VisitMut>::visit_mut_class_string_disjunction(&mut **self, node)
6256 }
6257
6258 #[inline]
6259 fn visit_mut_class_strings(&mut self, node: &mut Vec<ClassString>) {
6260 <V as VisitMut>::visit_mut_class_strings(&mut **self, node)
6261 }
6262
6263 #[inline]
6264 fn visit_mut_disjunction(&mut self, node: &mut Disjunction) {
6265 <V as VisitMut>::visit_mut_disjunction(&mut **self, node)
6266 }
6267
6268 #[inline]
6269 fn visit_mut_dot(&mut self, node: &mut Dot) {
6270 <V as VisitMut>::visit_mut_dot(&mut **self, node)
6271 }
6272
6273 #[inline]
6274 fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup) {
6275 <V as VisitMut>::visit_mut_ignore_group(&mut **self, node)
6276 }
6277
6278 #[inline]
6279 fn visit_mut_indexed_reference(&mut self, node: &mut IndexedReference) {
6280 <V as VisitMut>::visit_mut_indexed_reference(&mut **self, node)
6281 }
6282
6283 #[inline]
6284 fn visit_mut_look_around_assertion(&mut self, node: &mut LookAroundAssertion) {
6285 <V as VisitMut>::visit_mut_look_around_assertion(&mut **self, node)
6286 }
6287
6288 #[inline]
6289 fn visit_mut_look_around_assertion_kind(&mut self, node: &mut LookAroundAssertionKind) {
6290 <V as VisitMut>::visit_mut_look_around_assertion_kind(&mut **self, node)
6291 }
6292
6293 #[inline]
6294 fn visit_mut_modifier(&mut self, node: &mut Modifier) {
6295 <V as VisitMut>::visit_mut_modifier(&mut **self, node)
6296 }
6297
6298 #[inline]
6299 fn visit_mut_modifiers(&mut self, node: &mut Modifiers) {
6300 <V as VisitMut>::visit_mut_modifiers(&mut **self, node)
6301 }
6302
6303 #[inline]
6304 fn visit_mut_named_reference(&mut self, node: &mut NamedReference) {
6305 <V as VisitMut>::visit_mut_named_reference(&mut **self, node)
6306 }
6307
6308 #[inline]
6309 fn visit_mut_opt_atom(&mut self, node: &mut Option<swc_atoms::Atom>) {
6310 <V as VisitMut>::visit_mut_opt_atom(&mut **self, node)
6311 }
6312
6313 #[inline]
6314 fn visit_mut_opt_modifiers(&mut self, node: &mut Option<Modifiers>) {
6315 <V as VisitMut>::visit_mut_opt_modifiers(&mut **self, node)
6316 }
6317
6318 #[inline]
6319 fn visit_mut_pattern(&mut self, node: &mut Pattern) {
6320 <V as VisitMut>::visit_mut_pattern(&mut **self, node)
6321 }
6322
6323 #[inline]
6324 fn visit_mut_quantifier(&mut self, node: &mut Quantifier) {
6325 <V as VisitMut>::visit_mut_quantifier(&mut **self, node)
6326 }
6327
6328 #[inline]
6329 fn visit_mut_span(&mut self, node: &mut swc_common::Span) {
6330 <V as VisitMut>::visit_mut_span(&mut **self, node)
6331 }
6332
6333 #[inline]
6334 fn visit_mut_term(&mut self, node: &mut Term) {
6335 <V as VisitMut>::visit_mut_term(&mut **self, node)
6336 }
6337
6338 #[inline]
6339 fn visit_mut_terms(&mut self, node: &mut Vec<Term>) {
6340 <V as VisitMut>::visit_mut_terms(&mut **self, node)
6341 }
6342
6343 #[inline]
6344 fn visit_mut_unicode_property_escape(&mut self, node: &mut UnicodePropertyEscape) {
6345 <V as VisitMut>::visit_mut_unicode_property_escape(&mut **self, node)
6346 }
6347}
6348impl<A, B> VisitMut for ::swc_visit::Either<A, B>
6349where
6350 A: VisitMut,
6351 B: VisitMut,
6352{
6353 #[inline]
6354 fn visit_mut_alternative(&mut self, node: &mut Alternative) {
6355 match self {
6356 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_alternative(visitor, node),
6357 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_alternative(visitor, node),
6358 }
6359 }
6360
6361 #[inline]
6362 fn visit_mut_alternatives(&mut self, node: &mut Vec<Alternative>) {
6363 match self {
6364 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_alternatives(visitor, node),
6365 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_alternatives(visitor, node),
6366 }
6367 }
6368
6369 #[inline]
6370 fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom) {
6371 match self {
6372 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_atom(visitor, node),
6373 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_atom(visitor, node),
6374 }
6375 }
6376
6377 #[inline]
6378 fn visit_mut_boundary_assertion(&mut self, node: &mut BoundaryAssertion) {
6379 match self {
6380 swc_visit::Either::Left(visitor) => {
6381 VisitMut::visit_mut_boundary_assertion(visitor, node)
6382 }
6383 swc_visit::Either::Right(visitor) => {
6384 VisitMut::visit_mut_boundary_assertion(visitor, node)
6385 }
6386 }
6387 }
6388
6389 #[inline]
6390 fn visit_mut_boundary_assertion_kind(&mut self, node: &mut BoundaryAssertionKind) {
6391 match self {
6392 swc_visit::Either::Left(visitor) => {
6393 VisitMut::visit_mut_boundary_assertion_kind(visitor, node)
6394 }
6395 swc_visit::Either::Right(visitor) => {
6396 VisitMut::visit_mut_boundary_assertion_kind(visitor, node)
6397 }
6398 }
6399 }
6400
6401 #[inline]
6402 fn visit_mut_capturing_group(&mut self, node: &mut CapturingGroup) {
6403 match self {
6404 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_capturing_group(visitor, node),
6405 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_capturing_group(visitor, node),
6406 }
6407 }
6408
6409 #[inline]
6410 fn visit_mut_character(&mut self, node: &mut Character) {
6411 match self {
6412 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_character(visitor, node),
6413 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_character(visitor, node),
6414 }
6415 }
6416
6417 #[inline]
6418 fn visit_mut_character_class(&mut self, node: &mut CharacterClass) {
6419 match self {
6420 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_character_class(visitor, node),
6421 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_character_class(visitor, node),
6422 }
6423 }
6424
6425 #[inline]
6426 fn visit_mut_character_class_contents(&mut self, node: &mut CharacterClassContents) {
6427 match self {
6428 swc_visit::Either::Left(visitor) => {
6429 VisitMut::visit_mut_character_class_contents(visitor, node)
6430 }
6431 swc_visit::Either::Right(visitor) => {
6432 VisitMut::visit_mut_character_class_contents(visitor, node)
6433 }
6434 }
6435 }
6436
6437 #[inline]
6438 fn visit_mut_character_class_contents_kind(&mut self, node: &mut CharacterClassContentsKind) {
6439 match self {
6440 swc_visit::Either::Left(visitor) => {
6441 VisitMut::visit_mut_character_class_contents_kind(visitor, node)
6442 }
6443 swc_visit::Either::Right(visitor) => {
6444 VisitMut::visit_mut_character_class_contents_kind(visitor, node)
6445 }
6446 }
6447 }
6448
6449 #[inline]
6450 fn visit_mut_character_class_contentss(&mut self, node: &mut Vec<CharacterClassContents>) {
6451 match self {
6452 swc_visit::Either::Left(visitor) => {
6453 VisitMut::visit_mut_character_class_contentss(visitor, node)
6454 }
6455 swc_visit::Either::Right(visitor) => {
6456 VisitMut::visit_mut_character_class_contentss(visitor, node)
6457 }
6458 }
6459 }
6460
6461 #[inline]
6462 fn visit_mut_character_class_escape(&mut self, node: &mut CharacterClassEscape) {
6463 match self {
6464 swc_visit::Either::Left(visitor) => {
6465 VisitMut::visit_mut_character_class_escape(visitor, node)
6466 }
6467 swc_visit::Either::Right(visitor) => {
6468 VisitMut::visit_mut_character_class_escape(visitor, node)
6469 }
6470 }
6471 }
6472
6473 #[inline]
6474 fn visit_mut_character_class_escape_kind(&mut self, node: &mut CharacterClassEscapeKind) {
6475 match self {
6476 swc_visit::Either::Left(visitor) => {
6477 VisitMut::visit_mut_character_class_escape_kind(visitor, node)
6478 }
6479 swc_visit::Either::Right(visitor) => {
6480 VisitMut::visit_mut_character_class_escape_kind(visitor, node)
6481 }
6482 }
6483 }
6484
6485 #[inline]
6486 fn visit_mut_character_class_range(&mut self, node: &mut CharacterClassRange) {
6487 match self {
6488 swc_visit::Either::Left(visitor) => {
6489 VisitMut::visit_mut_character_class_range(visitor, node)
6490 }
6491 swc_visit::Either::Right(visitor) => {
6492 VisitMut::visit_mut_character_class_range(visitor, node)
6493 }
6494 }
6495 }
6496
6497 #[inline]
6498 fn visit_mut_character_kind(&mut self, node: &mut CharacterKind) {
6499 match self {
6500 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_character_kind(visitor, node),
6501 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_character_kind(visitor, node),
6502 }
6503 }
6504
6505 #[inline]
6506 fn visit_mut_characters(&mut self, node: &mut Vec<Character>) {
6507 match self {
6508 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_characters(visitor, node),
6509 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_characters(visitor, node),
6510 }
6511 }
6512
6513 #[inline]
6514 fn visit_mut_class_string(&mut self, node: &mut ClassString) {
6515 match self {
6516 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_class_string(visitor, node),
6517 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_class_string(visitor, node),
6518 }
6519 }
6520
6521 #[inline]
6522 fn visit_mut_class_string_disjunction(&mut self, node: &mut ClassStringDisjunction) {
6523 match self {
6524 swc_visit::Either::Left(visitor) => {
6525 VisitMut::visit_mut_class_string_disjunction(visitor, node)
6526 }
6527 swc_visit::Either::Right(visitor) => {
6528 VisitMut::visit_mut_class_string_disjunction(visitor, node)
6529 }
6530 }
6531 }
6532
6533 #[inline]
6534 fn visit_mut_class_strings(&mut self, node: &mut Vec<ClassString>) {
6535 match self {
6536 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_class_strings(visitor, node),
6537 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_class_strings(visitor, node),
6538 }
6539 }
6540
6541 #[inline]
6542 fn visit_mut_disjunction(&mut self, node: &mut Disjunction) {
6543 match self {
6544 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_disjunction(visitor, node),
6545 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_disjunction(visitor, node),
6546 }
6547 }
6548
6549 #[inline]
6550 fn visit_mut_dot(&mut self, node: &mut Dot) {
6551 match self {
6552 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_dot(visitor, node),
6553 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_dot(visitor, node),
6554 }
6555 }
6556
6557 #[inline]
6558 fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup) {
6559 match self {
6560 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_ignore_group(visitor, node),
6561 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_ignore_group(visitor, node),
6562 }
6563 }
6564
6565 #[inline]
6566 fn visit_mut_indexed_reference(&mut self, node: &mut IndexedReference) {
6567 match self {
6568 swc_visit::Either::Left(visitor) => {
6569 VisitMut::visit_mut_indexed_reference(visitor, node)
6570 }
6571 swc_visit::Either::Right(visitor) => {
6572 VisitMut::visit_mut_indexed_reference(visitor, node)
6573 }
6574 }
6575 }
6576
6577 #[inline]
6578 fn visit_mut_look_around_assertion(&mut self, node: &mut LookAroundAssertion) {
6579 match self {
6580 swc_visit::Either::Left(visitor) => {
6581 VisitMut::visit_mut_look_around_assertion(visitor, node)
6582 }
6583 swc_visit::Either::Right(visitor) => {
6584 VisitMut::visit_mut_look_around_assertion(visitor, node)
6585 }
6586 }
6587 }
6588
6589 #[inline]
6590 fn visit_mut_look_around_assertion_kind(&mut self, node: &mut LookAroundAssertionKind) {
6591 match self {
6592 swc_visit::Either::Left(visitor) => {
6593 VisitMut::visit_mut_look_around_assertion_kind(visitor, node)
6594 }
6595 swc_visit::Either::Right(visitor) => {
6596 VisitMut::visit_mut_look_around_assertion_kind(visitor, node)
6597 }
6598 }
6599 }
6600
6601 #[inline]
6602 fn visit_mut_modifier(&mut self, node: &mut Modifier) {
6603 match self {
6604 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_modifier(visitor, node),
6605 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_modifier(visitor, node),
6606 }
6607 }
6608
6609 #[inline]
6610 fn visit_mut_modifiers(&mut self, node: &mut Modifiers) {
6611 match self {
6612 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_modifiers(visitor, node),
6613 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_modifiers(visitor, node),
6614 }
6615 }
6616
6617 #[inline]
6618 fn visit_mut_named_reference(&mut self, node: &mut NamedReference) {
6619 match self {
6620 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_named_reference(visitor, node),
6621 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_named_reference(visitor, node),
6622 }
6623 }
6624
6625 #[inline]
6626 fn visit_mut_opt_atom(&mut self, node: &mut Option<swc_atoms::Atom>) {
6627 match self {
6628 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_opt_atom(visitor, node),
6629 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_opt_atom(visitor, node),
6630 }
6631 }
6632
6633 #[inline]
6634 fn visit_mut_opt_modifiers(&mut self, node: &mut Option<Modifiers>) {
6635 match self {
6636 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_opt_modifiers(visitor, node),
6637 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_opt_modifiers(visitor, node),
6638 }
6639 }
6640
6641 #[inline]
6642 fn visit_mut_pattern(&mut self, node: &mut Pattern) {
6643 match self {
6644 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_pattern(visitor, node),
6645 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_pattern(visitor, node),
6646 }
6647 }
6648
6649 #[inline]
6650 fn visit_mut_quantifier(&mut self, node: &mut Quantifier) {
6651 match self {
6652 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_quantifier(visitor, node),
6653 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_quantifier(visitor, node),
6654 }
6655 }
6656
6657 #[inline]
6658 fn visit_mut_span(&mut self, node: &mut swc_common::Span) {
6659 match self {
6660 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_span(visitor, node),
6661 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_span(visitor, node),
6662 }
6663 }
6664
6665 #[inline]
6666 fn visit_mut_term(&mut self, node: &mut Term) {
6667 match self {
6668 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_term(visitor, node),
6669 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_term(visitor, node),
6670 }
6671 }
6672
6673 #[inline]
6674 fn visit_mut_terms(&mut self, node: &mut Vec<Term>) {
6675 match self {
6676 swc_visit::Either::Left(visitor) => VisitMut::visit_mut_terms(visitor, node),
6677 swc_visit::Either::Right(visitor) => VisitMut::visit_mut_terms(visitor, node),
6678 }
6679 }
6680
6681 #[inline]
6682 fn visit_mut_unicode_property_escape(&mut self, node: &mut UnicodePropertyEscape) {
6683 match self {
6684 swc_visit::Either::Left(visitor) => {
6685 VisitMut::visit_mut_unicode_property_escape(visitor, node)
6686 }
6687 swc_visit::Either::Right(visitor) => {
6688 VisitMut::visit_mut_unicode_property_escape(visitor, node)
6689 }
6690 }
6691 }
6692}
6693impl<V> VisitMut for ::swc_visit::Optional<V>
6694where
6695 V: VisitMut,
6696{
6697 #[inline]
6698 fn visit_mut_alternative(&mut self, node: &mut Alternative) {
6699 if self.enabled {
6700 <V as VisitMut>::visit_mut_alternative(&mut self.visitor, node)
6701 } else {
6702 }
6703 }
6704
6705 #[inline]
6706 fn visit_mut_alternatives(&mut self, node: &mut Vec<Alternative>) {
6707 if self.enabled {
6708 <V as VisitMut>::visit_mut_alternatives(&mut self.visitor, node)
6709 } else {
6710 }
6711 }
6712
6713 #[inline]
6714 fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom) {
6715 if self.enabled {
6716 <V as VisitMut>::visit_mut_atom(&mut self.visitor, node)
6717 } else {
6718 }
6719 }
6720
6721 #[inline]
6722 fn visit_mut_boundary_assertion(&mut self, node: &mut BoundaryAssertion) {
6723 if self.enabled {
6724 <V as VisitMut>::visit_mut_boundary_assertion(&mut self.visitor, node)
6725 } else {
6726 }
6727 }
6728
6729 #[inline]
6730 fn visit_mut_boundary_assertion_kind(&mut self, node: &mut BoundaryAssertionKind) {
6731 if self.enabled {
6732 <V as VisitMut>::visit_mut_boundary_assertion_kind(&mut self.visitor, node)
6733 } else {
6734 }
6735 }
6736
6737 #[inline]
6738 fn visit_mut_capturing_group(&mut self, node: &mut CapturingGroup) {
6739 if self.enabled {
6740 <V as VisitMut>::visit_mut_capturing_group(&mut self.visitor, node)
6741 } else {
6742 }
6743 }
6744
6745 #[inline]
6746 fn visit_mut_character(&mut self, node: &mut Character) {
6747 if self.enabled {
6748 <V as VisitMut>::visit_mut_character(&mut self.visitor, node)
6749 } else {
6750 }
6751 }
6752
6753 #[inline]
6754 fn visit_mut_character_class(&mut self, node: &mut CharacterClass) {
6755 if self.enabled {
6756 <V as VisitMut>::visit_mut_character_class(&mut self.visitor, node)
6757 } else {
6758 }
6759 }
6760
6761 #[inline]
6762 fn visit_mut_character_class_contents(&mut self, node: &mut CharacterClassContents) {
6763 if self.enabled {
6764 <V as VisitMut>::visit_mut_character_class_contents(&mut self.visitor, node)
6765 } else {
6766 }
6767 }
6768
6769 #[inline]
6770 fn visit_mut_character_class_contents_kind(&mut self, node: &mut CharacterClassContentsKind) {
6771 if self.enabled {
6772 <V as VisitMut>::visit_mut_character_class_contents_kind(&mut self.visitor, node)
6773 } else {
6774 }
6775 }
6776
6777 #[inline]
6778 fn visit_mut_character_class_contentss(&mut self, node: &mut Vec<CharacterClassContents>) {
6779 if self.enabled {
6780 <V as VisitMut>::visit_mut_character_class_contentss(&mut self.visitor, node)
6781 } else {
6782 }
6783 }
6784
6785 #[inline]
6786 fn visit_mut_character_class_escape(&mut self, node: &mut CharacterClassEscape) {
6787 if self.enabled {
6788 <V as VisitMut>::visit_mut_character_class_escape(&mut self.visitor, node)
6789 } else {
6790 }
6791 }
6792
6793 #[inline]
6794 fn visit_mut_character_class_escape_kind(&mut self, node: &mut CharacterClassEscapeKind) {
6795 if self.enabled {
6796 <V as VisitMut>::visit_mut_character_class_escape_kind(&mut self.visitor, node)
6797 } else {
6798 }
6799 }
6800
6801 #[inline]
6802 fn visit_mut_character_class_range(&mut self, node: &mut CharacterClassRange) {
6803 if self.enabled {
6804 <V as VisitMut>::visit_mut_character_class_range(&mut self.visitor, node)
6805 } else {
6806 }
6807 }
6808
6809 #[inline]
6810 fn visit_mut_character_kind(&mut self, node: &mut CharacterKind) {
6811 if self.enabled {
6812 <V as VisitMut>::visit_mut_character_kind(&mut self.visitor, node)
6813 } else {
6814 }
6815 }
6816
6817 #[inline]
6818 fn visit_mut_characters(&mut self, node: &mut Vec<Character>) {
6819 if self.enabled {
6820 <V as VisitMut>::visit_mut_characters(&mut self.visitor, node)
6821 } else {
6822 }
6823 }
6824
6825 #[inline]
6826 fn visit_mut_class_string(&mut self, node: &mut ClassString) {
6827 if self.enabled {
6828 <V as VisitMut>::visit_mut_class_string(&mut self.visitor, node)
6829 } else {
6830 }
6831 }
6832
6833 #[inline]
6834 fn visit_mut_class_string_disjunction(&mut self, node: &mut ClassStringDisjunction) {
6835 if self.enabled {
6836 <V as VisitMut>::visit_mut_class_string_disjunction(&mut self.visitor, node)
6837 } else {
6838 }
6839 }
6840
6841 #[inline]
6842 fn visit_mut_class_strings(&mut self, node: &mut Vec<ClassString>) {
6843 if self.enabled {
6844 <V as VisitMut>::visit_mut_class_strings(&mut self.visitor, node)
6845 } else {
6846 }
6847 }
6848
6849 #[inline]
6850 fn visit_mut_disjunction(&mut self, node: &mut Disjunction) {
6851 if self.enabled {
6852 <V as VisitMut>::visit_mut_disjunction(&mut self.visitor, node)
6853 } else {
6854 }
6855 }
6856
6857 #[inline]
6858 fn visit_mut_dot(&mut self, node: &mut Dot) {
6859 if self.enabled {
6860 <V as VisitMut>::visit_mut_dot(&mut self.visitor, node)
6861 } else {
6862 }
6863 }
6864
6865 #[inline]
6866 fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup) {
6867 if self.enabled {
6868 <V as VisitMut>::visit_mut_ignore_group(&mut self.visitor, node)
6869 } else {
6870 }
6871 }
6872
6873 #[inline]
6874 fn visit_mut_indexed_reference(&mut self, node: &mut IndexedReference) {
6875 if self.enabled {
6876 <V as VisitMut>::visit_mut_indexed_reference(&mut self.visitor, node)
6877 } else {
6878 }
6879 }
6880
6881 #[inline]
6882 fn visit_mut_look_around_assertion(&mut self, node: &mut LookAroundAssertion) {
6883 if self.enabled {
6884 <V as VisitMut>::visit_mut_look_around_assertion(&mut self.visitor, node)
6885 } else {
6886 }
6887 }
6888
6889 #[inline]
6890 fn visit_mut_look_around_assertion_kind(&mut self, node: &mut LookAroundAssertionKind) {
6891 if self.enabled {
6892 <V as VisitMut>::visit_mut_look_around_assertion_kind(&mut self.visitor, node)
6893 } else {
6894 }
6895 }
6896
6897 #[inline]
6898 fn visit_mut_modifier(&mut self, node: &mut Modifier) {
6899 if self.enabled {
6900 <V as VisitMut>::visit_mut_modifier(&mut self.visitor, node)
6901 } else {
6902 }
6903 }
6904
6905 #[inline]
6906 fn visit_mut_modifiers(&mut self, node: &mut Modifiers) {
6907 if self.enabled {
6908 <V as VisitMut>::visit_mut_modifiers(&mut self.visitor, node)
6909 } else {
6910 }
6911 }
6912
6913 #[inline]
6914 fn visit_mut_named_reference(&mut self, node: &mut NamedReference) {
6915 if self.enabled {
6916 <V as VisitMut>::visit_mut_named_reference(&mut self.visitor, node)
6917 } else {
6918 }
6919 }
6920
6921 #[inline]
6922 fn visit_mut_opt_atom(&mut self, node: &mut Option<swc_atoms::Atom>) {
6923 if self.enabled {
6924 <V as VisitMut>::visit_mut_opt_atom(&mut self.visitor, node)
6925 } else {
6926 }
6927 }
6928
6929 #[inline]
6930 fn visit_mut_opt_modifiers(&mut self, node: &mut Option<Modifiers>) {
6931 if self.enabled {
6932 <V as VisitMut>::visit_mut_opt_modifiers(&mut self.visitor, node)
6933 } else {
6934 }
6935 }
6936
6937 #[inline]
6938 fn visit_mut_pattern(&mut self, node: &mut Pattern) {
6939 if self.enabled {
6940 <V as VisitMut>::visit_mut_pattern(&mut self.visitor, node)
6941 } else {
6942 }
6943 }
6944
6945 #[inline]
6946 fn visit_mut_quantifier(&mut self, node: &mut Quantifier) {
6947 if self.enabled {
6948 <V as VisitMut>::visit_mut_quantifier(&mut self.visitor, node)
6949 } else {
6950 }
6951 }
6952
6953 #[inline]
6954 fn visit_mut_span(&mut self, node: &mut swc_common::Span) {
6955 if self.enabled {
6956 <V as VisitMut>::visit_mut_span(&mut self.visitor, node)
6957 } else {
6958 }
6959 }
6960
6961 #[inline]
6962 fn visit_mut_term(&mut self, node: &mut Term) {
6963 if self.enabled {
6964 <V as VisitMut>::visit_mut_term(&mut self.visitor, node)
6965 } else {
6966 }
6967 }
6968
6969 #[inline]
6970 fn visit_mut_terms(&mut self, node: &mut Vec<Term>) {
6971 if self.enabled {
6972 <V as VisitMut>::visit_mut_terms(&mut self.visitor, node)
6973 } else {
6974 }
6975 }
6976
6977 #[inline]
6978 fn visit_mut_unicode_property_escape(&mut self, node: &mut UnicodePropertyEscape) {
6979 if self.enabled {
6980 <V as VisitMut>::visit_mut_unicode_property_escape(&mut self.visitor, node)
6981 } else {
6982 }
6983 }
6984}
6985#[doc = r" A trait implemented for types that can be visited using a visitor."]
6986pub trait VisitMutWith<V: ?Sized + VisitMut> {
6987 #[doc = r" Calls a visitor method (visitor.fold_xxx) with self."]
6988 fn visit_mut_with(&mut self, visitor: &mut V);
6989 #[doc = r" Visit children nodes of `self`` with `visitor`."]
6990 fn visit_mut_children_with(&mut self, visitor: &mut V);
6991}
6992impl<V: ?Sized + VisitMut> VisitMutWith<V> for Alternative {
6993 #[doc = "Calls [VisitMut`::visit_mut_alternative`] with `self`."]
6994 fn visit_mut_with(&mut self, visitor: &mut V) {
6995 <V as VisitMut>::visit_mut_alternative(visitor, self)
6996 }
6997
6998 fn visit_mut_children_with(&mut self, visitor: &mut V) {
6999 match self {
7000 Alternative { span, body } => {
7001 {
7002 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7003 };
7004 {
7005 <Vec<Term> as VisitMutWith<V>>::visit_mut_with(body, visitor)
7006 };
7007 }
7008 }
7009 }
7010}
7011impl<V: ?Sized + VisitMut> VisitMutWith<V> for BoundaryAssertion {
7012 #[doc = "Calls [VisitMut`::visit_mut_boundary_assertion`] with `self`."]
7013 fn visit_mut_with(&mut self, visitor: &mut V) {
7014 <V as VisitMut>::visit_mut_boundary_assertion(visitor, self)
7015 }
7016
7017 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7018 match self {
7019 BoundaryAssertion { span, kind } => {
7020 {
7021 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7022 };
7023 {
7024 <BoundaryAssertionKind as VisitMutWith<V>>::visit_mut_with(kind, visitor)
7025 };
7026 }
7027 }
7028 }
7029}
7030impl<V: ?Sized + VisitMut> VisitMutWith<V> for BoundaryAssertionKind {
7031 #[doc = "Calls [VisitMut`::visit_mut_boundary_assertion_kind`] with `self`."]
7032 fn visit_mut_with(&mut self, visitor: &mut V) {
7033 <V as VisitMut>::visit_mut_boundary_assertion_kind(visitor, self)
7034 }
7035
7036 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7037 match self {
7038 BoundaryAssertionKind::Start => {}
7039 BoundaryAssertionKind::End => {}
7040 BoundaryAssertionKind::Boundary => {}
7041 BoundaryAssertionKind::NegativeBoundary => {}
7042 }
7043 }
7044}
7045impl<V: ?Sized + VisitMut> VisitMutWith<V> for CapturingGroup {
7046 #[doc = "Calls [VisitMut`::visit_mut_capturing_group`] with `self`."]
7047 fn visit_mut_with(&mut self, visitor: &mut V) {
7048 <V as VisitMut>::visit_mut_capturing_group(visitor, self)
7049 }
7050
7051 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7052 match self {
7053 CapturingGroup { span, name, body } => {
7054 {
7055 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7056 };
7057 {
7058 <Option<swc_atoms::Atom> as VisitMutWith<V>>::visit_mut_with(name, visitor)
7059 };
7060 {
7061 <Disjunction as VisitMutWith<V>>::visit_mut_with(body, visitor)
7062 };
7063 }
7064 }
7065 }
7066}
7067impl<V: ?Sized + VisitMut> VisitMutWith<V> for Character {
7068 #[doc = "Calls [VisitMut`::visit_mut_character`] with `self`."]
7069 fn visit_mut_with(&mut self, visitor: &mut V) {
7070 <V as VisitMut>::visit_mut_character(visitor, self)
7071 }
7072
7073 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7074 match self {
7075 Character { span, kind, value } => {
7076 {
7077 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7078 };
7079 {
7080 <CharacterKind as VisitMutWith<V>>::visit_mut_with(kind, visitor)
7081 };
7082 }
7083 }
7084 }
7085}
7086impl<V: ?Sized + VisitMut> VisitMutWith<V> for CharacterClass {
7087 #[doc = "Calls [VisitMut`::visit_mut_character_class`] with `self`."]
7088 fn visit_mut_with(&mut self, visitor: &mut V) {
7089 <V as VisitMut>::visit_mut_character_class(visitor, self)
7090 }
7091
7092 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7093 match self {
7094 CharacterClass {
7095 span,
7096 negative,
7097 strings,
7098 kind,
7099 body,
7100 } => {
7101 {
7102 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7103 };
7104 {
7105 <CharacterClassContentsKind as VisitMutWith<V>>::visit_mut_with(kind, visitor)
7106 };
7107 {
7108 <Vec<CharacterClassContents> as VisitMutWith<V>>::visit_mut_with(body, visitor)
7109 };
7110 }
7111 }
7112 }
7113}
7114impl<V: ?Sized + VisitMut> VisitMutWith<V> for CharacterClassContents {
7115 #[doc = "Calls [VisitMut`::visit_mut_character_class_contents`] with `self`."]
7116 fn visit_mut_with(&mut self, visitor: &mut V) {
7117 <V as VisitMut>::visit_mut_character_class_contents(visitor, self)
7118 }
7119
7120 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7121 match self {
7122 CharacterClassContents::CharacterClassRange { 0: _field_0 } => {
7123 <Box<CharacterClassRange> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7124 }
7125 CharacterClassContents::CharacterClassEscape { 0: _field_0 } => {
7126 <Box<CharacterClassEscape> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7127 }
7128 CharacterClassContents::UnicodePropertyEscape { 0: _field_0 } => {
7129 <Box<UnicodePropertyEscape> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7130 }
7131 CharacterClassContents::Character { 0: _field_0 } => {
7132 <Box<Character> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7133 }
7134 CharacterClassContents::NestedCharacterClass { 0: _field_0 } => {
7135 <Box<CharacterClass> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7136 }
7137 CharacterClassContents::ClassStringDisjunction { 0: _field_0 } => {
7138 <Box<ClassStringDisjunction> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7139 }
7140 }
7141 }
7142}
7143impl<V: ?Sized + VisitMut> VisitMutWith<V> for CharacterClassContentsKind {
7144 #[doc = "Calls [VisitMut`::visit_mut_character_class_contents_kind`] with `self`."]
7145 fn visit_mut_with(&mut self, visitor: &mut V) {
7146 <V as VisitMut>::visit_mut_character_class_contents_kind(visitor, self)
7147 }
7148
7149 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7150 match self {
7151 CharacterClassContentsKind::Union => {}
7152 CharacterClassContentsKind::Intersection => {}
7153 CharacterClassContentsKind::Subtraction => {}
7154 }
7155 }
7156}
7157impl<V: ?Sized + VisitMut> VisitMutWith<V> for CharacterClassEscape {
7158 #[doc = "Calls [VisitMut`::visit_mut_character_class_escape`] with `self`."]
7159 fn visit_mut_with(&mut self, visitor: &mut V) {
7160 <V as VisitMut>::visit_mut_character_class_escape(visitor, self)
7161 }
7162
7163 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7164 match self {
7165 CharacterClassEscape { span, kind } => {
7166 {
7167 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7168 };
7169 {
7170 <CharacterClassEscapeKind as VisitMutWith<V>>::visit_mut_with(kind, visitor)
7171 };
7172 }
7173 }
7174 }
7175}
7176impl<V: ?Sized + VisitMut> VisitMutWith<V> for CharacterClassEscapeKind {
7177 #[doc = "Calls [VisitMut`::visit_mut_character_class_escape_kind`] with `self`."]
7178 fn visit_mut_with(&mut self, visitor: &mut V) {
7179 <V as VisitMut>::visit_mut_character_class_escape_kind(visitor, self)
7180 }
7181
7182 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7183 match self {
7184 CharacterClassEscapeKind::D => {}
7185 CharacterClassEscapeKind::NegativeD => {}
7186 CharacterClassEscapeKind::S => {}
7187 CharacterClassEscapeKind::NegativeS => {}
7188 CharacterClassEscapeKind::W => {}
7189 CharacterClassEscapeKind::NegativeW => {}
7190 }
7191 }
7192}
7193impl<V: ?Sized + VisitMut> VisitMutWith<V> for CharacterClassRange {
7194 #[doc = "Calls [VisitMut`::visit_mut_character_class_range`] with `self`."]
7195 fn visit_mut_with(&mut self, visitor: &mut V) {
7196 <V as VisitMut>::visit_mut_character_class_range(visitor, self)
7197 }
7198
7199 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7200 match self {
7201 CharacterClassRange { span, min, max } => {
7202 {
7203 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7204 };
7205 {
7206 <Character as VisitMutWith<V>>::visit_mut_with(min, visitor)
7207 };
7208 {
7209 <Character as VisitMutWith<V>>::visit_mut_with(max, visitor)
7210 };
7211 }
7212 }
7213 }
7214}
7215impl<V: ?Sized + VisitMut> VisitMutWith<V> for CharacterKind {
7216 #[doc = "Calls [VisitMut`::visit_mut_character_kind`] with `self`."]
7217 fn visit_mut_with(&mut self, visitor: &mut V) {
7218 <V as VisitMut>::visit_mut_character_kind(visitor, self)
7219 }
7220
7221 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7222 match self {
7223 CharacterKind::ControlLetter => {}
7224 CharacterKind::HexadecimalEscape => {}
7225 CharacterKind::Identifier => {}
7226 CharacterKind::Null => {}
7227 CharacterKind::Octal1 => {}
7228 CharacterKind::Octal2 => {}
7229 CharacterKind::Octal3 => {}
7230 CharacterKind::SingleEscape => {}
7231 CharacterKind::Symbol => {}
7232 CharacterKind::UnicodeEscape => {}
7233 }
7234 }
7235}
7236impl<V: ?Sized + VisitMut> VisitMutWith<V> for ClassString {
7237 #[doc = "Calls [VisitMut`::visit_mut_class_string`] with `self`."]
7238 fn visit_mut_with(&mut self, visitor: &mut V) {
7239 <V as VisitMut>::visit_mut_class_string(visitor, self)
7240 }
7241
7242 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7243 match self {
7244 ClassString {
7245 span,
7246 strings,
7247 body,
7248 } => {
7249 {
7250 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7251 };
7252 {
7253 <Vec<Character> as VisitMutWith<V>>::visit_mut_with(body, visitor)
7254 };
7255 }
7256 }
7257 }
7258}
7259impl<V: ?Sized + VisitMut> VisitMutWith<V> for ClassStringDisjunction {
7260 #[doc = "Calls [VisitMut`::visit_mut_class_string_disjunction`] with `self`."]
7261 fn visit_mut_with(&mut self, visitor: &mut V) {
7262 <V as VisitMut>::visit_mut_class_string_disjunction(visitor, self)
7263 }
7264
7265 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7266 match self {
7267 ClassStringDisjunction {
7268 span,
7269 strings,
7270 body,
7271 } => {
7272 {
7273 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7274 };
7275 {
7276 <Vec<ClassString> as VisitMutWith<V>>::visit_mut_with(body, visitor)
7277 };
7278 }
7279 }
7280 }
7281}
7282impl<V: ?Sized + VisitMut> VisitMutWith<V> for Disjunction {
7283 #[doc = "Calls [VisitMut`::visit_mut_disjunction`] with `self`."]
7284 fn visit_mut_with(&mut self, visitor: &mut V) {
7285 <V as VisitMut>::visit_mut_disjunction(visitor, self)
7286 }
7287
7288 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7289 match self {
7290 Disjunction { span, body } => {
7291 {
7292 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7293 };
7294 {
7295 <Vec<Alternative> as VisitMutWith<V>>::visit_mut_with(body, visitor)
7296 };
7297 }
7298 }
7299 }
7300}
7301impl<V: ?Sized + VisitMut> VisitMutWith<V> for Dot {
7302 #[doc = "Calls [VisitMut`::visit_mut_dot`] with `self`."]
7303 fn visit_mut_with(&mut self, visitor: &mut V) {
7304 <V as VisitMut>::visit_mut_dot(visitor, self)
7305 }
7306
7307 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7308 match self {
7309 Dot { span } => {
7310 {
7311 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7312 };
7313 }
7314 }
7315 }
7316}
7317impl<V: ?Sized + VisitMut> VisitMutWith<V> for IgnoreGroup {
7318 #[doc = "Calls [VisitMut`::visit_mut_ignore_group`] with `self`."]
7319 fn visit_mut_with(&mut self, visitor: &mut V) {
7320 <V as VisitMut>::visit_mut_ignore_group(visitor, self)
7321 }
7322
7323 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7324 match self {
7325 IgnoreGroup {
7326 span,
7327 modifiers,
7328 body,
7329 } => {
7330 {
7331 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7332 };
7333 {
7334 <Option<Modifiers> as VisitMutWith<V>>::visit_mut_with(modifiers, visitor)
7335 };
7336 {
7337 <Disjunction as VisitMutWith<V>>::visit_mut_with(body, visitor)
7338 };
7339 }
7340 }
7341 }
7342}
7343impl<V: ?Sized + VisitMut> VisitMutWith<V> for IndexedReference {
7344 #[doc = "Calls [VisitMut`::visit_mut_indexed_reference`] with `self`."]
7345 fn visit_mut_with(&mut self, visitor: &mut V) {
7346 <V as VisitMut>::visit_mut_indexed_reference(visitor, self)
7347 }
7348
7349 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7350 match self {
7351 IndexedReference { span, index } => {
7352 {
7353 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7354 };
7355 }
7356 }
7357 }
7358}
7359impl<V: ?Sized + VisitMut> VisitMutWith<V> for LookAroundAssertion {
7360 #[doc = "Calls [VisitMut`::visit_mut_look_around_assertion`] with `self`."]
7361 fn visit_mut_with(&mut self, visitor: &mut V) {
7362 <V as VisitMut>::visit_mut_look_around_assertion(visitor, self)
7363 }
7364
7365 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7366 match self {
7367 LookAroundAssertion { span, kind, body } => {
7368 {
7369 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7370 };
7371 {
7372 <LookAroundAssertionKind as VisitMutWith<V>>::visit_mut_with(kind, visitor)
7373 };
7374 {
7375 <Disjunction as VisitMutWith<V>>::visit_mut_with(body, visitor)
7376 };
7377 }
7378 }
7379 }
7380}
7381impl<V: ?Sized + VisitMut> VisitMutWith<V> for LookAroundAssertionKind {
7382 #[doc = "Calls [VisitMut`::visit_mut_look_around_assertion_kind`] with `self`."]
7383 fn visit_mut_with(&mut self, visitor: &mut V) {
7384 <V as VisitMut>::visit_mut_look_around_assertion_kind(visitor, self)
7385 }
7386
7387 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7388 match self {
7389 LookAroundAssertionKind::Lookahead => {}
7390 LookAroundAssertionKind::NegativeLookahead => {}
7391 LookAroundAssertionKind::Lookbehind => {}
7392 LookAroundAssertionKind::NegativeLookbehind => {}
7393 }
7394 }
7395}
7396impl<V: ?Sized + VisitMut> VisitMutWith<V> for Modifiers {
7397 #[doc = "Calls [VisitMut`::visit_mut_modifiers`] with `self`."]
7398 fn visit_mut_with(&mut self, visitor: &mut V) {
7399 <V as VisitMut>::visit_mut_modifiers(visitor, self)
7400 }
7401
7402 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7403 match self {
7404 Modifiers {
7405 span,
7406 enabling,
7407 disabling,
7408 } => {
7409 {
7410 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7411 };
7412 {
7413 <Modifier as VisitMutWith<V>>::visit_mut_with(enabling, visitor)
7414 };
7415 {
7416 <Modifier as VisitMutWith<V>>::visit_mut_with(disabling, visitor)
7417 };
7418 }
7419 }
7420 }
7421}
7422impl<V: ?Sized + VisitMut> VisitMutWith<V> for NamedReference {
7423 #[doc = "Calls [VisitMut`::visit_mut_named_reference`] with `self`."]
7424 fn visit_mut_with(&mut self, visitor: &mut V) {
7425 <V as VisitMut>::visit_mut_named_reference(visitor, self)
7426 }
7427
7428 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7429 match self {
7430 NamedReference { span, name } => {
7431 {
7432 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7433 };
7434 {
7435 <swc_atoms::Atom as VisitMutWith<V>>::visit_mut_with(name, visitor)
7436 };
7437 }
7438 }
7439 }
7440}
7441impl<V: ?Sized + VisitMut> VisitMutWith<V> for Pattern {
7442 #[doc = "Calls [VisitMut`::visit_mut_pattern`] with `self`."]
7443 fn visit_mut_with(&mut self, visitor: &mut V) {
7444 <V as VisitMut>::visit_mut_pattern(visitor, self)
7445 }
7446
7447 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7448 match self {
7449 Pattern { span, body } => {
7450 {
7451 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7452 };
7453 {
7454 <Disjunction as VisitMutWith<V>>::visit_mut_with(body, visitor)
7455 };
7456 }
7457 }
7458 }
7459}
7460impl<V: ?Sized + VisitMut> VisitMutWith<V> for Quantifier {
7461 #[doc = "Calls [VisitMut`::visit_mut_quantifier`] with `self`."]
7462 fn visit_mut_with(&mut self, visitor: &mut V) {
7463 <V as VisitMut>::visit_mut_quantifier(visitor, self)
7464 }
7465
7466 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7467 match self {
7468 Quantifier {
7469 span,
7470 min,
7471 max,
7472 greedy,
7473 body,
7474 } => {
7475 {
7476 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7477 };
7478 {
7479 <Term as VisitMutWith<V>>::visit_mut_with(body, visitor)
7480 };
7481 }
7482 }
7483 }
7484}
7485impl<V: ?Sized + VisitMut> VisitMutWith<V> for Term {
7486 #[doc = "Calls [VisitMut`::visit_mut_term`] with `self`."]
7487 fn visit_mut_with(&mut self, visitor: &mut V) {
7488 <V as VisitMut>::visit_mut_term(visitor, self)
7489 }
7490
7491 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7492 match self {
7493 Term::BoundaryAssertion { 0: _field_0 } => {
7494 <Box<BoundaryAssertion> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7495 }
7496 Term::LookAroundAssertion { 0: _field_0 } => {
7497 <Box<LookAroundAssertion> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7498 }
7499 Term::Quantifier { 0: _field_0 } => {
7500 <Box<Quantifier> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7501 }
7502 Term::Character { 0: _field_0 } => {
7503 <Box<Character> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7504 }
7505 Term::Dot { 0: _field_0 } => {
7506 <Dot as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7507 }
7508 Term::CharacterClassEscape { 0: _field_0 } => {
7509 <Box<CharacterClassEscape> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7510 }
7511 Term::UnicodePropertyEscape { 0: _field_0 } => {
7512 <Box<UnicodePropertyEscape> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7513 }
7514 Term::CharacterClass { 0: _field_0 } => {
7515 <Box<CharacterClass> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7516 }
7517 Term::CapturingGroup { 0: _field_0 } => {
7518 <Box<CapturingGroup> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7519 }
7520 Term::IgnoreGroup { 0: _field_0 } => {
7521 <Box<IgnoreGroup> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7522 }
7523 Term::IndexedReference { 0: _field_0 } => {
7524 <Box<IndexedReference> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7525 }
7526 Term::NamedReference { 0: _field_0 } => {
7527 <Box<NamedReference> as VisitMutWith<V>>::visit_mut_with(_field_0, visitor);
7528 }
7529 }
7530 }
7531}
7532impl<V: ?Sized + VisitMut> VisitMutWith<V> for UnicodePropertyEscape {
7533 #[doc = "Calls [VisitMut`::visit_mut_unicode_property_escape`] with `self`."]
7534 fn visit_mut_with(&mut self, visitor: &mut V) {
7535 <V as VisitMut>::visit_mut_unicode_property_escape(visitor, self)
7536 }
7537
7538 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7539 match self {
7540 UnicodePropertyEscape {
7541 span,
7542 negative,
7543 strings,
7544 name,
7545 value,
7546 } => {
7547 {
7548 <swc_common::Span as VisitMutWith<V>>::visit_mut_with(span, visitor)
7549 };
7550 {
7551 <swc_atoms::Atom as VisitMutWith<V>>::visit_mut_with(name, visitor)
7552 };
7553 {
7554 <Option<swc_atoms::Atom> as VisitMutWith<V>>::visit_mut_with(value, visitor)
7555 };
7556 }
7557 }
7558 }
7559}
7560impl<V: ?Sized + VisitMut> VisitMutWith<V> for Vec<Alternative> {
7561 #[doc = "Calls [VisitMut`::visit_mut_alternatives`] with `self`. (Extra impl)"]
7562 #[inline]
7563 fn visit_mut_with(&mut self, visitor: &mut V) {
7564 <V as VisitMut>::visit_mut_alternatives(visitor, self)
7565 }
7566
7567 #[inline]
7568 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7569 self.iter_mut()
7570 .for_each(|item| <Alternative as VisitMutWith<V>>::visit_mut_with(item, visitor))
7571 }
7572}
7573impl<V: ?Sized + VisitMut> VisitMutWith<V> for swc_atoms::Atom {
7574 #[doc = "Calls [VisitMut`::visit_mut_atom`] with `self`. (Extra impl)"]
7575 #[inline]
7576 fn visit_mut_with(&mut self, visitor: &mut V) {
7577 <V as VisitMut>::visit_mut_atom(visitor, self)
7578 }
7579
7580 #[inline]
7581 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7582 {}
7583 }
7584}
7585impl<V: ?Sized + VisitMut> VisitMutWith<V> for Vec<CharacterClassContents> {
7586 #[doc = "Calls [VisitMut`::visit_mut_character_class_contentss`] with `self`. (Extra impl)"]
7587 #[inline]
7588 fn visit_mut_with(&mut self, visitor: &mut V) {
7589 <V as VisitMut>::visit_mut_character_class_contentss(visitor, self)
7590 }
7591
7592 #[inline]
7593 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7594 self.iter_mut().for_each(|item| {
7595 <CharacterClassContents as VisitMutWith<V>>::visit_mut_with(item, visitor)
7596 })
7597 }
7598}
7599impl<V: ?Sized + VisitMut> VisitMutWith<V> for Vec<Character> {
7600 #[doc = "Calls [VisitMut`::visit_mut_characters`] with `self`. (Extra impl)"]
7601 #[inline]
7602 fn visit_mut_with(&mut self, visitor: &mut V) {
7603 <V as VisitMut>::visit_mut_characters(visitor, self)
7604 }
7605
7606 #[inline]
7607 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7608 self.iter_mut()
7609 .for_each(|item| <Character as VisitMutWith<V>>::visit_mut_with(item, visitor))
7610 }
7611}
7612impl<V: ?Sized + VisitMut> VisitMutWith<V> for Vec<ClassString> {
7613 #[doc = "Calls [VisitMut`::visit_mut_class_strings`] with `self`. (Extra impl)"]
7614 #[inline]
7615 fn visit_mut_with(&mut self, visitor: &mut V) {
7616 <V as VisitMut>::visit_mut_class_strings(visitor, self)
7617 }
7618
7619 #[inline]
7620 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7621 self.iter_mut()
7622 .for_each(|item| <ClassString as VisitMutWith<V>>::visit_mut_with(item, visitor))
7623 }
7624}
7625impl<V: ?Sized + VisitMut> VisitMutWith<V> for Modifier {
7626 #[doc = "Calls [VisitMut`::visit_mut_modifier`] with `self`. (Extra impl)"]
7627 #[inline]
7628 fn visit_mut_with(&mut self, visitor: &mut V) {
7629 <V as VisitMut>::visit_mut_modifier(visitor, self)
7630 }
7631
7632 #[inline]
7633 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7634 {}
7635 }
7636}
7637impl<V: ?Sized + VisitMut> VisitMutWith<V> for Option<swc_atoms::Atom> {
7638 #[doc = "Calls [VisitMut`::visit_mut_opt_atom`] with `self`. (Extra impl)"]
7639 #[inline]
7640 fn visit_mut_with(&mut self, visitor: &mut V) {
7641 <V as VisitMut>::visit_mut_opt_atom(visitor, self)
7642 }
7643
7644 #[inline]
7645 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7646 match self {
7647 Some(inner) => <swc_atoms::Atom as VisitMutWith<V>>::visit_mut_with(inner, visitor),
7648 None => {}
7649 }
7650 }
7651}
7652impl<V: ?Sized + VisitMut> VisitMutWith<V> for Option<Modifiers> {
7653 #[doc = "Calls [VisitMut`::visit_mut_opt_modifiers`] with `self`. (Extra impl)"]
7654 #[inline]
7655 fn visit_mut_with(&mut self, visitor: &mut V) {
7656 <V as VisitMut>::visit_mut_opt_modifiers(visitor, self)
7657 }
7658
7659 #[inline]
7660 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7661 match self {
7662 Some(inner) => <Modifiers as VisitMutWith<V>>::visit_mut_with(inner, visitor),
7663 None => {}
7664 }
7665 }
7666}
7667impl<V: ?Sized + VisitMut> VisitMutWith<V> for swc_common::Span {
7668 #[doc = "Calls [VisitMut`::visit_mut_span`] with `self`. (Extra impl)"]
7669 #[inline]
7670 fn visit_mut_with(&mut self, visitor: &mut V) {
7671 <V as VisitMut>::visit_mut_span(visitor, self)
7672 }
7673
7674 #[inline]
7675 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7676 {}
7677 }
7678}
7679impl<V: ?Sized + VisitMut> VisitMutWith<V> for Vec<Term> {
7680 #[doc = "Calls [VisitMut`::visit_mut_terms`] with `self`. (Extra impl)"]
7681 #[inline]
7682 fn visit_mut_with(&mut self, visitor: &mut V) {
7683 <V as VisitMut>::visit_mut_terms(visitor, self)
7684 }
7685
7686 #[inline]
7687 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7688 self.iter_mut()
7689 .for_each(|item| <Term as VisitMutWith<V>>::visit_mut_with(item, visitor))
7690 }
7691}
7692impl<V, T> VisitMutWith<V> for std::boxed::Box<T>
7693where
7694 V: ?Sized + VisitMut,
7695 T: VisitMutWith<V>,
7696{
7697 #[inline]
7698 fn visit_mut_with(&mut self, visitor: &mut V) {
7699 let v = <T as VisitMutWith<V>>::visit_mut_with(&mut **self, visitor);
7700 v
7701 }
7702
7703 #[inline]
7704 fn visit_mut_children_with(&mut self, visitor: &mut V) {
7705 let v = <T as VisitMutWith<V>>::visit_mut_children_with(&mut **self, visitor);
7706 v
7707 }
7708}
7709#[doc = r" A visitor trait for traversing the AST."]
7710#[cfg(any(docsrs, feature = "path"))]
7711#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
7712pub trait VisitMutAstPath {
7713 #[doc = "Visit a node of type `Alternative`.\n\nBy default, this method calls \
7714 [`Alternative::visit_mut_children_with_ast_path`]. If you want to recurse, you need \
7715 to call it manually."]
7716 #[inline]
7717 fn visit_mut_alternative(&mut self, node: &mut Alternative, __ast_path: &mut AstKindPath) {
7718 <Alternative as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7719 node, self, __ast_path,
7720 )
7721 }
7722 #[doc = "Visit a node of type `Vec < Alternative >`.\n\nBy default, this method calls [`Vec < \
7723 Alternative >::visit_mut_children_with_ast_path`]. If you want to recurse, you need \
7724 to call it manually."]
7725 #[inline]
7726 fn visit_mut_alternatives(
7727 &mut self,
7728 node: &mut Vec<Alternative>,
7729 __ast_path: &mut AstKindPath,
7730 ) {
7731 <Vec<Alternative> as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7732 node, self, __ast_path,
7733 )
7734 }
7735 #[doc = "Visit a node of type `swc_atoms :: Atom`.\n\nBy default, this method calls \
7736 [`swc_atoms :: Atom::visit_mut_children_with_ast_path`]. If you want to recurse, you \
7737 need to call it manually."]
7738 #[inline]
7739 fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom, __ast_path: &mut AstKindPath) {
7740 <swc_atoms::Atom as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7741 node, self, __ast_path,
7742 )
7743 }
7744 #[doc = "Visit a node of type `BoundaryAssertion`.\n\nBy default, this method calls \
7745 [`BoundaryAssertion::visit_mut_children_with_ast_path`]. If you want to recurse, you \
7746 need to call it manually."]
7747 #[inline]
7748 fn visit_mut_boundary_assertion(
7749 &mut self,
7750 node: &mut BoundaryAssertion,
7751 __ast_path: &mut AstKindPath,
7752 ) {
7753 <BoundaryAssertion as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7754 node, self, __ast_path,
7755 )
7756 }
7757 #[doc = "Visit a node of type `BoundaryAssertionKind`.\n\nBy default, this method calls \
7758 [`BoundaryAssertionKind::visit_mut_children_with_ast_path`]. If you want to recurse, \
7759 you need to call it manually."]
7760 #[inline]
7761 fn visit_mut_boundary_assertion_kind(
7762 &mut self,
7763 node: &mut BoundaryAssertionKind,
7764 __ast_path: &mut AstKindPath,
7765 ) {
7766 <BoundaryAssertionKind as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7767 node, self, __ast_path,
7768 )
7769 }
7770 #[doc = "Visit a node of type `CapturingGroup`.\n\nBy default, this method calls \
7771 [`CapturingGroup::visit_mut_children_with_ast_path`]. If you want to recurse, you \
7772 need to call it manually."]
7773 #[inline]
7774 fn visit_mut_capturing_group(
7775 &mut self,
7776 node: &mut CapturingGroup,
7777 __ast_path: &mut AstKindPath,
7778 ) {
7779 <CapturingGroup as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7780 node, self, __ast_path,
7781 )
7782 }
7783 #[doc = "Visit a node of type `Character`.\n\nBy default, this method calls \
7784 [`Character::visit_mut_children_with_ast_path`]. If you want to recurse, you need to \
7785 call it manually."]
7786 #[inline]
7787 fn visit_mut_character(&mut self, node: &mut Character, __ast_path: &mut AstKindPath) {
7788 <Character as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7789 node, self, __ast_path,
7790 )
7791 }
7792 #[doc = "Visit a node of type `CharacterClass`.\n\nBy default, this method calls \
7793 [`CharacterClass::visit_mut_children_with_ast_path`]. If you want to recurse, you \
7794 need to call it manually."]
7795 #[inline]
7796 fn visit_mut_character_class(
7797 &mut self,
7798 node: &mut CharacterClass,
7799 __ast_path: &mut AstKindPath,
7800 ) {
7801 <CharacterClass as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7802 node, self, __ast_path,
7803 )
7804 }
7805 #[doc = "Visit a node of type `CharacterClassContents`.\n\nBy default, this method calls \
7806 [`CharacterClassContents::visit_mut_children_with_ast_path`]. If you want to recurse, \
7807 you need to call it manually."]
7808 #[inline]
7809 fn visit_mut_character_class_contents(
7810 &mut self,
7811 node: &mut CharacterClassContents,
7812 __ast_path: &mut AstKindPath,
7813 ) {
7814 <CharacterClassContents as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7815 node, self, __ast_path,
7816 )
7817 }
7818 #[doc = "Visit a node of type `CharacterClassContentsKind`.\n\nBy default, this method calls \
7819 [`CharacterClassContentsKind::visit_mut_children_with_ast_path`]. If you want to \
7820 recurse, you need to call it manually."]
7821 #[inline]
7822 fn visit_mut_character_class_contents_kind(
7823 &mut self,
7824 node: &mut CharacterClassContentsKind,
7825 __ast_path: &mut AstKindPath,
7826 ) {
7827 <CharacterClassContentsKind as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7828 node, self, __ast_path,
7829 )
7830 }
7831 #[doc = "Visit a node of type `Vec < CharacterClassContents >`.\n\nBy default, this method \
7832 calls [`Vec < CharacterClassContents >::visit_mut_children_with_ast_path`]. If you \
7833 want to recurse, you need to call it manually."]
7834 #[inline]
7835 fn visit_mut_character_class_contentss(
7836 &mut self,
7837 node: &mut Vec<CharacterClassContents>,
7838 __ast_path: &mut AstKindPath,
7839 ) {
7840 <Vec<CharacterClassContents> as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7841 node, self, __ast_path,
7842 )
7843 }
7844 #[doc = "Visit a node of type `CharacterClassEscape`.\n\nBy default, this method calls \
7845 [`CharacterClassEscape::visit_mut_children_with_ast_path`]. If you want to recurse, \
7846 you need to call it manually."]
7847 #[inline]
7848 fn visit_mut_character_class_escape(
7849 &mut self,
7850 node: &mut CharacterClassEscape,
7851 __ast_path: &mut AstKindPath,
7852 ) {
7853 <CharacterClassEscape as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7854 node, self, __ast_path,
7855 )
7856 }
7857 #[doc = "Visit a node of type `CharacterClassEscapeKind`.\n\nBy default, this method calls \
7858 [`CharacterClassEscapeKind::visit_mut_children_with_ast_path`]. If you want to \
7859 recurse, you need to call it manually."]
7860 #[inline]
7861 fn visit_mut_character_class_escape_kind(
7862 &mut self,
7863 node: &mut CharacterClassEscapeKind,
7864 __ast_path: &mut AstKindPath,
7865 ) {
7866 <CharacterClassEscapeKind as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7867 node, self, __ast_path,
7868 )
7869 }
7870 #[doc = "Visit a node of type `CharacterClassRange`.\n\nBy default, this method calls \
7871 [`CharacterClassRange::visit_mut_children_with_ast_path`]. If you want to recurse, \
7872 you need to call it manually."]
7873 #[inline]
7874 fn visit_mut_character_class_range(
7875 &mut self,
7876 node: &mut CharacterClassRange,
7877 __ast_path: &mut AstKindPath,
7878 ) {
7879 <CharacterClassRange as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7880 node, self, __ast_path,
7881 )
7882 }
7883 #[doc = "Visit a node of type `CharacterKind`.\n\nBy default, this method calls \
7884 [`CharacterKind::visit_mut_children_with_ast_path`]. If you want to recurse, you need \
7885 to call it manually."]
7886 #[inline]
7887 fn visit_mut_character_kind(&mut self, node: &mut CharacterKind, __ast_path: &mut AstKindPath) {
7888 <CharacterKind as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7889 node, self, __ast_path,
7890 )
7891 }
7892 #[doc = "Visit a node of type `Vec < Character >`.\n\nBy default, this method calls [`Vec < \
7893 Character >::visit_mut_children_with_ast_path`]. If you want to recurse, you need to \
7894 call it manually."]
7895 #[inline]
7896 fn visit_mut_characters(&mut self, node: &mut Vec<Character>, __ast_path: &mut AstKindPath) {
7897 <Vec<Character> as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7898 node, self, __ast_path,
7899 )
7900 }
7901 #[doc = "Visit a node of type `ClassString`.\n\nBy default, this method calls \
7902 [`ClassString::visit_mut_children_with_ast_path`]. If you want to recurse, you need \
7903 to call it manually."]
7904 #[inline]
7905 fn visit_mut_class_string(&mut self, node: &mut ClassString, __ast_path: &mut AstKindPath) {
7906 <ClassString as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7907 node, self, __ast_path,
7908 )
7909 }
7910 #[doc = "Visit a node of type `ClassStringDisjunction`.\n\nBy default, this method calls \
7911 [`ClassStringDisjunction::visit_mut_children_with_ast_path`]. If you want to recurse, \
7912 you need to call it manually."]
7913 #[inline]
7914 fn visit_mut_class_string_disjunction(
7915 &mut self,
7916 node: &mut ClassStringDisjunction,
7917 __ast_path: &mut AstKindPath,
7918 ) {
7919 <ClassStringDisjunction as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7920 node, self, __ast_path,
7921 )
7922 }
7923 #[doc = "Visit a node of type `Vec < ClassString >`.\n\nBy default, this method calls [`Vec < \
7924 ClassString >::visit_mut_children_with_ast_path`]. If you want to recurse, you need \
7925 to call it manually."]
7926 #[inline]
7927 fn visit_mut_class_strings(
7928 &mut self,
7929 node: &mut Vec<ClassString>,
7930 __ast_path: &mut AstKindPath,
7931 ) {
7932 <Vec<ClassString> as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7933 node, self, __ast_path,
7934 )
7935 }
7936 #[doc = "Visit a node of type `Disjunction`.\n\nBy default, this method calls \
7937 [`Disjunction::visit_mut_children_with_ast_path`]. If you want to recurse, you need \
7938 to call it manually."]
7939 #[inline]
7940 fn visit_mut_disjunction(&mut self, node: &mut Disjunction, __ast_path: &mut AstKindPath) {
7941 <Disjunction as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7942 node, self, __ast_path,
7943 )
7944 }
7945 #[doc = "Visit a node of type `Dot`.\n\nBy default, this method calls \
7946 [`Dot::visit_mut_children_with_ast_path`]. If you want to recurse, you need to call \
7947 it manually."]
7948 #[inline]
7949 fn visit_mut_dot(&mut self, node: &mut Dot, __ast_path: &mut AstKindPath) {
7950 <Dot as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(node, self, __ast_path)
7951 }
7952 #[doc = "Visit a node of type `IgnoreGroup`.\n\nBy default, this method calls \
7953 [`IgnoreGroup::visit_mut_children_with_ast_path`]. If you want to recurse, you need \
7954 to call it manually."]
7955 #[inline]
7956 fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup, __ast_path: &mut AstKindPath) {
7957 <IgnoreGroup as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7958 node, self, __ast_path,
7959 )
7960 }
7961 #[doc = "Visit a node of type `IndexedReference`.\n\nBy default, this method calls \
7962 [`IndexedReference::visit_mut_children_with_ast_path`]. If you want to recurse, you \
7963 need to call it manually."]
7964 #[inline]
7965 fn visit_mut_indexed_reference(
7966 &mut self,
7967 node: &mut IndexedReference,
7968 __ast_path: &mut AstKindPath,
7969 ) {
7970 <IndexedReference as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7971 node, self, __ast_path,
7972 )
7973 }
7974 #[doc = "Visit a node of type `LookAroundAssertion`.\n\nBy default, this method calls \
7975 [`LookAroundAssertion::visit_mut_children_with_ast_path`]. If you want to recurse, \
7976 you need to call it manually."]
7977 #[inline]
7978 fn visit_mut_look_around_assertion(
7979 &mut self,
7980 node: &mut LookAroundAssertion,
7981 __ast_path: &mut AstKindPath,
7982 ) {
7983 <LookAroundAssertion as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7984 node, self, __ast_path,
7985 )
7986 }
7987 #[doc = "Visit a node of type `LookAroundAssertionKind`.\n\nBy default, this method calls \
7988 [`LookAroundAssertionKind::visit_mut_children_with_ast_path`]. If you want to \
7989 recurse, you need to call it manually."]
7990 #[inline]
7991 fn visit_mut_look_around_assertion_kind(
7992 &mut self,
7993 node: &mut LookAroundAssertionKind,
7994 __ast_path: &mut AstKindPath,
7995 ) {
7996 <LookAroundAssertionKind as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
7997 node, self, __ast_path,
7998 )
7999 }
8000 #[doc = "Visit a node of type `Modifier`.\n\nBy default, this method calls \
8001 [`Modifier::visit_mut_children_with_ast_path`]. If you want to recurse, you need to \
8002 call it manually."]
8003 #[inline]
8004 fn visit_mut_modifier(&mut self, node: &mut Modifier, __ast_path: &mut AstKindPath) {
8005 <Modifier as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
8006 node, self, __ast_path,
8007 )
8008 }
8009 #[doc = "Visit a node of type `Modifiers`.\n\nBy default, this method calls \
8010 [`Modifiers::visit_mut_children_with_ast_path`]. If you want to recurse, you need to \
8011 call it manually."]
8012 #[inline]
8013 fn visit_mut_modifiers(&mut self, node: &mut Modifiers, __ast_path: &mut AstKindPath) {
8014 <Modifiers as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
8015 node, self, __ast_path,
8016 )
8017 }
8018 #[doc = "Visit a node of type `NamedReference`.\n\nBy default, this method calls \
8019 [`NamedReference::visit_mut_children_with_ast_path`]. If you want to recurse, you \
8020 need to call it manually."]
8021 #[inline]
8022 fn visit_mut_named_reference(
8023 &mut self,
8024 node: &mut NamedReference,
8025 __ast_path: &mut AstKindPath,
8026 ) {
8027 <NamedReference as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
8028 node, self, __ast_path,
8029 )
8030 }
8031 #[doc = "Visit a node of type `Option < swc_atoms :: Atom >`.\n\nBy default, this method calls \
8032 [`Option < swc_atoms :: Atom >::visit_mut_children_with_ast_path`]. If you want to \
8033 recurse, you need to call it manually."]
8034 #[inline]
8035 fn visit_mut_opt_atom(
8036 &mut self,
8037 node: &mut Option<swc_atoms::Atom>,
8038 __ast_path: &mut AstKindPath,
8039 ) {
8040 <Option<swc_atoms::Atom> as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
8041 node, self, __ast_path,
8042 )
8043 }
8044 #[doc = "Visit a node of type `Option < Modifiers >`.\n\nBy default, this method calls \
8045 [`Option < Modifiers >::visit_mut_children_with_ast_path`]. If you want to recurse, \
8046 you need to call it manually."]
8047 #[inline]
8048 fn visit_mut_opt_modifiers(
8049 &mut self,
8050 node: &mut Option<Modifiers>,
8051 __ast_path: &mut AstKindPath,
8052 ) {
8053 <Option<Modifiers> as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
8054 node, self, __ast_path,
8055 )
8056 }
8057 #[doc = "Visit a node of type `Pattern`.\n\nBy default, this method calls \
8058 [`Pattern::visit_mut_children_with_ast_path`]. If you want to recurse, you need to \
8059 call it manually."]
8060 #[inline]
8061 fn visit_mut_pattern(&mut self, node: &mut Pattern, __ast_path: &mut AstKindPath) {
8062 <Pattern as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
8063 node, self, __ast_path,
8064 )
8065 }
8066 #[doc = "Visit a node of type `Quantifier`.\n\nBy default, this method calls \
8067 [`Quantifier::visit_mut_children_with_ast_path`]. If you want to recurse, you need to \
8068 call it manually."]
8069 #[inline]
8070 fn visit_mut_quantifier(&mut self, node: &mut Quantifier, __ast_path: &mut AstKindPath) {
8071 <Quantifier as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
8072 node, self, __ast_path,
8073 )
8074 }
8075 #[doc = "Visit a node of type `swc_common :: Span`.\n\nBy default, this method calls \
8076 [`swc_common :: Span::visit_mut_children_with_ast_path`]. If you want to recurse, you \
8077 need to call it manually."]
8078 #[inline]
8079 fn visit_mut_span(&mut self, node: &mut swc_common::Span, __ast_path: &mut AstKindPath) {
8080 <swc_common::Span as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
8081 node, self, __ast_path,
8082 )
8083 }
8084 #[doc = "Visit a node of type `Term`.\n\nBy default, this method calls \
8085 [`Term::visit_mut_children_with_ast_path`]. If you want to recurse, you need to call \
8086 it manually."]
8087 #[inline]
8088 fn visit_mut_term(&mut self, node: &mut Term, __ast_path: &mut AstKindPath) {
8089 <Term as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
8090 node, self, __ast_path,
8091 )
8092 }
8093 #[doc = "Visit a node of type `Vec < Term >`.\n\nBy default, this method calls [`Vec < Term \
8094 >::visit_mut_children_with_ast_path`]. If you want to recurse, you need to call it \
8095 manually."]
8096 #[inline]
8097 fn visit_mut_terms(&mut self, node: &mut Vec<Term>, __ast_path: &mut AstKindPath) {
8098 <Vec<Term> as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
8099 node, self, __ast_path,
8100 )
8101 }
8102 #[doc = "Visit a node of type `UnicodePropertyEscape`.\n\nBy default, this method calls \
8103 [`UnicodePropertyEscape::visit_mut_children_with_ast_path`]. If you want to recurse, \
8104 you need to call it manually."]
8105 #[inline]
8106 fn visit_mut_unicode_property_escape(
8107 &mut self,
8108 node: &mut UnicodePropertyEscape,
8109 __ast_path: &mut AstKindPath,
8110 ) {
8111 <UnicodePropertyEscape as VisitMutWithAstPath<Self>>::visit_mut_children_with_ast_path(
8112 node, self, __ast_path,
8113 )
8114 }
8115}
8116#[cfg(any(docsrs, feature = "path"))]
8117#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
8118impl<V> VisitMutAstPath for &mut V
8119where
8120 V: ?Sized + VisitMutAstPath,
8121{
8122 #[inline]
8123 fn visit_mut_alternative(&mut self, node: &mut Alternative, __ast_path: &mut AstKindPath) {
8124 <V as VisitMutAstPath>::visit_mut_alternative(&mut **self, node, __ast_path)
8125 }
8126
8127 #[inline]
8128 fn visit_mut_alternatives(
8129 &mut self,
8130 node: &mut Vec<Alternative>,
8131 __ast_path: &mut AstKindPath,
8132 ) {
8133 <V as VisitMutAstPath>::visit_mut_alternatives(&mut **self, node, __ast_path)
8134 }
8135
8136 #[inline]
8137 fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom, __ast_path: &mut AstKindPath) {
8138 <V as VisitMutAstPath>::visit_mut_atom(&mut **self, node, __ast_path)
8139 }
8140
8141 #[inline]
8142 fn visit_mut_boundary_assertion(
8143 &mut self,
8144 node: &mut BoundaryAssertion,
8145 __ast_path: &mut AstKindPath,
8146 ) {
8147 <V as VisitMutAstPath>::visit_mut_boundary_assertion(&mut **self, node, __ast_path)
8148 }
8149
8150 #[inline]
8151 fn visit_mut_boundary_assertion_kind(
8152 &mut self,
8153 node: &mut BoundaryAssertionKind,
8154 __ast_path: &mut AstKindPath,
8155 ) {
8156 <V as VisitMutAstPath>::visit_mut_boundary_assertion_kind(&mut **self, node, __ast_path)
8157 }
8158
8159 #[inline]
8160 fn visit_mut_capturing_group(
8161 &mut self,
8162 node: &mut CapturingGroup,
8163 __ast_path: &mut AstKindPath,
8164 ) {
8165 <V as VisitMutAstPath>::visit_mut_capturing_group(&mut **self, node, __ast_path)
8166 }
8167
8168 #[inline]
8169 fn visit_mut_character(&mut self, node: &mut Character, __ast_path: &mut AstKindPath) {
8170 <V as VisitMutAstPath>::visit_mut_character(&mut **self, node, __ast_path)
8171 }
8172
8173 #[inline]
8174 fn visit_mut_character_class(
8175 &mut self,
8176 node: &mut CharacterClass,
8177 __ast_path: &mut AstKindPath,
8178 ) {
8179 <V as VisitMutAstPath>::visit_mut_character_class(&mut **self, node, __ast_path)
8180 }
8181
8182 #[inline]
8183 fn visit_mut_character_class_contents(
8184 &mut self,
8185 node: &mut CharacterClassContents,
8186 __ast_path: &mut AstKindPath,
8187 ) {
8188 <V as VisitMutAstPath>::visit_mut_character_class_contents(&mut **self, node, __ast_path)
8189 }
8190
8191 #[inline]
8192 fn visit_mut_character_class_contents_kind(
8193 &mut self,
8194 node: &mut CharacterClassContentsKind,
8195 __ast_path: &mut AstKindPath,
8196 ) {
8197 <V as VisitMutAstPath>::visit_mut_character_class_contents_kind(
8198 &mut **self,
8199 node,
8200 __ast_path,
8201 )
8202 }
8203
8204 #[inline]
8205 fn visit_mut_character_class_contentss(
8206 &mut self,
8207 node: &mut Vec<CharacterClassContents>,
8208 __ast_path: &mut AstKindPath,
8209 ) {
8210 <V as VisitMutAstPath>::visit_mut_character_class_contentss(&mut **self, node, __ast_path)
8211 }
8212
8213 #[inline]
8214 fn visit_mut_character_class_escape(
8215 &mut self,
8216 node: &mut CharacterClassEscape,
8217 __ast_path: &mut AstKindPath,
8218 ) {
8219 <V as VisitMutAstPath>::visit_mut_character_class_escape(&mut **self, node, __ast_path)
8220 }
8221
8222 #[inline]
8223 fn visit_mut_character_class_escape_kind(
8224 &mut self,
8225 node: &mut CharacterClassEscapeKind,
8226 __ast_path: &mut AstKindPath,
8227 ) {
8228 <V as VisitMutAstPath>::visit_mut_character_class_escape_kind(&mut **self, node, __ast_path)
8229 }
8230
8231 #[inline]
8232 fn visit_mut_character_class_range(
8233 &mut self,
8234 node: &mut CharacterClassRange,
8235 __ast_path: &mut AstKindPath,
8236 ) {
8237 <V as VisitMutAstPath>::visit_mut_character_class_range(&mut **self, node, __ast_path)
8238 }
8239
8240 #[inline]
8241 fn visit_mut_character_kind(&mut self, node: &mut CharacterKind, __ast_path: &mut AstKindPath) {
8242 <V as VisitMutAstPath>::visit_mut_character_kind(&mut **self, node, __ast_path)
8243 }
8244
8245 #[inline]
8246 fn visit_mut_characters(&mut self, node: &mut Vec<Character>, __ast_path: &mut AstKindPath) {
8247 <V as VisitMutAstPath>::visit_mut_characters(&mut **self, node, __ast_path)
8248 }
8249
8250 #[inline]
8251 fn visit_mut_class_string(&mut self, node: &mut ClassString, __ast_path: &mut AstKindPath) {
8252 <V as VisitMutAstPath>::visit_mut_class_string(&mut **self, node, __ast_path)
8253 }
8254
8255 #[inline]
8256 fn visit_mut_class_string_disjunction(
8257 &mut self,
8258 node: &mut ClassStringDisjunction,
8259 __ast_path: &mut AstKindPath,
8260 ) {
8261 <V as VisitMutAstPath>::visit_mut_class_string_disjunction(&mut **self, node, __ast_path)
8262 }
8263
8264 #[inline]
8265 fn visit_mut_class_strings(
8266 &mut self,
8267 node: &mut Vec<ClassString>,
8268 __ast_path: &mut AstKindPath,
8269 ) {
8270 <V as VisitMutAstPath>::visit_mut_class_strings(&mut **self, node, __ast_path)
8271 }
8272
8273 #[inline]
8274 fn visit_mut_disjunction(&mut self, node: &mut Disjunction, __ast_path: &mut AstKindPath) {
8275 <V as VisitMutAstPath>::visit_mut_disjunction(&mut **self, node, __ast_path)
8276 }
8277
8278 #[inline]
8279 fn visit_mut_dot(&mut self, node: &mut Dot, __ast_path: &mut AstKindPath) {
8280 <V as VisitMutAstPath>::visit_mut_dot(&mut **self, node, __ast_path)
8281 }
8282
8283 #[inline]
8284 fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup, __ast_path: &mut AstKindPath) {
8285 <V as VisitMutAstPath>::visit_mut_ignore_group(&mut **self, node, __ast_path)
8286 }
8287
8288 #[inline]
8289 fn visit_mut_indexed_reference(
8290 &mut self,
8291 node: &mut IndexedReference,
8292 __ast_path: &mut AstKindPath,
8293 ) {
8294 <V as VisitMutAstPath>::visit_mut_indexed_reference(&mut **self, node, __ast_path)
8295 }
8296
8297 #[inline]
8298 fn visit_mut_look_around_assertion(
8299 &mut self,
8300 node: &mut LookAroundAssertion,
8301 __ast_path: &mut AstKindPath,
8302 ) {
8303 <V as VisitMutAstPath>::visit_mut_look_around_assertion(&mut **self, node, __ast_path)
8304 }
8305
8306 #[inline]
8307 fn visit_mut_look_around_assertion_kind(
8308 &mut self,
8309 node: &mut LookAroundAssertionKind,
8310 __ast_path: &mut AstKindPath,
8311 ) {
8312 <V as VisitMutAstPath>::visit_mut_look_around_assertion_kind(&mut **self, node, __ast_path)
8313 }
8314
8315 #[inline]
8316 fn visit_mut_modifier(&mut self, node: &mut Modifier, __ast_path: &mut AstKindPath) {
8317 <V as VisitMutAstPath>::visit_mut_modifier(&mut **self, node, __ast_path)
8318 }
8319
8320 #[inline]
8321 fn visit_mut_modifiers(&mut self, node: &mut Modifiers, __ast_path: &mut AstKindPath) {
8322 <V as VisitMutAstPath>::visit_mut_modifiers(&mut **self, node, __ast_path)
8323 }
8324
8325 #[inline]
8326 fn visit_mut_named_reference(
8327 &mut self,
8328 node: &mut NamedReference,
8329 __ast_path: &mut AstKindPath,
8330 ) {
8331 <V as VisitMutAstPath>::visit_mut_named_reference(&mut **self, node, __ast_path)
8332 }
8333
8334 #[inline]
8335 fn visit_mut_opt_atom(
8336 &mut self,
8337 node: &mut Option<swc_atoms::Atom>,
8338 __ast_path: &mut AstKindPath,
8339 ) {
8340 <V as VisitMutAstPath>::visit_mut_opt_atom(&mut **self, node, __ast_path)
8341 }
8342
8343 #[inline]
8344 fn visit_mut_opt_modifiers(
8345 &mut self,
8346 node: &mut Option<Modifiers>,
8347 __ast_path: &mut AstKindPath,
8348 ) {
8349 <V as VisitMutAstPath>::visit_mut_opt_modifiers(&mut **self, node, __ast_path)
8350 }
8351
8352 #[inline]
8353 fn visit_mut_pattern(&mut self, node: &mut Pattern, __ast_path: &mut AstKindPath) {
8354 <V as VisitMutAstPath>::visit_mut_pattern(&mut **self, node, __ast_path)
8355 }
8356
8357 #[inline]
8358 fn visit_mut_quantifier(&mut self, node: &mut Quantifier, __ast_path: &mut AstKindPath) {
8359 <V as VisitMutAstPath>::visit_mut_quantifier(&mut **self, node, __ast_path)
8360 }
8361
8362 #[inline]
8363 fn visit_mut_span(&mut self, node: &mut swc_common::Span, __ast_path: &mut AstKindPath) {
8364 <V as VisitMutAstPath>::visit_mut_span(&mut **self, node, __ast_path)
8365 }
8366
8367 #[inline]
8368 fn visit_mut_term(&mut self, node: &mut Term, __ast_path: &mut AstKindPath) {
8369 <V as VisitMutAstPath>::visit_mut_term(&mut **self, node, __ast_path)
8370 }
8371
8372 #[inline]
8373 fn visit_mut_terms(&mut self, node: &mut Vec<Term>, __ast_path: &mut AstKindPath) {
8374 <V as VisitMutAstPath>::visit_mut_terms(&mut **self, node, __ast_path)
8375 }
8376
8377 #[inline]
8378 fn visit_mut_unicode_property_escape(
8379 &mut self,
8380 node: &mut UnicodePropertyEscape,
8381 __ast_path: &mut AstKindPath,
8382 ) {
8383 <V as VisitMutAstPath>::visit_mut_unicode_property_escape(&mut **self, node, __ast_path)
8384 }
8385}
8386#[cfg(any(docsrs, feature = "path"))]
8387#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
8388impl<V> VisitMutAstPath for Box<V>
8389where
8390 V: ?Sized + VisitMutAstPath,
8391{
8392 #[inline]
8393 fn visit_mut_alternative(&mut self, node: &mut Alternative, __ast_path: &mut AstKindPath) {
8394 <V as VisitMutAstPath>::visit_mut_alternative(&mut **self, node, __ast_path)
8395 }
8396
8397 #[inline]
8398 fn visit_mut_alternatives(
8399 &mut self,
8400 node: &mut Vec<Alternative>,
8401 __ast_path: &mut AstKindPath,
8402 ) {
8403 <V as VisitMutAstPath>::visit_mut_alternatives(&mut **self, node, __ast_path)
8404 }
8405
8406 #[inline]
8407 fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom, __ast_path: &mut AstKindPath) {
8408 <V as VisitMutAstPath>::visit_mut_atom(&mut **self, node, __ast_path)
8409 }
8410
8411 #[inline]
8412 fn visit_mut_boundary_assertion(
8413 &mut self,
8414 node: &mut BoundaryAssertion,
8415 __ast_path: &mut AstKindPath,
8416 ) {
8417 <V as VisitMutAstPath>::visit_mut_boundary_assertion(&mut **self, node, __ast_path)
8418 }
8419
8420 #[inline]
8421 fn visit_mut_boundary_assertion_kind(
8422 &mut self,
8423 node: &mut BoundaryAssertionKind,
8424 __ast_path: &mut AstKindPath,
8425 ) {
8426 <V as VisitMutAstPath>::visit_mut_boundary_assertion_kind(&mut **self, node, __ast_path)
8427 }
8428
8429 #[inline]
8430 fn visit_mut_capturing_group(
8431 &mut self,
8432 node: &mut CapturingGroup,
8433 __ast_path: &mut AstKindPath,
8434 ) {
8435 <V as VisitMutAstPath>::visit_mut_capturing_group(&mut **self, node, __ast_path)
8436 }
8437
8438 #[inline]
8439 fn visit_mut_character(&mut self, node: &mut Character, __ast_path: &mut AstKindPath) {
8440 <V as VisitMutAstPath>::visit_mut_character(&mut **self, node, __ast_path)
8441 }
8442
8443 #[inline]
8444 fn visit_mut_character_class(
8445 &mut self,
8446 node: &mut CharacterClass,
8447 __ast_path: &mut AstKindPath,
8448 ) {
8449 <V as VisitMutAstPath>::visit_mut_character_class(&mut **self, node, __ast_path)
8450 }
8451
8452 #[inline]
8453 fn visit_mut_character_class_contents(
8454 &mut self,
8455 node: &mut CharacterClassContents,
8456 __ast_path: &mut AstKindPath,
8457 ) {
8458 <V as VisitMutAstPath>::visit_mut_character_class_contents(&mut **self, node, __ast_path)
8459 }
8460
8461 #[inline]
8462 fn visit_mut_character_class_contents_kind(
8463 &mut self,
8464 node: &mut CharacterClassContentsKind,
8465 __ast_path: &mut AstKindPath,
8466 ) {
8467 <V as VisitMutAstPath>::visit_mut_character_class_contents_kind(
8468 &mut **self,
8469 node,
8470 __ast_path,
8471 )
8472 }
8473
8474 #[inline]
8475 fn visit_mut_character_class_contentss(
8476 &mut self,
8477 node: &mut Vec<CharacterClassContents>,
8478 __ast_path: &mut AstKindPath,
8479 ) {
8480 <V as VisitMutAstPath>::visit_mut_character_class_contentss(&mut **self, node, __ast_path)
8481 }
8482
8483 #[inline]
8484 fn visit_mut_character_class_escape(
8485 &mut self,
8486 node: &mut CharacterClassEscape,
8487 __ast_path: &mut AstKindPath,
8488 ) {
8489 <V as VisitMutAstPath>::visit_mut_character_class_escape(&mut **self, node, __ast_path)
8490 }
8491
8492 #[inline]
8493 fn visit_mut_character_class_escape_kind(
8494 &mut self,
8495 node: &mut CharacterClassEscapeKind,
8496 __ast_path: &mut AstKindPath,
8497 ) {
8498 <V as VisitMutAstPath>::visit_mut_character_class_escape_kind(&mut **self, node, __ast_path)
8499 }
8500
8501 #[inline]
8502 fn visit_mut_character_class_range(
8503 &mut self,
8504 node: &mut CharacterClassRange,
8505 __ast_path: &mut AstKindPath,
8506 ) {
8507 <V as VisitMutAstPath>::visit_mut_character_class_range(&mut **self, node, __ast_path)
8508 }
8509
8510 #[inline]
8511 fn visit_mut_character_kind(&mut self, node: &mut CharacterKind, __ast_path: &mut AstKindPath) {
8512 <V as VisitMutAstPath>::visit_mut_character_kind(&mut **self, node, __ast_path)
8513 }
8514
8515 #[inline]
8516 fn visit_mut_characters(&mut self, node: &mut Vec<Character>, __ast_path: &mut AstKindPath) {
8517 <V as VisitMutAstPath>::visit_mut_characters(&mut **self, node, __ast_path)
8518 }
8519
8520 #[inline]
8521 fn visit_mut_class_string(&mut self, node: &mut ClassString, __ast_path: &mut AstKindPath) {
8522 <V as VisitMutAstPath>::visit_mut_class_string(&mut **self, node, __ast_path)
8523 }
8524
8525 #[inline]
8526 fn visit_mut_class_string_disjunction(
8527 &mut self,
8528 node: &mut ClassStringDisjunction,
8529 __ast_path: &mut AstKindPath,
8530 ) {
8531 <V as VisitMutAstPath>::visit_mut_class_string_disjunction(&mut **self, node, __ast_path)
8532 }
8533
8534 #[inline]
8535 fn visit_mut_class_strings(
8536 &mut self,
8537 node: &mut Vec<ClassString>,
8538 __ast_path: &mut AstKindPath,
8539 ) {
8540 <V as VisitMutAstPath>::visit_mut_class_strings(&mut **self, node, __ast_path)
8541 }
8542
8543 #[inline]
8544 fn visit_mut_disjunction(&mut self, node: &mut Disjunction, __ast_path: &mut AstKindPath) {
8545 <V as VisitMutAstPath>::visit_mut_disjunction(&mut **self, node, __ast_path)
8546 }
8547
8548 #[inline]
8549 fn visit_mut_dot(&mut self, node: &mut Dot, __ast_path: &mut AstKindPath) {
8550 <V as VisitMutAstPath>::visit_mut_dot(&mut **self, node, __ast_path)
8551 }
8552
8553 #[inline]
8554 fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup, __ast_path: &mut AstKindPath) {
8555 <V as VisitMutAstPath>::visit_mut_ignore_group(&mut **self, node, __ast_path)
8556 }
8557
8558 #[inline]
8559 fn visit_mut_indexed_reference(
8560 &mut self,
8561 node: &mut IndexedReference,
8562 __ast_path: &mut AstKindPath,
8563 ) {
8564 <V as VisitMutAstPath>::visit_mut_indexed_reference(&mut **self, node, __ast_path)
8565 }
8566
8567 #[inline]
8568 fn visit_mut_look_around_assertion(
8569 &mut self,
8570 node: &mut LookAroundAssertion,
8571 __ast_path: &mut AstKindPath,
8572 ) {
8573 <V as VisitMutAstPath>::visit_mut_look_around_assertion(&mut **self, node, __ast_path)
8574 }
8575
8576 #[inline]
8577 fn visit_mut_look_around_assertion_kind(
8578 &mut self,
8579 node: &mut LookAroundAssertionKind,
8580 __ast_path: &mut AstKindPath,
8581 ) {
8582 <V as VisitMutAstPath>::visit_mut_look_around_assertion_kind(&mut **self, node, __ast_path)
8583 }
8584
8585 #[inline]
8586 fn visit_mut_modifier(&mut self, node: &mut Modifier, __ast_path: &mut AstKindPath) {
8587 <V as VisitMutAstPath>::visit_mut_modifier(&mut **self, node, __ast_path)
8588 }
8589
8590 #[inline]
8591 fn visit_mut_modifiers(&mut self, node: &mut Modifiers, __ast_path: &mut AstKindPath) {
8592 <V as VisitMutAstPath>::visit_mut_modifiers(&mut **self, node, __ast_path)
8593 }
8594
8595 #[inline]
8596 fn visit_mut_named_reference(
8597 &mut self,
8598 node: &mut NamedReference,
8599 __ast_path: &mut AstKindPath,
8600 ) {
8601 <V as VisitMutAstPath>::visit_mut_named_reference(&mut **self, node, __ast_path)
8602 }
8603
8604 #[inline]
8605 fn visit_mut_opt_atom(
8606 &mut self,
8607 node: &mut Option<swc_atoms::Atom>,
8608 __ast_path: &mut AstKindPath,
8609 ) {
8610 <V as VisitMutAstPath>::visit_mut_opt_atom(&mut **self, node, __ast_path)
8611 }
8612
8613 #[inline]
8614 fn visit_mut_opt_modifiers(
8615 &mut self,
8616 node: &mut Option<Modifiers>,
8617 __ast_path: &mut AstKindPath,
8618 ) {
8619 <V as VisitMutAstPath>::visit_mut_opt_modifiers(&mut **self, node, __ast_path)
8620 }
8621
8622 #[inline]
8623 fn visit_mut_pattern(&mut self, node: &mut Pattern, __ast_path: &mut AstKindPath) {
8624 <V as VisitMutAstPath>::visit_mut_pattern(&mut **self, node, __ast_path)
8625 }
8626
8627 #[inline]
8628 fn visit_mut_quantifier(&mut self, node: &mut Quantifier, __ast_path: &mut AstKindPath) {
8629 <V as VisitMutAstPath>::visit_mut_quantifier(&mut **self, node, __ast_path)
8630 }
8631
8632 #[inline]
8633 fn visit_mut_span(&mut self, node: &mut swc_common::Span, __ast_path: &mut AstKindPath) {
8634 <V as VisitMutAstPath>::visit_mut_span(&mut **self, node, __ast_path)
8635 }
8636
8637 #[inline]
8638 fn visit_mut_term(&mut self, node: &mut Term, __ast_path: &mut AstKindPath) {
8639 <V as VisitMutAstPath>::visit_mut_term(&mut **self, node, __ast_path)
8640 }
8641
8642 #[inline]
8643 fn visit_mut_terms(&mut self, node: &mut Vec<Term>, __ast_path: &mut AstKindPath) {
8644 <V as VisitMutAstPath>::visit_mut_terms(&mut **self, node, __ast_path)
8645 }
8646
8647 #[inline]
8648 fn visit_mut_unicode_property_escape(
8649 &mut self,
8650 node: &mut UnicodePropertyEscape,
8651 __ast_path: &mut AstKindPath,
8652 ) {
8653 <V as VisitMutAstPath>::visit_mut_unicode_property_escape(&mut **self, node, __ast_path)
8654 }
8655}
8656#[cfg(any(docsrs, feature = "path"))]
8657#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
8658impl<A, B> VisitMutAstPath for ::swc_visit::Either<A, B>
8659where
8660 A: VisitMutAstPath,
8661 B: VisitMutAstPath,
8662{
8663 #[inline]
8664 fn visit_mut_alternative(&mut self, node: &mut Alternative, __ast_path: &mut AstKindPath) {
8665 match self {
8666 swc_visit::Either::Left(visitor) => {
8667 VisitMutAstPath::visit_mut_alternative(visitor, node, __ast_path)
8668 }
8669 swc_visit::Either::Right(visitor) => {
8670 VisitMutAstPath::visit_mut_alternative(visitor, node, __ast_path)
8671 }
8672 }
8673 }
8674
8675 #[inline]
8676 fn visit_mut_alternatives(
8677 &mut self,
8678 node: &mut Vec<Alternative>,
8679 __ast_path: &mut AstKindPath,
8680 ) {
8681 match self {
8682 swc_visit::Either::Left(visitor) => {
8683 VisitMutAstPath::visit_mut_alternatives(visitor, node, __ast_path)
8684 }
8685 swc_visit::Either::Right(visitor) => {
8686 VisitMutAstPath::visit_mut_alternatives(visitor, node, __ast_path)
8687 }
8688 }
8689 }
8690
8691 #[inline]
8692 fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom, __ast_path: &mut AstKindPath) {
8693 match self {
8694 swc_visit::Either::Left(visitor) => {
8695 VisitMutAstPath::visit_mut_atom(visitor, node, __ast_path)
8696 }
8697 swc_visit::Either::Right(visitor) => {
8698 VisitMutAstPath::visit_mut_atom(visitor, node, __ast_path)
8699 }
8700 }
8701 }
8702
8703 #[inline]
8704 fn visit_mut_boundary_assertion(
8705 &mut self,
8706 node: &mut BoundaryAssertion,
8707 __ast_path: &mut AstKindPath,
8708 ) {
8709 match self {
8710 swc_visit::Either::Left(visitor) => {
8711 VisitMutAstPath::visit_mut_boundary_assertion(visitor, node, __ast_path)
8712 }
8713 swc_visit::Either::Right(visitor) => {
8714 VisitMutAstPath::visit_mut_boundary_assertion(visitor, node, __ast_path)
8715 }
8716 }
8717 }
8718
8719 #[inline]
8720 fn visit_mut_boundary_assertion_kind(
8721 &mut self,
8722 node: &mut BoundaryAssertionKind,
8723 __ast_path: &mut AstKindPath,
8724 ) {
8725 match self {
8726 swc_visit::Either::Left(visitor) => {
8727 VisitMutAstPath::visit_mut_boundary_assertion_kind(visitor, node, __ast_path)
8728 }
8729 swc_visit::Either::Right(visitor) => {
8730 VisitMutAstPath::visit_mut_boundary_assertion_kind(visitor, node, __ast_path)
8731 }
8732 }
8733 }
8734
8735 #[inline]
8736 fn visit_mut_capturing_group(
8737 &mut self,
8738 node: &mut CapturingGroup,
8739 __ast_path: &mut AstKindPath,
8740 ) {
8741 match self {
8742 swc_visit::Either::Left(visitor) => {
8743 VisitMutAstPath::visit_mut_capturing_group(visitor, node, __ast_path)
8744 }
8745 swc_visit::Either::Right(visitor) => {
8746 VisitMutAstPath::visit_mut_capturing_group(visitor, node, __ast_path)
8747 }
8748 }
8749 }
8750
8751 #[inline]
8752 fn visit_mut_character(&mut self, node: &mut Character, __ast_path: &mut AstKindPath) {
8753 match self {
8754 swc_visit::Either::Left(visitor) => {
8755 VisitMutAstPath::visit_mut_character(visitor, node, __ast_path)
8756 }
8757 swc_visit::Either::Right(visitor) => {
8758 VisitMutAstPath::visit_mut_character(visitor, node, __ast_path)
8759 }
8760 }
8761 }
8762
8763 #[inline]
8764 fn visit_mut_character_class(
8765 &mut self,
8766 node: &mut CharacterClass,
8767 __ast_path: &mut AstKindPath,
8768 ) {
8769 match self {
8770 swc_visit::Either::Left(visitor) => {
8771 VisitMutAstPath::visit_mut_character_class(visitor, node, __ast_path)
8772 }
8773 swc_visit::Either::Right(visitor) => {
8774 VisitMutAstPath::visit_mut_character_class(visitor, node, __ast_path)
8775 }
8776 }
8777 }
8778
8779 #[inline]
8780 fn visit_mut_character_class_contents(
8781 &mut self,
8782 node: &mut CharacterClassContents,
8783 __ast_path: &mut AstKindPath,
8784 ) {
8785 match self {
8786 swc_visit::Either::Left(visitor) => {
8787 VisitMutAstPath::visit_mut_character_class_contents(visitor, node, __ast_path)
8788 }
8789 swc_visit::Either::Right(visitor) => {
8790 VisitMutAstPath::visit_mut_character_class_contents(visitor, node, __ast_path)
8791 }
8792 }
8793 }
8794
8795 #[inline]
8796 fn visit_mut_character_class_contents_kind(
8797 &mut self,
8798 node: &mut CharacterClassContentsKind,
8799 __ast_path: &mut AstKindPath,
8800 ) {
8801 match self {
8802 swc_visit::Either::Left(visitor) => {
8803 VisitMutAstPath::visit_mut_character_class_contents_kind(visitor, node, __ast_path)
8804 }
8805 swc_visit::Either::Right(visitor) => {
8806 VisitMutAstPath::visit_mut_character_class_contents_kind(visitor, node, __ast_path)
8807 }
8808 }
8809 }
8810
8811 #[inline]
8812 fn visit_mut_character_class_contentss(
8813 &mut self,
8814 node: &mut Vec<CharacterClassContents>,
8815 __ast_path: &mut AstKindPath,
8816 ) {
8817 match self {
8818 swc_visit::Either::Left(visitor) => {
8819 VisitMutAstPath::visit_mut_character_class_contentss(visitor, node, __ast_path)
8820 }
8821 swc_visit::Either::Right(visitor) => {
8822 VisitMutAstPath::visit_mut_character_class_contentss(visitor, node, __ast_path)
8823 }
8824 }
8825 }
8826
8827 #[inline]
8828 fn visit_mut_character_class_escape(
8829 &mut self,
8830 node: &mut CharacterClassEscape,
8831 __ast_path: &mut AstKindPath,
8832 ) {
8833 match self {
8834 swc_visit::Either::Left(visitor) => {
8835 VisitMutAstPath::visit_mut_character_class_escape(visitor, node, __ast_path)
8836 }
8837 swc_visit::Either::Right(visitor) => {
8838 VisitMutAstPath::visit_mut_character_class_escape(visitor, node, __ast_path)
8839 }
8840 }
8841 }
8842
8843 #[inline]
8844 fn visit_mut_character_class_escape_kind(
8845 &mut self,
8846 node: &mut CharacterClassEscapeKind,
8847 __ast_path: &mut AstKindPath,
8848 ) {
8849 match self {
8850 swc_visit::Either::Left(visitor) => {
8851 VisitMutAstPath::visit_mut_character_class_escape_kind(visitor, node, __ast_path)
8852 }
8853 swc_visit::Either::Right(visitor) => {
8854 VisitMutAstPath::visit_mut_character_class_escape_kind(visitor, node, __ast_path)
8855 }
8856 }
8857 }
8858
8859 #[inline]
8860 fn visit_mut_character_class_range(
8861 &mut self,
8862 node: &mut CharacterClassRange,
8863 __ast_path: &mut AstKindPath,
8864 ) {
8865 match self {
8866 swc_visit::Either::Left(visitor) => {
8867 VisitMutAstPath::visit_mut_character_class_range(visitor, node, __ast_path)
8868 }
8869 swc_visit::Either::Right(visitor) => {
8870 VisitMutAstPath::visit_mut_character_class_range(visitor, node, __ast_path)
8871 }
8872 }
8873 }
8874
8875 #[inline]
8876 fn visit_mut_character_kind(&mut self, node: &mut CharacterKind, __ast_path: &mut AstKindPath) {
8877 match self {
8878 swc_visit::Either::Left(visitor) => {
8879 VisitMutAstPath::visit_mut_character_kind(visitor, node, __ast_path)
8880 }
8881 swc_visit::Either::Right(visitor) => {
8882 VisitMutAstPath::visit_mut_character_kind(visitor, node, __ast_path)
8883 }
8884 }
8885 }
8886
8887 #[inline]
8888 fn visit_mut_characters(&mut self, node: &mut Vec<Character>, __ast_path: &mut AstKindPath) {
8889 match self {
8890 swc_visit::Either::Left(visitor) => {
8891 VisitMutAstPath::visit_mut_characters(visitor, node, __ast_path)
8892 }
8893 swc_visit::Either::Right(visitor) => {
8894 VisitMutAstPath::visit_mut_characters(visitor, node, __ast_path)
8895 }
8896 }
8897 }
8898
8899 #[inline]
8900 fn visit_mut_class_string(&mut self, node: &mut ClassString, __ast_path: &mut AstKindPath) {
8901 match self {
8902 swc_visit::Either::Left(visitor) => {
8903 VisitMutAstPath::visit_mut_class_string(visitor, node, __ast_path)
8904 }
8905 swc_visit::Either::Right(visitor) => {
8906 VisitMutAstPath::visit_mut_class_string(visitor, node, __ast_path)
8907 }
8908 }
8909 }
8910
8911 #[inline]
8912 fn visit_mut_class_string_disjunction(
8913 &mut self,
8914 node: &mut ClassStringDisjunction,
8915 __ast_path: &mut AstKindPath,
8916 ) {
8917 match self {
8918 swc_visit::Either::Left(visitor) => {
8919 VisitMutAstPath::visit_mut_class_string_disjunction(visitor, node, __ast_path)
8920 }
8921 swc_visit::Either::Right(visitor) => {
8922 VisitMutAstPath::visit_mut_class_string_disjunction(visitor, node, __ast_path)
8923 }
8924 }
8925 }
8926
8927 #[inline]
8928 fn visit_mut_class_strings(
8929 &mut self,
8930 node: &mut Vec<ClassString>,
8931 __ast_path: &mut AstKindPath,
8932 ) {
8933 match self {
8934 swc_visit::Either::Left(visitor) => {
8935 VisitMutAstPath::visit_mut_class_strings(visitor, node, __ast_path)
8936 }
8937 swc_visit::Either::Right(visitor) => {
8938 VisitMutAstPath::visit_mut_class_strings(visitor, node, __ast_path)
8939 }
8940 }
8941 }
8942
8943 #[inline]
8944 fn visit_mut_disjunction(&mut self, node: &mut Disjunction, __ast_path: &mut AstKindPath) {
8945 match self {
8946 swc_visit::Either::Left(visitor) => {
8947 VisitMutAstPath::visit_mut_disjunction(visitor, node, __ast_path)
8948 }
8949 swc_visit::Either::Right(visitor) => {
8950 VisitMutAstPath::visit_mut_disjunction(visitor, node, __ast_path)
8951 }
8952 }
8953 }
8954
8955 #[inline]
8956 fn visit_mut_dot(&mut self, node: &mut Dot, __ast_path: &mut AstKindPath) {
8957 match self {
8958 swc_visit::Either::Left(visitor) => {
8959 VisitMutAstPath::visit_mut_dot(visitor, node, __ast_path)
8960 }
8961 swc_visit::Either::Right(visitor) => {
8962 VisitMutAstPath::visit_mut_dot(visitor, node, __ast_path)
8963 }
8964 }
8965 }
8966
8967 #[inline]
8968 fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup, __ast_path: &mut AstKindPath) {
8969 match self {
8970 swc_visit::Either::Left(visitor) => {
8971 VisitMutAstPath::visit_mut_ignore_group(visitor, node, __ast_path)
8972 }
8973 swc_visit::Either::Right(visitor) => {
8974 VisitMutAstPath::visit_mut_ignore_group(visitor, node, __ast_path)
8975 }
8976 }
8977 }
8978
8979 #[inline]
8980 fn visit_mut_indexed_reference(
8981 &mut self,
8982 node: &mut IndexedReference,
8983 __ast_path: &mut AstKindPath,
8984 ) {
8985 match self {
8986 swc_visit::Either::Left(visitor) => {
8987 VisitMutAstPath::visit_mut_indexed_reference(visitor, node, __ast_path)
8988 }
8989 swc_visit::Either::Right(visitor) => {
8990 VisitMutAstPath::visit_mut_indexed_reference(visitor, node, __ast_path)
8991 }
8992 }
8993 }
8994
8995 #[inline]
8996 fn visit_mut_look_around_assertion(
8997 &mut self,
8998 node: &mut LookAroundAssertion,
8999 __ast_path: &mut AstKindPath,
9000 ) {
9001 match self {
9002 swc_visit::Either::Left(visitor) => {
9003 VisitMutAstPath::visit_mut_look_around_assertion(visitor, node, __ast_path)
9004 }
9005 swc_visit::Either::Right(visitor) => {
9006 VisitMutAstPath::visit_mut_look_around_assertion(visitor, node, __ast_path)
9007 }
9008 }
9009 }
9010
9011 #[inline]
9012 fn visit_mut_look_around_assertion_kind(
9013 &mut self,
9014 node: &mut LookAroundAssertionKind,
9015 __ast_path: &mut AstKindPath,
9016 ) {
9017 match self {
9018 swc_visit::Either::Left(visitor) => {
9019 VisitMutAstPath::visit_mut_look_around_assertion_kind(visitor, node, __ast_path)
9020 }
9021 swc_visit::Either::Right(visitor) => {
9022 VisitMutAstPath::visit_mut_look_around_assertion_kind(visitor, node, __ast_path)
9023 }
9024 }
9025 }
9026
9027 #[inline]
9028 fn visit_mut_modifier(&mut self, node: &mut Modifier, __ast_path: &mut AstKindPath) {
9029 match self {
9030 swc_visit::Either::Left(visitor) => {
9031 VisitMutAstPath::visit_mut_modifier(visitor, node, __ast_path)
9032 }
9033 swc_visit::Either::Right(visitor) => {
9034 VisitMutAstPath::visit_mut_modifier(visitor, node, __ast_path)
9035 }
9036 }
9037 }
9038
9039 #[inline]
9040 fn visit_mut_modifiers(&mut self, node: &mut Modifiers, __ast_path: &mut AstKindPath) {
9041 match self {
9042 swc_visit::Either::Left(visitor) => {
9043 VisitMutAstPath::visit_mut_modifiers(visitor, node, __ast_path)
9044 }
9045 swc_visit::Either::Right(visitor) => {
9046 VisitMutAstPath::visit_mut_modifiers(visitor, node, __ast_path)
9047 }
9048 }
9049 }
9050
9051 #[inline]
9052 fn visit_mut_named_reference(
9053 &mut self,
9054 node: &mut NamedReference,
9055 __ast_path: &mut AstKindPath,
9056 ) {
9057 match self {
9058 swc_visit::Either::Left(visitor) => {
9059 VisitMutAstPath::visit_mut_named_reference(visitor, node, __ast_path)
9060 }
9061 swc_visit::Either::Right(visitor) => {
9062 VisitMutAstPath::visit_mut_named_reference(visitor, node, __ast_path)
9063 }
9064 }
9065 }
9066
9067 #[inline]
9068 fn visit_mut_opt_atom(
9069 &mut self,
9070 node: &mut Option<swc_atoms::Atom>,
9071 __ast_path: &mut AstKindPath,
9072 ) {
9073 match self {
9074 swc_visit::Either::Left(visitor) => {
9075 VisitMutAstPath::visit_mut_opt_atom(visitor, node, __ast_path)
9076 }
9077 swc_visit::Either::Right(visitor) => {
9078 VisitMutAstPath::visit_mut_opt_atom(visitor, node, __ast_path)
9079 }
9080 }
9081 }
9082
9083 #[inline]
9084 fn visit_mut_opt_modifiers(
9085 &mut self,
9086 node: &mut Option<Modifiers>,
9087 __ast_path: &mut AstKindPath,
9088 ) {
9089 match self {
9090 swc_visit::Either::Left(visitor) => {
9091 VisitMutAstPath::visit_mut_opt_modifiers(visitor, node, __ast_path)
9092 }
9093 swc_visit::Either::Right(visitor) => {
9094 VisitMutAstPath::visit_mut_opt_modifiers(visitor, node, __ast_path)
9095 }
9096 }
9097 }
9098
9099 #[inline]
9100 fn visit_mut_pattern(&mut self, node: &mut Pattern, __ast_path: &mut AstKindPath) {
9101 match self {
9102 swc_visit::Either::Left(visitor) => {
9103 VisitMutAstPath::visit_mut_pattern(visitor, node, __ast_path)
9104 }
9105 swc_visit::Either::Right(visitor) => {
9106 VisitMutAstPath::visit_mut_pattern(visitor, node, __ast_path)
9107 }
9108 }
9109 }
9110
9111 #[inline]
9112 fn visit_mut_quantifier(&mut self, node: &mut Quantifier, __ast_path: &mut AstKindPath) {
9113 match self {
9114 swc_visit::Either::Left(visitor) => {
9115 VisitMutAstPath::visit_mut_quantifier(visitor, node, __ast_path)
9116 }
9117 swc_visit::Either::Right(visitor) => {
9118 VisitMutAstPath::visit_mut_quantifier(visitor, node, __ast_path)
9119 }
9120 }
9121 }
9122
9123 #[inline]
9124 fn visit_mut_span(&mut self, node: &mut swc_common::Span, __ast_path: &mut AstKindPath) {
9125 match self {
9126 swc_visit::Either::Left(visitor) => {
9127 VisitMutAstPath::visit_mut_span(visitor, node, __ast_path)
9128 }
9129 swc_visit::Either::Right(visitor) => {
9130 VisitMutAstPath::visit_mut_span(visitor, node, __ast_path)
9131 }
9132 }
9133 }
9134
9135 #[inline]
9136 fn visit_mut_term(&mut self, node: &mut Term, __ast_path: &mut AstKindPath) {
9137 match self {
9138 swc_visit::Either::Left(visitor) => {
9139 VisitMutAstPath::visit_mut_term(visitor, node, __ast_path)
9140 }
9141 swc_visit::Either::Right(visitor) => {
9142 VisitMutAstPath::visit_mut_term(visitor, node, __ast_path)
9143 }
9144 }
9145 }
9146
9147 #[inline]
9148 fn visit_mut_terms(&mut self, node: &mut Vec<Term>, __ast_path: &mut AstKindPath) {
9149 match self {
9150 swc_visit::Either::Left(visitor) => {
9151 VisitMutAstPath::visit_mut_terms(visitor, node, __ast_path)
9152 }
9153 swc_visit::Either::Right(visitor) => {
9154 VisitMutAstPath::visit_mut_terms(visitor, node, __ast_path)
9155 }
9156 }
9157 }
9158
9159 #[inline]
9160 fn visit_mut_unicode_property_escape(
9161 &mut self,
9162 node: &mut UnicodePropertyEscape,
9163 __ast_path: &mut AstKindPath,
9164 ) {
9165 match self {
9166 swc_visit::Either::Left(visitor) => {
9167 VisitMutAstPath::visit_mut_unicode_property_escape(visitor, node, __ast_path)
9168 }
9169 swc_visit::Either::Right(visitor) => {
9170 VisitMutAstPath::visit_mut_unicode_property_escape(visitor, node, __ast_path)
9171 }
9172 }
9173 }
9174}
9175#[cfg(any(docsrs, feature = "path"))]
9176#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
9177impl<V> VisitMutAstPath for ::swc_visit::Optional<V>
9178where
9179 V: VisitMutAstPath,
9180{
9181 #[inline]
9182 fn visit_mut_alternative(&mut self, node: &mut Alternative, __ast_path: &mut AstKindPath) {
9183 if self.enabled {
9184 <V as VisitMutAstPath>::visit_mut_alternative(&mut self.visitor, node, __ast_path)
9185 } else {
9186 }
9187 }
9188
9189 #[inline]
9190 fn visit_mut_alternatives(
9191 &mut self,
9192 node: &mut Vec<Alternative>,
9193 __ast_path: &mut AstKindPath,
9194 ) {
9195 if self.enabled {
9196 <V as VisitMutAstPath>::visit_mut_alternatives(&mut self.visitor, node, __ast_path)
9197 } else {
9198 }
9199 }
9200
9201 #[inline]
9202 fn visit_mut_atom(&mut self, node: &mut swc_atoms::Atom, __ast_path: &mut AstKindPath) {
9203 if self.enabled {
9204 <V as VisitMutAstPath>::visit_mut_atom(&mut self.visitor, node, __ast_path)
9205 } else {
9206 }
9207 }
9208
9209 #[inline]
9210 fn visit_mut_boundary_assertion(
9211 &mut self,
9212 node: &mut BoundaryAssertion,
9213 __ast_path: &mut AstKindPath,
9214 ) {
9215 if self.enabled {
9216 <V as VisitMutAstPath>::visit_mut_boundary_assertion(
9217 &mut self.visitor,
9218 node,
9219 __ast_path,
9220 )
9221 } else {
9222 }
9223 }
9224
9225 #[inline]
9226 fn visit_mut_boundary_assertion_kind(
9227 &mut self,
9228 node: &mut BoundaryAssertionKind,
9229 __ast_path: &mut AstKindPath,
9230 ) {
9231 if self.enabled {
9232 <V as VisitMutAstPath>::visit_mut_boundary_assertion_kind(
9233 &mut self.visitor,
9234 node,
9235 __ast_path,
9236 )
9237 } else {
9238 }
9239 }
9240
9241 #[inline]
9242 fn visit_mut_capturing_group(
9243 &mut self,
9244 node: &mut CapturingGroup,
9245 __ast_path: &mut AstKindPath,
9246 ) {
9247 if self.enabled {
9248 <V as VisitMutAstPath>::visit_mut_capturing_group(&mut self.visitor, node, __ast_path)
9249 } else {
9250 }
9251 }
9252
9253 #[inline]
9254 fn visit_mut_character(&mut self, node: &mut Character, __ast_path: &mut AstKindPath) {
9255 if self.enabled {
9256 <V as VisitMutAstPath>::visit_mut_character(&mut self.visitor, node, __ast_path)
9257 } else {
9258 }
9259 }
9260
9261 #[inline]
9262 fn visit_mut_character_class(
9263 &mut self,
9264 node: &mut CharacterClass,
9265 __ast_path: &mut AstKindPath,
9266 ) {
9267 if self.enabled {
9268 <V as VisitMutAstPath>::visit_mut_character_class(&mut self.visitor, node, __ast_path)
9269 } else {
9270 }
9271 }
9272
9273 #[inline]
9274 fn visit_mut_character_class_contents(
9275 &mut self,
9276 node: &mut CharacterClassContents,
9277 __ast_path: &mut AstKindPath,
9278 ) {
9279 if self.enabled {
9280 <V as VisitMutAstPath>::visit_mut_character_class_contents(
9281 &mut self.visitor,
9282 node,
9283 __ast_path,
9284 )
9285 } else {
9286 }
9287 }
9288
9289 #[inline]
9290 fn visit_mut_character_class_contents_kind(
9291 &mut self,
9292 node: &mut CharacterClassContentsKind,
9293 __ast_path: &mut AstKindPath,
9294 ) {
9295 if self.enabled {
9296 <V as VisitMutAstPath>::visit_mut_character_class_contents_kind(
9297 &mut self.visitor,
9298 node,
9299 __ast_path,
9300 )
9301 } else {
9302 }
9303 }
9304
9305 #[inline]
9306 fn visit_mut_character_class_contentss(
9307 &mut self,
9308 node: &mut Vec<CharacterClassContents>,
9309 __ast_path: &mut AstKindPath,
9310 ) {
9311 if self.enabled {
9312 <V as VisitMutAstPath>::visit_mut_character_class_contentss(
9313 &mut self.visitor,
9314 node,
9315 __ast_path,
9316 )
9317 } else {
9318 }
9319 }
9320
9321 #[inline]
9322 fn visit_mut_character_class_escape(
9323 &mut self,
9324 node: &mut CharacterClassEscape,
9325 __ast_path: &mut AstKindPath,
9326 ) {
9327 if self.enabled {
9328 <V as VisitMutAstPath>::visit_mut_character_class_escape(
9329 &mut self.visitor,
9330 node,
9331 __ast_path,
9332 )
9333 } else {
9334 }
9335 }
9336
9337 #[inline]
9338 fn visit_mut_character_class_escape_kind(
9339 &mut self,
9340 node: &mut CharacterClassEscapeKind,
9341 __ast_path: &mut AstKindPath,
9342 ) {
9343 if self.enabled {
9344 <V as VisitMutAstPath>::visit_mut_character_class_escape_kind(
9345 &mut self.visitor,
9346 node,
9347 __ast_path,
9348 )
9349 } else {
9350 }
9351 }
9352
9353 #[inline]
9354 fn visit_mut_character_class_range(
9355 &mut self,
9356 node: &mut CharacterClassRange,
9357 __ast_path: &mut AstKindPath,
9358 ) {
9359 if self.enabled {
9360 <V as VisitMutAstPath>::visit_mut_character_class_range(
9361 &mut self.visitor,
9362 node,
9363 __ast_path,
9364 )
9365 } else {
9366 }
9367 }
9368
9369 #[inline]
9370 fn visit_mut_character_kind(&mut self, node: &mut CharacterKind, __ast_path: &mut AstKindPath) {
9371 if self.enabled {
9372 <V as VisitMutAstPath>::visit_mut_character_kind(&mut self.visitor, node, __ast_path)
9373 } else {
9374 }
9375 }
9376
9377 #[inline]
9378 fn visit_mut_characters(&mut self, node: &mut Vec<Character>, __ast_path: &mut AstKindPath) {
9379 if self.enabled {
9380 <V as VisitMutAstPath>::visit_mut_characters(&mut self.visitor, node, __ast_path)
9381 } else {
9382 }
9383 }
9384
9385 #[inline]
9386 fn visit_mut_class_string(&mut self, node: &mut ClassString, __ast_path: &mut AstKindPath) {
9387 if self.enabled {
9388 <V as VisitMutAstPath>::visit_mut_class_string(&mut self.visitor, node, __ast_path)
9389 } else {
9390 }
9391 }
9392
9393 #[inline]
9394 fn visit_mut_class_string_disjunction(
9395 &mut self,
9396 node: &mut ClassStringDisjunction,
9397 __ast_path: &mut AstKindPath,
9398 ) {
9399 if self.enabled {
9400 <V as VisitMutAstPath>::visit_mut_class_string_disjunction(
9401 &mut self.visitor,
9402 node,
9403 __ast_path,
9404 )
9405 } else {
9406 }
9407 }
9408
9409 #[inline]
9410 fn visit_mut_class_strings(
9411 &mut self,
9412 node: &mut Vec<ClassString>,
9413 __ast_path: &mut AstKindPath,
9414 ) {
9415 if self.enabled {
9416 <V as VisitMutAstPath>::visit_mut_class_strings(&mut self.visitor, node, __ast_path)
9417 } else {
9418 }
9419 }
9420
9421 #[inline]
9422 fn visit_mut_disjunction(&mut self, node: &mut Disjunction, __ast_path: &mut AstKindPath) {
9423 if self.enabled {
9424 <V as VisitMutAstPath>::visit_mut_disjunction(&mut self.visitor, node, __ast_path)
9425 } else {
9426 }
9427 }
9428
9429 #[inline]
9430 fn visit_mut_dot(&mut self, node: &mut Dot, __ast_path: &mut AstKindPath) {
9431 if self.enabled {
9432 <V as VisitMutAstPath>::visit_mut_dot(&mut self.visitor, node, __ast_path)
9433 } else {
9434 }
9435 }
9436
9437 #[inline]
9438 fn visit_mut_ignore_group(&mut self, node: &mut IgnoreGroup, __ast_path: &mut AstKindPath) {
9439 if self.enabled {
9440 <V as VisitMutAstPath>::visit_mut_ignore_group(&mut self.visitor, node, __ast_path)
9441 } else {
9442 }
9443 }
9444
9445 #[inline]
9446 fn visit_mut_indexed_reference(
9447 &mut self,
9448 node: &mut IndexedReference,
9449 __ast_path: &mut AstKindPath,
9450 ) {
9451 if self.enabled {
9452 <V as VisitMutAstPath>::visit_mut_indexed_reference(&mut self.visitor, node, __ast_path)
9453 } else {
9454 }
9455 }
9456
9457 #[inline]
9458 fn visit_mut_look_around_assertion(
9459 &mut self,
9460 node: &mut LookAroundAssertion,
9461 __ast_path: &mut AstKindPath,
9462 ) {
9463 if self.enabled {
9464 <V as VisitMutAstPath>::visit_mut_look_around_assertion(
9465 &mut self.visitor,
9466 node,
9467 __ast_path,
9468 )
9469 } else {
9470 }
9471 }
9472
9473 #[inline]
9474 fn visit_mut_look_around_assertion_kind(
9475 &mut self,
9476 node: &mut LookAroundAssertionKind,
9477 __ast_path: &mut AstKindPath,
9478 ) {
9479 if self.enabled {
9480 <V as VisitMutAstPath>::visit_mut_look_around_assertion_kind(
9481 &mut self.visitor,
9482 node,
9483 __ast_path,
9484 )
9485 } else {
9486 }
9487 }
9488
9489 #[inline]
9490 fn visit_mut_modifier(&mut self, node: &mut Modifier, __ast_path: &mut AstKindPath) {
9491 if self.enabled {
9492 <V as VisitMutAstPath>::visit_mut_modifier(&mut self.visitor, node, __ast_path)
9493 } else {
9494 }
9495 }
9496
9497 #[inline]
9498 fn visit_mut_modifiers(&mut self, node: &mut Modifiers, __ast_path: &mut AstKindPath) {
9499 if self.enabled {
9500 <V as VisitMutAstPath>::visit_mut_modifiers(&mut self.visitor, node, __ast_path)
9501 } else {
9502 }
9503 }
9504
9505 #[inline]
9506 fn visit_mut_named_reference(
9507 &mut self,
9508 node: &mut NamedReference,
9509 __ast_path: &mut AstKindPath,
9510 ) {
9511 if self.enabled {
9512 <V as VisitMutAstPath>::visit_mut_named_reference(&mut self.visitor, node, __ast_path)
9513 } else {
9514 }
9515 }
9516
9517 #[inline]
9518 fn visit_mut_opt_atom(
9519 &mut self,
9520 node: &mut Option<swc_atoms::Atom>,
9521 __ast_path: &mut AstKindPath,
9522 ) {
9523 if self.enabled {
9524 <V as VisitMutAstPath>::visit_mut_opt_atom(&mut self.visitor, node, __ast_path)
9525 } else {
9526 }
9527 }
9528
9529 #[inline]
9530 fn visit_mut_opt_modifiers(
9531 &mut self,
9532 node: &mut Option<Modifiers>,
9533 __ast_path: &mut AstKindPath,
9534 ) {
9535 if self.enabled {
9536 <V as VisitMutAstPath>::visit_mut_opt_modifiers(&mut self.visitor, node, __ast_path)
9537 } else {
9538 }
9539 }
9540
9541 #[inline]
9542 fn visit_mut_pattern(&mut self, node: &mut Pattern, __ast_path: &mut AstKindPath) {
9543 if self.enabled {
9544 <V as VisitMutAstPath>::visit_mut_pattern(&mut self.visitor, node, __ast_path)
9545 } else {
9546 }
9547 }
9548
9549 #[inline]
9550 fn visit_mut_quantifier(&mut self, node: &mut Quantifier, __ast_path: &mut AstKindPath) {
9551 if self.enabled {
9552 <V as VisitMutAstPath>::visit_mut_quantifier(&mut self.visitor, node, __ast_path)
9553 } else {
9554 }
9555 }
9556
9557 #[inline]
9558 fn visit_mut_span(&mut self, node: &mut swc_common::Span, __ast_path: &mut AstKindPath) {
9559 if self.enabled {
9560 <V as VisitMutAstPath>::visit_mut_span(&mut self.visitor, node, __ast_path)
9561 } else {
9562 }
9563 }
9564
9565 #[inline]
9566 fn visit_mut_term(&mut self, node: &mut Term, __ast_path: &mut AstKindPath) {
9567 if self.enabled {
9568 <V as VisitMutAstPath>::visit_mut_term(&mut self.visitor, node, __ast_path)
9569 } else {
9570 }
9571 }
9572
9573 #[inline]
9574 fn visit_mut_terms(&mut self, node: &mut Vec<Term>, __ast_path: &mut AstKindPath) {
9575 if self.enabled {
9576 <V as VisitMutAstPath>::visit_mut_terms(&mut self.visitor, node, __ast_path)
9577 } else {
9578 }
9579 }
9580
9581 #[inline]
9582 fn visit_mut_unicode_property_escape(
9583 &mut self,
9584 node: &mut UnicodePropertyEscape,
9585 __ast_path: &mut AstKindPath,
9586 ) {
9587 if self.enabled {
9588 <V as VisitMutAstPath>::visit_mut_unicode_property_escape(
9589 &mut self.visitor,
9590 node,
9591 __ast_path,
9592 )
9593 } else {
9594 }
9595 }
9596}
9597#[doc = r" A trait implemented for types that can be visited using a visitor."]
9598#[cfg(any(docsrs, feature = "path"))]
9599#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
9600pub trait VisitMutWithAstPath<V: ?Sized + VisitMutAstPath> {
9601 #[doc = r" Calls a visitor method (visitor.fold_xxx) with self."]
9602 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath);
9603 #[doc = r" Visit children nodes of `self`` with `visitor`."]
9604 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath);
9605}
9606#[cfg(any(docsrs, feature = "path"))]
9607#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
9608impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for Alternative {
9609 #[doc = "Calls [VisitMutAstPath`::visit_mut_alternative`] with `self`."]
9610 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9611 <V as VisitMutAstPath>::visit_mut_alternative(visitor, self, __ast_path)
9612 }
9613
9614 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9615 match self {
9616 Alternative { span, body } => {
9617 {
9618 let mut __ast_path = __ast_path.with_guard(AstParentKind::Alternative(
9619 self::fields::AlternativeField::Span,
9620 ));
9621 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9622 span,
9623 visitor,
9624 &mut *__ast_path,
9625 )
9626 };
9627 {
9628 let mut __ast_path = __ast_path.with_guard(AstParentKind::Alternative(
9629 self::fields::AlternativeField::Body(usize::MAX),
9630 ));
9631 <Vec<Term> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9632 body,
9633 visitor,
9634 &mut *__ast_path,
9635 )
9636 };
9637 }
9638 }
9639 }
9640}
9641#[cfg(any(docsrs, feature = "path"))]
9642#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
9643impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for BoundaryAssertion {
9644 #[doc = "Calls [VisitMutAstPath`::visit_mut_boundary_assertion`] with `self`."]
9645 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9646 <V as VisitMutAstPath>::visit_mut_boundary_assertion(visitor, self, __ast_path)
9647 }
9648
9649 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9650 match self {
9651 BoundaryAssertion { span, kind } => {
9652 {
9653 let mut __ast_path = __ast_path.with_guard(AstParentKind::BoundaryAssertion(
9654 self::fields::BoundaryAssertionField::Span,
9655 ));
9656 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9657 span,
9658 visitor,
9659 &mut *__ast_path,
9660 )
9661 };
9662 {
9663 let mut __ast_path = __ast_path.with_guard(AstParentKind::BoundaryAssertion(
9664 self::fields::BoundaryAssertionField::Kind,
9665 ));
9666 <BoundaryAssertionKind as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9667 kind,
9668 visitor,
9669 &mut *__ast_path,
9670 )
9671 };
9672 }
9673 }
9674 }
9675}
9676#[cfg(any(docsrs, feature = "path"))]
9677#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
9678impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for BoundaryAssertionKind {
9679 #[doc = "Calls [VisitMutAstPath`::visit_mut_boundary_assertion_kind`] with `self`."]
9680 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9681 <V as VisitMutAstPath>::visit_mut_boundary_assertion_kind(visitor, self, __ast_path)
9682 }
9683
9684 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9685 match self {
9686 BoundaryAssertionKind::Start => {}
9687 BoundaryAssertionKind::End => {}
9688 BoundaryAssertionKind::Boundary => {}
9689 BoundaryAssertionKind::NegativeBoundary => {}
9690 }
9691 }
9692}
9693#[cfg(any(docsrs, feature = "path"))]
9694#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
9695impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for CapturingGroup {
9696 #[doc = "Calls [VisitMutAstPath`::visit_mut_capturing_group`] with `self`."]
9697 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9698 <V as VisitMutAstPath>::visit_mut_capturing_group(visitor, self, __ast_path)
9699 }
9700
9701 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9702 match self {
9703 CapturingGroup { span, name, body } => {
9704 {
9705 let mut __ast_path = __ast_path.with_guard(AstParentKind::CapturingGroup(
9706 self::fields::CapturingGroupField::Span,
9707 ));
9708 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9709 span,
9710 visitor,
9711 &mut *__ast_path,
9712 )
9713 };
9714 {
9715 let mut __ast_path = __ast_path.with_guard(AstParentKind::CapturingGroup(
9716 self::fields::CapturingGroupField::Name,
9717 ));
9718 <Option<swc_atoms::Atom> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9719 name,
9720 visitor,
9721 &mut *__ast_path,
9722 )
9723 };
9724 {
9725 let mut __ast_path = __ast_path.with_guard(AstParentKind::CapturingGroup(
9726 self::fields::CapturingGroupField::Body,
9727 ));
9728 <Disjunction as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9729 body,
9730 visitor,
9731 &mut *__ast_path,
9732 )
9733 };
9734 }
9735 }
9736 }
9737}
9738#[cfg(any(docsrs, feature = "path"))]
9739#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
9740impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for Character {
9741 #[doc = "Calls [VisitMutAstPath`::visit_mut_character`] with `self`."]
9742 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9743 <V as VisitMutAstPath>::visit_mut_character(visitor, self, __ast_path)
9744 }
9745
9746 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9747 match self {
9748 Character { span, kind, value } => {
9749 {
9750 let mut __ast_path = __ast_path
9751 .with_guard(AstParentKind::Character(self::fields::CharacterField::Span));
9752 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9753 span,
9754 visitor,
9755 &mut *__ast_path,
9756 )
9757 };
9758 {
9759 let mut __ast_path = __ast_path
9760 .with_guard(AstParentKind::Character(self::fields::CharacterField::Kind));
9761 <CharacterKind as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9762 kind,
9763 visitor,
9764 &mut *__ast_path,
9765 )
9766 };
9767 }
9768 }
9769 }
9770}
9771#[cfg(any(docsrs, feature = "path"))]
9772#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
9773impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for CharacterClass {
9774 #[doc = "Calls [VisitMutAstPath`::visit_mut_character_class`] with `self`."]
9775 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9776 <V as VisitMutAstPath>::visit_mut_character_class(visitor, self, __ast_path)
9777 }
9778
9779 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9780 match self {
9781 CharacterClass {
9782 span,
9783 negative,
9784 strings,
9785 kind,
9786 body,
9787 } => {
9788 {
9789 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClass(
9790 self::fields::CharacterClassField::Span,
9791 ));
9792 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9793 span,
9794 visitor,
9795 &mut *__ast_path,
9796 )
9797 };
9798 {
9799 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClass(
9800 self::fields::CharacterClassField::Kind,
9801 ));
9802 <CharacterClassContentsKind as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9803 kind,
9804 visitor,
9805 &mut *__ast_path,
9806 )
9807 };
9808 {
9809 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClass(
9810 self::fields::CharacterClassField::Body(usize::MAX),
9811 ));
9812 <Vec<CharacterClassContents> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9813 body,
9814 visitor,
9815 &mut *__ast_path,
9816 )
9817 };
9818 }
9819 }
9820 }
9821}
9822#[cfg(any(docsrs, feature = "path"))]
9823#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
9824impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for CharacterClassContents {
9825 #[doc = "Calls [VisitMutAstPath`::visit_mut_character_class_contents`] with `self`."]
9826 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9827 <V as VisitMutAstPath>::visit_mut_character_class_contents(visitor, self, __ast_path)
9828 }
9829
9830 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9831 match self {
9832 CharacterClassContents::CharacterClassRange { 0: _field_0 } => {
9833 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents(
9834 self::fields::CharacterClassContentsField::CharacterClassRange,
9835 ));
9836 <Box<CharacterClassRange> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9837 _field_0,
9838 visitor,
9839 &mut *__ast_path,
9840 );
9841 }
9842 CharacterClassContents::CharacterClassEscape { 0: _field_0 } => {
9843 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents(
9844 self::fields::CharacterClassContentsField::CharacterClassEscape,
9845 ));
9846 <Box<CharacterClassEscape> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9847 _field_0,
9848 visitor,
9849 &mut *__ast_path,
9850 );
9851 }
9852 CharacterClassContents::UnicodePropertyEscape { 0: _field_0 } => {
9853 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents(
9854 self::fields::CharacterClassContentsField::UnicodePropertyEscape,
9855 ));
9856 <Box<UnicodePropertyEscape> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9857 _field_0,
9858 visitor,
9859 &mut *__ast_path,
9860 );
9861 }
9862 CharacterClassContents::Character { 0: _field_0 } => {
9863 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents(
9864 self::fields::CharacterClassContentsField::Character,
9865 ));
9866 <Box<Character> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9867 _field_0,
9868 visitor,
9869 &mut *__ast_path,
9870 );
9871 }
9872 CharacterClassContents::NestedCharacterClass { 0: _field_0 } => {
9873 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents(
9874 self::fields::CharacterClassContentsField::NestedCharacterClass,
9875 ));
9876 <Box<CharacterClass> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9877 _field_0,
9878 visitor,
9879 &mut *__ast_path,
9880 );
9881 }
9882 CharacterClassContents::ClassStringDisjunction { 0: _field_0 } => {
9883 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents(
9884 self::fields::CharacterClassContentsField::ClassStringDisjunction,
9885 ));
9886 <Box<ClassStringDisjunction> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9887 _field_0,
9888 visitor,
9889 &mut *__ast_path,
9890 );
9891 }
9892 }
9893 }
9894}
9895#[cfg(any(docsrs, feature = "path"))]
9896#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
9897impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for CharacterClassContentsKind {
9898 #[doc = "Calls [VisitMutAstPath`::visit_mut_character_class_contents_kind`] with `self`."]
9899 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9900 <V as VisitMutAstPath>::visit_mut_character_class_contents_kind(visitor, self, __ast_path)
9901 }
9902
9903 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9904 match self {
9905 CharacterClassContentsKind::Union => {}
9906 CharacterClassContentsKind::Intersection => {}
9907 CharacterClassContentsKind::Subtraction => {}
9908 }
9909 }
9910}
9911#[cfg(any(docsrs, feature = "path"))]
9912#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
9913impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for CharacterClassEscape {
9914 #[doc = "Calls [VisitMutAstPath`::visit_mut_character_class_escape`] with `self`."]
9915 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9916 <V as VisitMutAstPath>::visit_mut_character_class_escape(visitor, self, __ast_path)
9917 }
9918
9919 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9920 match self {
9921 CharacterClassEscape { span, kind } => {
9922 {
9923 let mut __ast_path =
9924 __ast_path.with_guard(AstParentKind::CharacterClassEscape(
9925 self::fields::CharacterClassEscapeField::Span,
9926 ));
9927 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9928 span,
9929 visitor,
9930 &mut *__ast_path,
9931 )
9932 };
9933 {
9934 let mut __ast_path =
9935 __ast_path.with_guard(AstParentKind::CharacterClassEscape(
9936 self::fields::CharacterClassEscapeField::Kind,
9937 ));
9938 <CharacterClassEscapeKind as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9939 kind,
9940 visitor,
9941 &mut *__ast_path,
9942 )
9943 };
9944 }
9945 }
9946 }
9947}
9948#[cfg(any(docsrs, feature = "path"))]
9949#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
9950impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for CharacterClassEscapeKind {
9951 #[doc = "Calls [VisitMutAstPath`::visit_mut_character_class_escape_kind`] with `self`."]
9952 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9953 <V as VisitMutAstPath>::visit_mut_character_class_escape_kind(visitor, self, __ast_path)
9954 }
9955
9956 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9957 match self {
9958 CharacterClassEscapeKind::D => {}
9959 CharacterClassEscapeKind::NegativeD => {}
9960 CharacterClassEscapeKind::S => {}
9961 CharacterClassEscapeKind::NegativeS => {}
9962 CharacterClassEscapeKind::W => {}
9963 CharacterClassEscapeKind::NegativeW => {}
9964 }
9965 }
9966}
9967#[cfg(any(docsrs, feature = "path"))]
9968#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
9969impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for CharacterClassRange {
9970 #[doc = "Calls [VisitMutAstPath`::visit_mut_character_class_range`] with `self`."]
9971 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9972 <V as VisitMutAstPath>::visit_mut_character_class_range(visitor, self, __ast_path)
9973 }
9974
9975 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
9976 match self {
9977 CharacterClassRange { span, min, max } => {
9978 {
9979 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassRange(
9980 self::fields::CharacterClassRangeField::Span,
9981 ));
9982 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9983 span,
9984 visitor,
9985 &mut *__ast_path,
9986 )
9987 };
9988 {
9989 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassRange(
9990 self::fields::CharacterClassRangeField::Min,
9991 ));
9992 <Character as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
9993 min,
9994 visitor,
9995 &mut *__ast_path,
9996 )
9997 };
9998 {
9999 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassRange(
10000 self::fields::CharacterClassRangeField::Max,
10001 ));
10002 <Character as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10003 max,
10004 visitor,
10005 &mut *__ast_path,
10006 )
10007 };
10008 }
10009 }
10010 }
10011}
10012#[cfg(any(docsrs, feature = "path"))]
10013#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10014impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for CharacterKind {
10015 #[doc = "Calls [VisitMutAstPath`::visit_mut_character_kind`] with `self`."]
10016 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10017 <V as VisitMutAstPath>::visit_mut_character_kind(visitor, self, __ast_path)
10018 }
10019
10020 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10021 match self {
10022 CharacterKind::ControlLetter => {}
10023 CharacterKind::HexadecimalEscape => {}
10024 CharacterKind::Identifier => {}
10025 CharacterKind::Null => {}
10026 CharacterKind::Octal1 => {}
10027 CharacterKind::Octal2 => {}
10028 CharacterKind::Octal3 => {}
10029 CharacterKind::SingleEscape => {}
10030 CharacterKind::Symbol => {}
10031 CharacterKind::UnicodeEscape => {}
10032 }
10033 }
10034}
10035#[cfg(any(docsrs, feature = "path"))]
10036#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10037impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for ClassString {
10038 #[doc = "Calls [VisitMutAstPath`::visit_mut_class_string`] with `self`."]
10039 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10040 <V as VisitMutAstPath>::visit_mut_class_string(visitor, self, __ast_path)
10041 }
10042
10043 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10044 match self {
10045 ClassString {
10046 span,
10047 strings,
10048 body,
10049 } => {
10050 {
10051 let mut __ast_path = __ast_path.with_guard(AstParentKind::ClassString(
10052 self::fields::ClassStringField::Span,
10053 ));
10054 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10055 span,
10056 visitor,
10057 &mut *__ast_path,
10058 )
10059 };
10060 {
10061 let mut __ast_path = __ast_path.with_guard(AstParentKind::ClassString(
10062 self::fields::ClassStringField::Body(usize::MAX),
10063 ));
10064 <Vec<Character> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10065 body,
10066 visitor,
10067 &mut *__ast_path,
10068 )
10069 };
10070 }
10071 }
10072 }
10073}
10074#[cfg(any(docsrs, feature = "path"))]
10075#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10076impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for ClassStringDisjunction {
10077 #[doc = "Calls [VisitMutAstPath`::visit_mut_class_string_disjunction`] with `self`."]
10078 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10079 <V as VisitMutAstPath>::visit_mut_class_string_disjunction(visitor, self, __ast_path)
10080 }
10081
10082 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10083 match self {
10084 ClassStringDisjunction {
10085 span,
10086 strings,
10087 body,
10088 } => {
10089 {
10090 let mut __ast_path =
10091 __ast_path.with_guard(AstParentKind::ClassStringDisjunction(
10092 self::fields::ClassStringDisjunctionField::Span,
10093 ));
10094 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10095 span,
10096 visitor,
10097 &mut *__ast_path,
10098 )
10099 };
10100 {
10101 let mut __ast_path =
10102 __ast_path.with_guard(AstParentKind::ClassStringDisjunction(
10103 self::fields::ClassStringDisjunctionField::Body(usize::MAX),
10104 ));
10105 <Vec<ClassString> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10106 body,
10107 visitor,
10108 &mut *__ast_path,
10109 )
10110 };
10111 }
10112 }
10113 }
10114}
10115#[cfg(any(docsrs, feature = "path"))]
10116#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10117impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for Disjunction {
10118 #[doc = "Calls [VisitMutAstPath`::visit_mut_disjunction`] with `self`."]
10119 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10120 <V as VisitMutAstPath>::visit_mut_disjunction(visitor, self, __ast_path)
10121 }
10122
10123 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10124 match self {
10125 Disjunction { span, body } => {
10126 {
10127 let mut __ast_path = __ast_path.with_guard(AstParentKind::Disjunction(
10128 self::fields::DisjunctionField::Span,
10129 ));
10130 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10131 span,
10132 visitor,
10133 &mut *__ast_path,
10134 )
10135 };
10136 {
10137 let mut __ast_path = __ast_path.with_guard(AstParentKind::Disjunction(
10138 self::fields::DisjunctionField::Body(usize::MAX),
10139 ));
10140 <Vec<Alternative> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10141 body,
10142 visitor,
10143 &mut *__ast_path,
10144 )
10145 };
10146 }
10147 }
10148 }
10149}
10150#[cfg(any(docsrs, feature = "path"))]
10151#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10152impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for Dot {
10153 #[doc = "Calls [VisitMutAstPath`::visit_mut_dot`] with `self`."]
10154 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10155 <V as VisitMutAstPath>::visit_mut_dot(visitor, self, __ast_path)
10156 }
10157
10158 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10159 match self {
10160 Dot { span } => {
10161 {
10162 let mut __ast_path =
10163 __ast_path.with_guard(AstParentKind::Dot(self::fields::DotField::Span));
10164 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10165 span,
10166 visitor,
10167 &mut *__ast_path,
10168 )
10169 };
10170 }
10171 }
10172 }
10173}
10174#[cfg(any(docsrs, feature = "path"))]
10175#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10176impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for IgnoreGroup {
10177 #[doc = "Calls [VisitMutAstPath`::visit_mut_ignore_group`] with `self`."]
10178 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10179 <V as VisitMutAstPath>::visit_mut_ignore_group(visitor, self, __ast_path)
10180 }
10181
10182 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10183 match self {
10184 IgnoreGroup {
10185 span,
10186 modifiers,
10187 body,
10188 } => {
10189 {
10190 let mut __ast_path = __ast_path.with_guard(AstParentKind::IgnoreGroup(
10191 self::fields::IgnoreGroupField::Span,
10192 ));
10193 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10194 span,
10195 visitor,
10196 &mut *__ast_path,
10197 )
10198 };
10199 {
10200 let mut __ast_path = __ast_path.with_guard(AstParentKind::IgnoreGroup(
10201 self::fields::IgnoreGroupField::Modifiers,
10202 ));
10203 <Option<Modifiers> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10204 modifiers,
10205 visitor,
10206 &mut *__ast_path,
10207 )
10208 };
10209 {
10210 let mut __ast_path = __ast_path.with_guard(AstParentKind::IgnoreGroup(
10211 self::fields::IgnoreGroupField::Body,
10212 ));
10213 <Disjunction as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10214 body,
10215 visitor,
10216 &mut *__ast_path,
10217 )
10218 };
10219 }
10220 }
10221 }
10222}
10223#[cfg(any(docsrs, feature = "path"))]
10224#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10225impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for IndexedReference {
10226 #[doc = "Calls [VisitMutAstPath`::visit_mut_indexed_reference`] with `self`."]
10227 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10228 <V as VisitMutAstPath>::visit_mut_indexed_reference(visitor, self, __ast_path)
10229 }
10230
10231 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10232 match self {
10233 IndexedReference { span, index } => {
10234 {
10235 let mut __ast_path = __ast_path.with_guard(AstParentKind::IndexedReference(
10236 self::fields::IndexedReferenceField::Span,
10237 ));
10238 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10239 span,
10240 visitor,
10241 &mut *__ast_path,
10242 )
10243 };
10244 }
10245 }
10246 }
10247}
10248#[cfg(any(docsrs, feature = "path"))]
10249#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10250impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for LookAroundAssertion {
10251 #[doc = "Calls [VisitMutAstPath`::visit_mut_look_around_assertion`] with `self`."]
10252 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10253 <V as VisitMutAstPath>::visit_mut_look_around_assertion(visitor, self, __ast_path)
10254 }
10255
10256 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10257 match self {
10258 LookAroundAssertion { span, kind, body } => {
10259 {
10260 let mut __ast_path = __ast_path.with_guard(AstParentKind::LookAroundAssertion(
10261 self::fields::LookAroundAssertionField::Span,
10262 ));
10263 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10264 span,
10265 visitor,
10266 &mut *__ast_path,
10267 )
10268 };
10269 {
10270 let mut __ast_path = __ast_path.with_guard(AstParentKind::LookAroundAssertion(
10271 self::fields::LookAroundAssertionField::Kind,
10272 ));
10273 <LookAroundAssertionKind as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10274 kind,
10275 visitor,
10276 &mut *__ast_path,
10277 )
10278 };
10279 {
10280 let mut __ast_path = __ast_path.with_guard(AstParentKind::LookAroundAssertion(
10281 self::fields::LookAroundAssertionField::Body,
10282 ));
10283 <Disjunction as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10284 body,
10285 visitor,
10286 &mut *__ast_path,
10287 )
10288 };
10289 }
10290 }
10291 }
10292}
10293#[cfg(any(docsrs, feature = "path"))]
10294#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10295impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for LookAroundAssertionKind {
10296 #[doc = "Calls [VisitMutAstPath`::visit_mut_look_around_assertion_kind`] with `self`."]
10297 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10298 <V as VisitMutAstPath>::visit_mut_look_around_assertion_kind(visitor, self, __ast_path)
10299 }
10300
10301 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10302 match self {
10303 LookAroundAssertionKind::Lookahead => {}
10304 LookAroundAssertionKind::NegativeLookahead => {}
10305 LookAroundAssertionKind::Lookbehind => {}
10306 LookAroundAssertionKind::NegativeLookbehind => {}
10307 }
10308 }
10309}
10310#[cfg(any(docsrs, feature = "path"))]
10311#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10312impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for Modifiers {
10313 #[doc = "Calls [VisitMutAstPath`::visit_mut_modifiers`] with `self`."]
10314 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10315 <V as VisitMutAstPath>::visit_mut_modifiers(visitor, self, __ast_path)
10316 }
10317
10318 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10319 match self {
10320 Modifiers {
10321 span,
10322 enabling,
10323 disabling,
10324 } => {
10325 {
10326 let mut __ast_path = __ast_path
10327 .with_guard(AstParentKind::Modifiers(self::fields::ModifiersField::Span));
10328 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10329 span,
10330 visitor,
10331 &mut *__ast_path,
10332 )
10333 };
10334 {
10335 let mut __ast_path = __ast_path.with_guard(AstParentKind::Modifiers(
10336 self::fields::ModifiersField::Enabling,
10337 ));
10338 <Modifier as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10339 enabling,
10340 visitor,
10341 &mut *__ast_path,
10342 )
10343 };
10344 {
10345 let mut __ast_path = __ast_path.with_guard(AstParentKind::Modifiers(
10346 self::fields::ModifiersField::Disabling,
10347 ));
10348 <Modifier as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10349 disabling,
10350 visitor,
10351 &mut *__ast_path,
10352 )
10353 };
10354 }
10355 }
10356 }
10357}
10358#[cfg(any(docsrs, feature = "path"))]
10359#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10360impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for NamedReference {
10361 #[doc = "Calls [VisitMutAstPath`::visit_mut_named_reference`] with `self`."]
10362 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10363 <V as VisitMutAstPath>::visit_mut_named_reference(visitor, self, __ast_path)
10364 }
10365
10366 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10367 match self {
10368 NamedReference { span, name } => {
10369 {
10370 let mut __ast_path = __ast_path.with_guard(AstParentKind::NamedReference(
10371 self::fields::NamedReferenceField::Span,
10372 ));
10373 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10374 span,
10375 visitor,
10376 &mut *__ast_path,
10377 )
10378 };
10379 {
10380 let mut __ast_path = __ast_path.with_guard(AstParentKind::NamedReference(
10381 self::fields::NamedReferenceField::Name,
10382 ));
10383 <swc_atoms::Atom as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10384 name,
10385 visitor,
10386 &mut *__ast_path,
10387 )
10388 };
10389 }
10390 }
10391 }
10392}
10393#[cfg(any(docsrs, feature = "path"))]
10394#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10395impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for Pattern {
10396 #[doc = "Calls [VisitMutAstPath`::visit_mut_pattern`] with `self`."]
10397 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10398 <V as VisitMutAstPath>::visit_mut_pattern(visitor, self, __ast_path)
10399 }
10400
10401 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10402 match self {
10403 Pattern { span, body } => {
10404 {
10405 let mut __ast_path = __ast_path
10406 .with_guard(AstParentKind::Pattern(self::fields::PatternField::Span));
10407 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10408 span,
10409 visitor,
10410 &mut *__ast_path,
10411 )
10412 };
10413 {
10414 let mut __ast_path = __ast_path
10415 .with_guard(AstParentKind::Pattern(self::fields::PatternField::Body));
10416 <Disjunction as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10417 body,
10418 visitor,
10419 &mut *__ast_path,
10420 )
10421 };
10422 }
10423 }
10424 }
10425}
10426#[cfg(any(docsrs, feature = "path"))]
10427#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10428impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for Quantifier {
10429 #[doc = "Calls [VisitMutAstPath`::visit_mut_quantifier`] with `self`."]
10430 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10431 <V as VisitMutAstPath>::visit_mut_quantifier(visitor, self, __ast_path)
10432 }
10433
10434 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10435 match self {
10436 Quantifier {
10437 span,
10438 min,
10439 max,
10440 greedy,
10441 body,
10442 } => {
10443 {
10444 let mut __ast_path = __ast_path.with_guard(AstParentKind::Quantifier(
10445 self::fields::QuantifierField::Span,
10446 ));
10447 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10448 span,
10449 visitor,
10450 &mut *__ast_path,
10451 )
10452 };
10453 {
10454 let mut __ast_path = __ast_path.with_guard(AstParentKind::Quantifier(
10455 self::fields::QuantifierField::Body,
10456 ));
10457 <Term as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10458 body,
10459 visitor,
10460 &mut *__ast_path,
10461 )
10462 };
10463 }
10464 }
10465 }
10466}
10467#[cfg(any(docsrs, feature = "path"))]
10468#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10469impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for Term {
10470 #[doc = "Calls [VisitMutAstPath`::visit_mut_term`] with `self`."]
10471 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10472 <V as VisitMutAstPath>::visit_mut_term(visitor, self, __ast_path)
10473 }
10474
10475 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10476 match self {
10477 Term::BoundaryAssertion { 0: _field_0 } => {
10478 let mut __ast_path = __ast_path.with_guard(AstParentKind::Term(
10479 self::fields::TermField::BoundaryAssertion,
10480 ));
10481 <Box<BoundaryAssertion> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10482 _field_0,
10483 visitor,
10484 &mut *__ast_path,
10485 );
10486 }
10487 Term::LookAroundAssertion { 0: _field_0 } => {
10488 let mut __ast_path = __ast_path.with_guard(AstParentKind::Term(
10489 self::fields::TermField::LookAroundAssertion,
10490 ));
10491 <Box<LookAroundAssertion> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10492 _field_0,
10493 visitor,
10494 &mut *__ast_path,
10495 );
10496 }
10497 Term::Quantifier { 0: _field_0 } => {
10498 let mut __ast_path =
10499 __ast_path.with_guard(AstParentKind::Term(self::fields::TermField::Quantifier));
10500 <Box<Quantifier> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10501 _field_0,
10502 visitor,
10503 &mut *__ast_path,
10504 );
10505 }
10506 Term::Character { 0: _field_0 } => {
10507 let mut __ast_path =
10508 __ast_path.with_guard(AstParentKind::Term(self::fields::TermField::Character));
10509 <Box<Character> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10510 _field_0,
10511 visitor,
10512 &mut *__ast_path,
10513 );
10514 }
10515 Term::Dot { 0: _field_0 } => {
10516 let mut __ast_path =
10517 __ast_path.with_guard(AstParentKind::Term(self::fields::TermField::Dot));
10518 <Dot as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10519 _field_0,
10520 visitor,
10521 &mut *__ast_path,
10522 );
10523 }
10524 Term::CharacterClassEscape { 0: _field_0 } => {
10525 let mut __ast_path = __ast_path.with_guard(AstParentKind::Term(
10526 self::fields::TermField::CharacterClassEscape,
10527 ));
10528 <Box<CharacterClassEscape> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10529 _field_0,
10530 visitor,
10531 &mut *__ast_path,
10532 );
10533 }
10534 Term::UnicodePropertyEscape { 0: _field_0 } => {
10535 let mut __ast_path = __ast_path.with_guard(AstParentKind::Term(
10536 self::fields::TermField::UnicodePropertyEscape,
10537 ));
10538 <Box<UnicodePropertyEscape> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10539 _field_0,
10540 visitor,
10541 &mut *__ast_path,
10542 );
10543 }
10544 Term::CharacterClass { 0: _field_0 } => {
10545 let mut __ast_path = __ast_path
10546 .with_guard(AstParentKind::Term(self::fields::TermField::CharacterClass));
10547 <Box<CharacterClass> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10548 _field_0,
10549 visitor,
10550 &mut *__ast_path,
10551 );
10552 }
10553 Term::CapturingGroup { 0: _field_0 } => {
10554 let mut __ast_path = __ast_path
10555 .with_guard(AstParentKind::Term(self::fields::TermField::CapturingGroup));
10556 <Box<CapturingGroup> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10557 _field_0,
10558 visitor,
10559 &mut *__ast_path,
10560 );
10561 }
10562 Term::IgnoreGroup { 0: _field_0 } => {
10563 let mut __ast_path = __ast_path
10564 .with_guard(AstParentKind::Term(self::fields::TermField::IgnoreGroup));
10565 <Box<IgnoreGroup> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10566 _field_0,
10567 visitor,
10568 &mut *__ast_path,
10569 );
10570 }
10571 Term::IndexedReference { 0: _field_0 } => {
10572 let mut __ast_path = __ast_path.with_guard(AstParentKind::Term(
10573 self::fields::TermField::IndexedReference,
10574 ));
10575 <Box<IndexedReference> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10576 _field_0,
10577 visitor,
10578 &mut *__ast_path,
10579 );
10580 }
10581 Term::NamedReference { 0: _field_0 } => {
10582 let mut __ast_path = __ast_path
10583 .with_guard(AstParentKind::Term(self::fields::TermField::NamedReference));
10584 <Box<NamedReference> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10585 _field_0,
10586 visitor,
10587 &mut *__ast_path,
10588 );
10589 }
10590 }
10591 }
10592}
10593#[cfg(any(docsrs, feature = "path"))]
10594#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10595impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for UnicodePropertyEscape {
10596 #[doc = "Calls [VisitMutAstPath`::visit_mut_unicode_property_escape`] with `self`."]
10597 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10598 <V as VisitMutAstPath>::visit_mut_unicode_property_escape(visitor, self, __ast_path)
10599 }
10600
10601 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10602 match self {
10603 UnicodePropertyEscape {
10604 span,
10605 negative,
10606 strings,
10607 name,
10608 value,
10609 } => {
10610 {
10611 let mut __ast_path =
10612 __ast_path.with_guard(AstParentKind::UnicodePropertyEscape(
10613 self::fields::UnicodePropertyEscapeField::Span,
10614 ));
10615 <swc_common::Span as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10616 span,
10617 visitor,
10618 &mut *__ast_path,
10619 )
10620 };
10621 {
10622 let mut __ast_path =
10623 __ast_path.with_guard(AstParentKind::UnicodePropertyEscape(
10624 self::fields::UnicodePropertyEscapeField::Name,
10625 ));
10626 <swc_atoms::Atom as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10627 name,
10628 visitor,
10629 &mut *__ast_path,
10630 )
10631 };
10632 {
10633 let mut __ast_path =
10634 __ast_path.with_guard(AstParentKind::UnicodePropertyEscape(
10635 self::fields::UnicodePropertyEscapeField::Value,
10636 ));
10637 <Option<swc_atoms::Atom> as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10638 value,
10639 visitor,
10640 &mut *__ast_path,
10641 )
10642 };
10643 }
10644 }
10645 }
10646}
10647#[cfg(any(docsrs, feature = "path"))]
10648#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10649impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for Vec<Alternative> {
10650 #[doc = "Calls [VisitMutAstPath`::visit_mut_alternatives`] with `self`. (Extra impl)"]
10651 #[inline]
10652 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10653 <V as VisitMutAstPath>::visit_mut_alternatives(visitor, self, __ast_path)
10654 }
10655
10656 #[inline]
10657 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10658 self.iter_mut().enumerate().for_each(|(__idx, item)| {
10659 let mut __ast_path = __ast_path.with_index_guard(__idx);
10660 <Alternative as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10661 item,
10662 visitor,
10663 &mut *__ast_path,
10664 )
10665 })
10666 }
10667}
10668#[cfg(any(docsrs, feature = "path"))]
10669#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10670impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for swc_atoms::Atom {
10671 #[doc = "Calls [VisitMutAstPath`::visit_mut_atom`] with `self`. (Extra impl)"]
10672 #[inline]
10673 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10674 <V as VisitMutAstPath>::visit_mut_atom(visitor, self, __ast_path)
10675 }
10676
10677 #[inline]
10678 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10679 {}
10680 }
10681}
10682#[cfg(any(docsrs, feature = "path"))]
10683#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10684impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for Vec<CharacterClassContents> {
10685 #[doc = "Calls [VisitMutAstPath`::visit_mut_character_class_contentss`] with `self`. (Extra \
10686 impl)"]
10687 #[inline]
10688 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10689 <V as VisitMutAstPath>::visit_mut_character_class_contentss(visitor, self, __ast_path)
10690 }
10691
10692 #[inline]
10693 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10694 self.iter_mut().enumerate().for_each(|(__idx, item)| {
10695 let mut __ast_path = __ast_path.with_index_guard(__idx);
10696 <CharacterClassContents as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10697 item,
10698 visitor,
10699 &mut *__ast_path,
10700 )
10701 })
10702 }
10703}
10704#[cfg(any(docsrs, feature = "path"))]
10705#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10706impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for Vec<Character> {
10707 #[doc = "Calls [VisitMutAstPath`::visit_mut_characters`] with `self`. (Extra impl)"]
10708 #[inline]
10709 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10710 <V as VisitMutAstPath>::visit_mut_characters(visitor, self, __ast_path)
10711 }
10712
10713 #[inline]
10714 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10715 self.iter_mut().enumerate().for_each(|(__idx, item)| {
10716 let mut __ast_path = __ast_path.with_index_guard(__idx);
10717 <Character as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10718 item,
10719 visitor,
10720 &mut *__ast_path,
10721 )
10722 })
10723 }
10724}
10725#[cfg(any(docsrs, feature = "path"))]
10726#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10727impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for Vec<ClassString> {
10728 #[doc = "Calls [VisitMutAstPath`::visit_mut_class_strings`] with `self`. (Extra impl)"]
10729 #[inline]
10730 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10731 <V as VisitMutAstPath>::visit_mut_class_strings(visitor, self, __ast_path)
10732 }
10733
10734 #[inline]
10735 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10736 self.iter_mut().enumerate().for_each(|(__idx, item)| {
10737 let mut __ast_path = __ast_path.with_index_guard(__idx);
10738 <ClassString as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10739 item,
10740 visitor,
10741 &mut *__ast_path,
10742 )
10743 })
10744 }
10745}
10746#[cfg(any(docsrs, feature = "path"))]
10747#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10748impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for Modifier {
10749 #[doc = "Calls [VisitMutAstPath`::visit_mut_modifier`] with `self`. (Extra impl)"]
10750 #[inline]
10751 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10752 <V as VisitMutAstPath>::visit_mut_modifier(visitor, self, __ast_path)
10753 }
10754
10755 #[inline]
10756 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10757 {}
10758 }
10759}
10760#[cfg(any(docsrs, feature = "path"))]
10761#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10762impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for Option<swc_atoms::Atom> {
10763 #[doc = "Calls [VisitMutAstPath`::visit_mut_opt_atom`] with `self`. (Extra impl)"]
10764 #[inline]
10765 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10766 <V as VisitMutAstPath>::visit_mut_opt_atom(visitor, self, __ast_path)
10767 }
10768
10769 #[inline]
10770 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10771 match self {
10772 Some(inner) => <swc_atoms::Atom as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10773 inner, visitor, __ast_path,
10774 ),
10775 None => {}
10776 }
10777 }
10778}
10779#[cfg(any(docsrs, feature = "path"))]
10780#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10781impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for Option<Modifiers> {
10782 #[doc = "Calls [VisitMutAstPath`::visit_mut_opt_modifiers`] with `self`. (Extra impl)"]
10783 #[inline]
10784 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10785 <V as VisitMutAstPath>::visit_mut_opt_modifiers(visitor, self, __ast_path)
10786 }
10787
10788 #[inline]
10789 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10790 match self {
10791 Some(inner) => <Modifiers as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10792 inner, visitor, __ast_path,
10793 ),
10794 None => {}
10795 }
10796 }
10797}
10798#[cfg(any(docsrs, feature = "path"))]
10799#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10800impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for swc_common::Span {
10801 #[doc = "Calls [VisitMutAstPath`::visit_mut_span`] with `self`. (Extra impl)"]
10802 #[inline]
10803 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10804 <V as VisitMutAstPath>::visit_mut_span(visitor, self, __ast_path)
10805 }
10806
10807 #[inline]
10808 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10809 {}
10810 }
10811}
10812#[cfg(any(docsrs, feature = "path"))]
10813#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10814impl<V: ?Sized + VisitMutAstPath> VisitMutWithAstPath<V> for Vec<Term> {
10815 #[doc = "Calls [VisitMutAstPath`::visit_mut_terms`] with `self`. (Extra impl)"]
10816 #[inline]
10817 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10818 <V as VisitMutAstPath>::visit_mut_terms(visitor, self, __ast_path)
10819 }
10820
10821 #[inline]
10822 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10823 self.iter_mut().enumerate().for_each(|(__idx, item)| {
10824 let mut __ast_path = __ast_path.with_index_guard(__idx);
10825 <Term as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10826 item,
10827 visitor,
10828 &mut *__ast_path,
10829 )
10830 })
10831 }
10832}
10833#[cfg(any(docsrs, feature = "path"))]
10834#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
10835impl<V, T> VisitMutWithAstPath<V> for std::boxed::Box<T>
10836where
10837 V: ?Sized + VisitMutAstPath,
10838 T: VisitMutWithAstPath<V>,
10839{
10840 #[inline]
10841 fn visit_mut_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10842 let v = <T as VisitMutWithAstPath<V>>::visit_mut_with_ast_path(
10843 &mut **self,
10844 visitor,
10845 __ast_path,
10846 );
10847 v
10848 }
10849
10850 #[inline]
10851 fn visit_mut_children_with_ast_path(&mut self, visitor: &mut V, __ast_path: &mut AstKindPath) {
10852 let v = <T as VisitMutWithAstPath<V>>::visit_mut_children_with_ast_path(
10853 &mut **self,
10854 visitor,
10855 __ast_path,
10856 );
10857 v
10858 }
10859}
10860#[doc = r" A visitor trait for traversing the AST."]
10861pub trait Fold {
10862 #[doc = "Visit a node of type `Alternative`.\n\nBy default, this method calls \
10863 [`Alternative::fold_children_with`]. If you want to recurse, you need to call it \
10864 manually."]
10865 #[inline]
10866 fn fold_alternative(&mut self, node: Alternative) -> Alternative {
10867 <Alternative as FoldWith<Self>>::fold_children_with(node, self)
10868 }
10869 #[doc = "Visit a node of type `Vec < Alternative >`.\n\nBy default, this method calls [`Vec < \
10870 Alternative >::fold_children_with`]. If you want to recurse, you need to call it \
10871 manually."]
10872 #[inline]
10873 fn fold_alternatives(&mut self, node: Vec<Alternative>) -> Vec<Alternative> {
10874 <Vec<Alternative> as FoldWith<Self>>::fold_children_with(node, self)
10875 }
10876 #[doc = "Visit a node of type `swc_atoms :: Atom`.\n\nBy default, this method calls \
10877 [`swc_atoms :: Atom::fold_children_with`]. If you want to recurse, you need to call \
10878 it manually."]
10879 #[inline]
10880 fn fold_atom(&mut self, node: swc_atoms::Atom) -> swc_atoms::Atom {
10881 <swc_atoms::Atom as FoldWith<Self>>::fold_children_with(node, self)
10882 }
10883 #[doc = "Visit a node of type `BoundaryAssertion`.\n\nBy default, this method calls \
10884 [`BoundaryAssertion::fold_children_with`]. If you want to recurse, you need to call \
10885 it manually."]
10886 #[inline]
10887 fn fold_boundary_assertion(&mut self, node: BoundaryAssertion) -> BoundaryAssertion {
10888 <BoundaryAssertion as FoldWith<Self>>::fold_children_with(node, self)
10889 }
10890 #[doc = "Visit a node of type `BoundaryAssertionKind`.\n\nBy default, this method calls \
10891 [`BoundaryAssertionKind::fold_children_with`]. If you want to recurse, you need to \
10892 call it manually."]
10893 #[inline]
10894 fn fold_boundary_assertion_kind(
10895 &mut self,
10896 node: BoundaryAssertionKind,
10897 ) -> BoundaryAssertionKind {
10898 <BoundaryAssertionKind as FoldWith<Self>>::fold_children_with(node, self)
10899 }
10900 #[doc = "Visit a node of type `CapturingGroup`.\n\nBy default, this method calls \
10901 [`CapturingGroup::fold_children_with`]. If you want to recurse, you need to call it \
10902 manually."]
10903 #[inline]
10904 fn fold_capturing_group(&mut self, node: CapturingGroup) -> CapturingGroup {
10905 <CapturingGroup as FoldWith<Self>>::fold_children_with(node, self)
10906 }
10907 #[doc = "Visit a node of type `Character`.\n\nBy default, this method calls \
10908 [`Character::fold_children_with`]. If you want to recurse, you need to call it \
10909 manually."]
10910 #[inline]
10911 fn fold_character(&mut self, node: Character) -> Character {
10912 <Character as FoldWith<Self>>::fold_children_with(node, self)
10913 }
10914 #[doc = "Visit a node of type `CharacterClass`.\n\nBy default, this method calls \
10915 [`CharacterClass::fold_children_with`]. If you want to recurse, you need to call it \
10916 manually."]
10917 #[inline]
10918 fn fold_character_class(&mut self, node: CharacterClass) -> CharacterClass {
10919 <CharacterClass as FoldWith<Self>>::fold_children_with(node, self)
10920 }
10921 #[doc = "Visit a node of type `CharacterClassContents`.\n\nBy default, this method calls \
10922 [`CharacterClassContents::fold_children_with`]. If you want to recurse, you need to \
10923 call it manually."]
10924 #[inline]
10925 fn fold_character_class_contents(
10926 &mut self,
10927 node: CharacterClassContents,
10928 ) -> CharacterClassContents {
10929 <CharacterClassContents as FoldWith<Self>>::fold_children_with(node, self)
10930 }
10931 #[doc = "Visit a node of type `CharacterClassContentsKind`.\n\nBy default, this method calls \
10932 [`CharacterClassContentsKind::fold_children_with`]. If you want to recurse, you need \
10933 to call it manually."]
10934 #[inline]
10935 fn fold_character_class_contents_kind(
10936 &mut self,
10937 node: CharacterClassContentsKind,
10938 ) -> CharacterClassContentsKind {
10939 <CharacterClassContentsKind as FoldWith<Self>>::fold_children_with(node, self)
10940 }
10941 #[doc = "Visit a node of type `Vec < CharacterClassContents >`.\n\nBy default, this method \
10942 calls [`Vec < CharacterClassContents >::fold_children_with`]. If you want to recurse, \
10943 you need to call it manually."]
10944 #[inline]
10945 fn fold_character_class_contentss(
10946 &mut self,
10947 node: Vec<CharacterClassContents>,
10948 ) -> Vec<CharacterClassContents> {
10949 <Vec<CharacterClassContents> as FoldWith<Self>>::fold_children_with(node, self)
10950 }
10951 #[doc = "Visit a node of type `CharacterClassEscape`.\n\nBy default, this method calls \
10952 [`CharacterClassEscape::fold_children_with`]. If you want to recurse, you need to \
10953 call it manually."]
10954 #[inline]
10955 fn fold_character_class_escape(&mut self, node: CharacterClassEscape) -> CharacterClassEscape {
10956 <CharacterClassEscape as FoldWith<Self>>::fold_children_with(node, self)
10957 }
10958 #[doc = "Visit a node of type `CharacterClassEscapeKind`.\n\nBy default, this method calls \
10959 [`CharacterClassEscapeKind::fold_children_with`]. If you want to recurse, you need to \
10960 call it manually."]
10961 #[inline]
10962 fn fold_character_class_escape_kind(
10963 &mut self,
10964 node: CharacterClassEscapeKind,
10965 ) -> CharacterClassEscapeKind {
10966 <CharacterClassEscapeKind as FoldWith<Self>>::fold_children_with(node, self)
10967 }
10968 #[doc = "Visit a node of type `CharacterClassRange`.\n\nBy default, this method calls \
10969 [`CharacterClassRange::fold_children_with`]. If you want to recurse, you need to call \
10970 it manually."]
10971 #[inline]
10972 fn fold_character_class_range(&mut self, node: CharacterClassRange) -> CharacterClassRange {
10973 <CharacterClassRange as FoldWith<Self>>::fold_children_with(node, self)
10974 }
10975 #[doc = "Visit a node of type `CharacterKind`.\n\nBy default, this method calls \
10976 [`CharacterKind::fold_children_with`]. If you want to recurse, you need to call it \
10977 manually."]
10978 #[inline]
10979 fn fold_character_kind(&mut self, node: CharacterKind) -> CharacterKind {
10980 <CharacterKind as FoldWith<Self>>::fold_children_with(node, self)
10981 }
10982 #[doc = "Visit a node of type `Vec < Character >`.\n\nBy default, this method calls [`Vec < \
10983 Character >::fold_children_with`]. If you want to recurse, you need to call it \
10984 manually."]
10985 #[inline]
10986 fn fold_characters(&mut self, node: Vec<Character>) -> Vec<Character> {
10987 <Vec<Character> as FoldWith<Self>>::fold_children_with(node, self)
10988 }
10989 #[doc = "Visit a node of type `ClassString`.\n\nBy default, this method calls \
10990 [`ClassString::fold_children_with`]. If you want to recurse, you need to call it \
10991 manually."]
10992 #[inline]
10993 fn fold_class_string(&mut self, node: ClassString) -> ClassString {
10994 <ClassString as FoldWith<Self>>::fold_children_with(node, self)
10995 }
10996 #[doc = "Visit a node of type `ClassStringDisjunction`.\n\nBy default, this method calls \
10997 [`ClassStringDisjunction::fold_children_with`]. If you want to recurse, you need to \
10998 call it manually."]
10999 #[inline]
11000 fn fold_class_string_disjunction(
11001 &mut self,
11002 node: ClassStringDisjunction,
11003 ) -> ClassStringDisjunction {
11004 <ClassStringDisjunction as FoldWith<Self>>::fold_children_with(node, self)
11005 }
11006 #[doc = "Visit a node of type `Vec < ClassString >`.\n\nBy default, this method calls [`Vec < \
11007 ClassString >::fold_children_with`]. If you want to recurse, you need to call it \
11008 manually."]
11009 #[inline]
11010 fn fold_class_strings(&mut self, node: Vec<ClassString>) -> Vec<ClassString> {
11011 <Vec<ClassString> as FoldWith<Self>>::fold_children_with(node, self)
11012 }
11013 #[doc = "Visit a node of type `Disjunction`.\n\nBy default, this method calls \
11014 [`Disjunction::fold_children_with`]. If you want to recurse, you need to call it \
11015 manually."]
11016 #[inline]
11017 fn fold_disjunction(&mut self, node: Disjunction) -> Disjunction {
11018 <Disjunction as FoldWith<Self>>::fold_children_with(node, self)
11019 }
11020 #[doc = "Visit a node of type `Dot`.\n\nBy default, this method calls \
11021 [`Dot::fold_children_with`]. If you want to recurse, you need to call it manually."]
11022 #[inline]
11023 fn fold_dot(&mut self, node: Dot) -> Dot {
11024 <Dot as FoldWith<Self>>::fold_children_with(node, self)
11025 }
11026 #[doc = "Visit a node of type `IgnoreGroup`.\n\nBy default, this method calls \
11027 [`IgnoreGroup::fold_children_with`]. If you want to recurse, you need to call it \
11028 manually."]
11029 #[inline]
11030 fn fold_ignore_group(&mut self, node: IgnoreGroup) -> IgnoreGroup {
11031 <IgnoreGroup as FoldWith<Self>>::fold_children_with(node, self)
11032 }
11033 #[doc = "Visit a node of type `IndexedReference`.\n\nBy default, this method calls \
11034 [`IndexedReference::fold_children_with`]. If you want to recurse, you need to call it \
11035 manually."]
11036 #[inline]
11037 fn fold_indexed_reference(&mut self, node: IndexedReference) -> IndexedReference {
11038 <IndexedReference as FoldWith<Self>>::fold_children_with(node, self)
11039 }
11040 #[doc = "Visit a node of type `LookAroundAssertion`.\n\nBy default, this method calls \
11041 [`LookAroundAssertion::fold_children_with`]. If you want to recurse, you need to call \
11042 it manually."]
11043 #[inline]
11044 fn fold_look_around_assertion(&mut self, node: LookAroundAssertion) -> LookAroundAssertion {
11045 <LookAroundAssertion as FoldWith<Self>>::fold_children_with(node, self)
11046 }
11047 #[doc = "Visit a node of type `LookAroundAssertionKind`.\n\nBy default, this method calls \
11048 [`LookAroundAssertionKind::fold_children_with`]. If you want to recurse, you need to \
11049 call it manually."]
11050 #[inline]
11051 fn fold_look_around_assertion_kind(
11052 &mut self,
11053 node: LookAroundAssertionKind,
11054 ) -> LookAroundAssertionKind {
11055 <LookAroundAssertionKind as FoldWith<Self>>::fold_children_with(node, self)
11056 }
11057 #[doc = "Visit a node of type `Modifier`.\n\nBy default, this method calls \
11058 [`Modifier::fold_children_with`]. If you want to recurse, you need to call it \
11059 manually."]
11060 #[inline]
11061 fn fold_modifier(&mut self, node: Modifier) -> Modifier {
11062 <Modifier as FoldWith<Self>>::fold_children_with(node, self)
11063 }
11064 #[doc = "Visit a node of type `Modifiers`.\n\nBy default, this method calls \
11065 [`Modifiers::fold_children_with`]. If you want to recurse, you need to call it \
11066 manually."]
11067 #[inline]
11068 fn fold_modifiers(&mut self, node: Modifiers) -> Modifiers {
11069 <Modifiers as FoldWith<Self>>::fold_children_with(node, self)
11070 }
11071 #[doc = "Visit a node of type `NamedReference`.\n\nBy default, this method calls \
11072 [`NamedReference::fold_children_with`]. If you want to recurse, you need to call it \
11073 manually."]
11074 #[inline]
11075 fn fold_named_reference(&mut self, node: NamedReference) -> NamedReference {
11076 <NamedReference as FoldWith<Self>>::fold_children_with(node, self)
11077 }
11078 #[doc = "Visit a node of type `Option < swc_atoms :: Atom >`.\n\nBy default, this method calls \
11079 [`Option < swc_atoms :: Atom >::fold_children_with`]. If you want to recurse, you \
11080 need to call it manually."]
11081 #[inline]
11082 fn fold_opt_atom(&mut self, node: Option<swc_atoms::Atom>) -> Option<swc_atoms::Atom> {
11083 <Option<swc_atoms::Atom> as FoldWith<Self>>::fold_children_with(node, self)
11084 }
11085 #[doc = "Visit a node of type `Option < Modifiers >`.\n\nBy default, this method calls \
11086 [`Option < Modifiers >::fold_children_with`]. If you want to recurse, you need to \
11087 call it manually."]
11088 #[inline]
11089 fn fold_opt_modifiers(&mut self, node: Option<Modifiers>) -> Option<Modifiers> {
11090 <Option<Modifiers> as FoldWith<Self>>::fold_children_with(node, self)
11091 }
11092 #[doc = "Visit a node of type `Pattern`.\n\nBy default, this method calls \
11093 [`Pattern::fold_children_with`]. If you want to recurse, you need to call it manually."]
11094 #[inline]
11095 fn fold_pattern(&mut self, node: Pattern) -> Pattern {
11096 <Pattern as FoldWith<Self>>::fold_children_with(node, self)
11097 }
11098 #[doc = "Visit a node of type `Quantifier`.\n\nBy default, this method calls \
11099 [`Quantifier::fold_children_with`]. If you want to recurse, you need to call it \
11100 manually."]
11101 #[inline]
11102 fn fold_quantifier(&mut self, node: Quantifier) -> Quantifier {
11103 <Quantifier as FoldWith<Self>>::fold_children_with(node, self)
11104 }
11105 #[doc = "Visit a node of type `swc_common :: Span`.\n\nBy default, this method calls \
11106 [`swc_common :: Span::fold_children_with`]. If you want to recurse, you need to call \
11107 it manually."]
11108 #[inline]
11109 fn fold_span(&mut self, node: swc_common::Span) -> swc_common::Span {
11110 <swc_common::Span as FoldWith<Self>>::fold_children_with(node, self)
11111 }
11112 #[doc = "Visit a node of type `Term`.\n\nBy default, this method calls \
11113 [`Term::fold_children_with`]. If you want to recurse, you need to call it manually."]
11114 #[inline]
11115 fn fold_term(&mut self, node: Term) -> Term {
11116 <Term as FoldWith<Self>>::fold_children_with(node, self)
11117 }
11118 #[doc = "Visit a node of type `Vec < Term >`.\n\nBy default, this method calls [`Vec < Term \
11119 >::fold_children_with`]. If you want to recurse, you need to call it manually."]
11120 #[inline]
11121 fn fold_terms(&mut self, node: Vec<Term>) -> Vec<Term> {
11122 <Vec<Term> as FoldWith<Self>>::fold_children_with(node, self)
11123 }
11124 #[doc = "Visit a node of type `UnicodePropertyEscape`.\n\nBy default, this method calls \
11125 [`UnicodePropertyEscape::fold_children_with`]. If you want to recurse, you need to \
11126 call it manually."]
11127 #[inline]
11128 fn fold_unicode_property_escape(
11129 &mut self,
11130 node: UnicodePropertyEscape,
11131 ) -> UnicodePropertyEscape {
11132 <UnicodePropertyEscape as FoldWith<Self>>::fold_children_with(node, self)
11133 }
11134}
11135impl<V> Fold for &mut V
11136where
11137 V: ?Sized + Fold,
11138{
11139 #[inline]
11140 fn fold_alternative(&mut self, node: Alternative) -> Alternative {
11141 <V as Fold>::fold_alternative(&mut **self, node)
11142 }
11143
11144 #[inline]
11145 fn fold_alternatives(&mut self, node: Vec<Alternative>) -> Vec<Alternative> {
11146 <V as Fold>::fold_alternatives(&mut **self, node)
11147 }
11148
11149 #[inline]
11150 fn fold_atom(&mut self, node: swc_atoms::Atom) -> swc_atoms::Atom {
11151 <V as Fold>::fold_atom(&mut **self, node)
11152 }
11153
11154 #[inline]
11155 fn fold_boundary_assertion(&mut self, node: BoundaryAssertion) -> BoundaryAssertion {
11156 <V as Fold>::fold_boundary_assertion(&mut **self, node)
11157 }
11158
11159 #[inline]
11160 fn fold_boundary_assertion_kind(
11161 &mut self,
11162 node: BoundaryAssertionKind,
11163 ) -> BoundaryAssertionKind {
11164 <V as Fold>::fold_boundary_assertion_kind(&mut **self, node)
11165 }
11166
11167 #[inline]
11168 fn fold_capturing_group(&mut self, node: CapturingGroup) -> CapturingGroup {
11169 <V as Fold>::fold_capturing_group(&mut **self, node)
11170 }
11171
11172 #[inline]
11173 fn fold_character(&mut self, node: Character) -> Character {
11174 <V as Fold>::fold_character(&mut **self, node)
11175 }
11176
11177 #[inline]
11178 fn fold_character_class(&mut self, node: CharacterClass) -> CharacterClass {
11179 <V as Fold>::fold_character_class(&mut **self, node)
11180 }
11181
11182 #[inline]
11183 fn fold_character_class_contents(
11184 &mut self,
11185 node: CharacterClassContents,
11186 ) -> CharacterClassContents {
11187 <V as Fold>::fold_character_class_contents(&mut **self, node)
11188 }
11189
11190 #[inline]
11191 fn fold_character_class_contents_kind(
11192 &mut self,
11193 node: CharacterClassContentsKind,
11194 ) -> CharacterClassContentsKind {
11195 <V as Fold>::fold_character_class_contents_kind(&mut **self, node)
11196 }
11197
11198 #[inline]
11199 fn fold_character_class_contentss(
11200 &mut self,
11201 node: Vec<CharacterClassContents>,
11202 ) -> Vec<CharacterClassContents> {
11203 <V as Fold>::fold_character_class_contentss(&mut **self, node)
11204 }
11205
11206 #[inline]
11207 fn fold_character_class_escape(&mut self, node: CharacterClassEscape) -> CharacterClassEscape {
11208 <V as Fold>::fold_character_class_escape(&mut **self, node)
11209 }
11210
11211 #[inline]
11212 fn fold_character_class_escape_kind(
11213 &mut self,
11214 node: CharacterClassEscapeKind,
11215 ) -> CharacterClassEscapeKind {
11216 <V as Fold>::fold_character_class_escape_kind(&mut **self, node)
11217 }
11218
11219 #[inline]
11220 fn fold_character_class_range(&mut self, node: CharacterClassRange) -> CharacterClassRange {
11221 <V as Fold>::fold_character_class_range(&mut **self, node)
11222 }
11223
11224 #[inline]
11225 fn fold_character_kind(&mut self, node: CharacterKind) -> CharacterKind {
11226 <V as Fold>::fold_character_kind(&mut **self, node)
11227 }
11228
11229 #[inline]
11230 fn fold_characters(&mut self, node: Vec<Character>) -> Vec<Character> {
11231 <V as Fold>::fold_characters(&mut **self, node)
11232 }
11233
11234 #[inline]
11235 fn fold_class_string(&mut self, node: ClassString) -> ClassString {
11236 <V as Fold>::fold_class_string(&mut **self, node)
11237 }
11238
11239 #[inline]
11240 fn fold_class_string_disjunction(
11241 &mut self,
11242 node: ClassStringDisjunction,
11243 ) -> ClassStringDisjunction {
11244 <V as Fold>::fold_class_string_disjunction(&mut **self, node)
11245 }
11246
11247 #[inline]
11248 fn fold_class_strings(&mut self, node: Vec<ClassString>) -> Vec<ClassString> {
11249 <V as Fold>::fold_class_strings(&mut **self, node)
11250 }
11251
11252 #[inline]
11253 fn fold_disjunction(&mut self, node: Disjunction) -> Disjunction {
11254 <V as Fold>::fold_disjunction(&mut **self, node)
11255 }
11256
11257 #[inline]
11258 fn fold_dot(&mut self, node: Dot) -> Dot {
11259 <V as Fold>::fold_dot(&mut **self, node)
11260 }
11261
11262 #[inline]
11263 fn fold_ignore_group(&mut self, node: IgnoreGroup) -> IgnoreGroup {
11264 <V as Fold>::fold_ignore_group(&mut **self, node)
11265 }
11266
11267 #[inline]
11268 fn fold_indexed_reference(&mut self, node: IndexedReference) -> IndexedReference {
11269 <V as Fold>::fold_indexed_reference(&mut **self, node)
11270 }
11271
11272 #[inline]
11273 fn fold_look_around_assertion(&mut self, node: LookAroundAssertion) -> LookAroundAssertion {
11274 <V as Fold>::fold_look_around_assertion(&mut **self, node)
11275 }
11276
11277 #[inline]
11278 fn fold_look_around_assertion_kind(
11279 &mut self,
11280 node: LookAroundAssertionKind,
11281 ) -> LookAroundAssertionKind {
11282 <V as Fold>::fold_look_around_assertion_kind(&mut **self, node)
11283 }
11284
11285 #[inline]
11286 fn fold_modifier(&mut self, node: Modifier) -> Modifier {
11287 <V as Fold>::fold_modifier(&mut **self, node)
11288 }
11289
11290 #[inline]
11291 fn fold_modifiers(&mut self, node: Modifiers) -> Modifiers {
11292 <V as Fold>::fold_modifiers(&mut **self, node)
11293 }
11294
11295 #[inline]
11296 fn fold_named_reference(&mut self, node: NamedReference) -> NamedReference {
11297 <V as Fold>::fold_named_reference(&mut **self, node)
11298 }
11299
11300 #[inline]
11301 fn fold_opt_atom(&mut self, node: Option<swc_atoms::Atom>) -> Option<swc_atoms::Atom> {
11302 <V as Fold>::fold_opt_atom(&mut **self, node)
11303 }
11304
11305 #[inline]
11306 fn fold_opt_modifiers(&mut self, node: Option<Modifiers>) -> Option<Modifiers> {
11307 <V as Fold>::fold_opt_modifiers(&mut **self, node)
11308 }
11309
11310 #[inline]
11311 fn fold_pattern(&mut self, node: Pattern) -> Pattern {
11312 <V as Fold>::fold_pattern(&mut **self, node)
11313 }
11314
11315 #[inline]
11316 fn fold_quantifier(&mut self, node: Quantifier) -> Quantifier {
11317 <V as Fold>::fold_quantifier(&mut **self, node)
11318 }
11319
11320 #[inline]
11321 fn fold_span(&mut self, node: swc_common::Span) -> swc_common::Span {
11322 <V as Fold>::fold_span(&mut **self, node)
11323 }
11324
11325 #[inline]
11326 fn fold_term(&mut self, node: Term) -> Term {
11327 <V as Fold>::fold_term(&mut **self, node)
11328 }
11329
11330 #[inline]
11331 fn fold_terms(&mut self, node: Vec<Term>) -> Vec<Term> {
11332 <V as Fold>::fold_terms(&mut **self, node)
11333 }
11334
11335 #[inline]
11336 fn fold_unicode_property_escape(
11337 &mut self,
11338 node: UnicodePropertyEscape,
11339 ) -> UnicodePropertyEscape {
11340 <V as Fold>::fold_unicode_property_escape(&mut **self, node)
11341 }
11342}
11343impl<V> Fold for Box<V>
11344where
11345 V: ?Sized + Fold,
11346{
11347 #[inline]
11348 fn fold_alternative(&mut self, node: Alternative) -> Alternative {
11349 <V as Fold>::fold_alternative(&mut **self, node)
11350 }
11351
11352 #[inline]
11353 fn fold_alternatives(&mut self, node: Vec<Alternative>) -> Vec<Alternative> {
11354 <V as Fold>::fold_alternatives(&mut **self, node)
11355 }
11356
11357 #[inline]
11358 fn fold_atom(&mut self, node: swc_atoms::Atom) -> swc_atoms::Atom {
11359 <V as Fold>::fold_atom(&mut **self, node)
11360 }
11361
11362 #[inline]
11363 fn fold_boundary_assertion(&mut self, node: BoundaryAssertion) -> BoundaryAssertion {
11364 <V as Fold>::fold_boundary_assertion(&mut **self, node)
11365 }
11366
11367 #[inline]
11368 fn fold_boundary_assertion_kind(
11369 &mut self,
11370 node: BoundaryAssertionKind,
11371 ) -> BoundaryAssertionKind {
11372 <V as Fold>::fold_boundary_assertion_kind(&mut **self, node)
11373 }
11374
11375 #[inline]
11376 fn fold_capturing_group(&mut self, node: CapturingGroup) -> CapturingGroup {
11377 <V as Fold>::fold_capturing_group(&mut **self, node)
11378 }
11379
11380 #[inline]
11381 fn fold_character(&mut self, node: Character) -> Character {
11382 <V as Fold>::fold_character(&mut **self, node)
11383 }
11384
11385 #[inline]
11386 fn fold_character_class(&mut self, node: CharacterClass) -> CharacterClass {
11387 <V as Fold>::fold_character_class(&mut **self, node)
11388 }
11389
11390 #[inline]
11391 fn fold_character_class_contents(
11392 &mut self,
11393 node: CharacterClassContents,
11394 ) -> CharacterClassContents {
11395 <V as Fold>::fold_character_class_contents(&mut **self, node)
11396 }
11397
11398 #[inline]
11399 fn fold_character_class_contents_kind(
11400 &mut self,
11401 node: CharacterClassContentsKind,
11402 ) -> CharacterClassContentsKind {
11403 <V as Fold>::fold_character_class_contents_kind(&mut **self, node)
11404 }
11405
11406 #[inline]
11407 fn fold_character_class_contentss(
11408 &mut self,
11409 node: Vec<CharacterClassContents>,
11410 ) -> Vec<CharacterClassContents> {
11411 <V as Fold>::fold_character_class_contentss(&mut **self, node)
11412 }
11413
11414 #[inline]
11415 fn fold_character_class_escape(&mut self, node: CharacterClassEscape) -> CharacterClassEscape {
11416 <V as Fold>::fold_character_class_escape(&mut **self, node)
11417 }
11418
11419 #[inline]
11420 fn fold_character_class_escape_kind(
11421 &mut self,
11422 node: CharacterClassEscapeKind,
11423 ) -> CharacterClassEscapeKind {
11424 <V as Fold>::fold_character_class_escape_kind(&mut **self, node)
11425 }
11426
11427 #[inline]
11428 fn fold_character_class_range(&mut self, node: CharacterClassRange) -> CharacterClassRange {
11429 <V as Fold>::fold_character_class_range(&mut **self, node)
11430 }
11431
11432 #[inline]
11433 fn fold_character_kind(&mut self, node: CharacterKind) -> CharacterKind {
11434 <V as Fold>::fold_character_kind(&mut **self, node)
11435 }
11436
11437 #[inline]
11438 fn fold_characters(&mut self, node: Vec<Character>) -> Vec<Character> {
11439 <V as Fold>::fold_characters(&mut **self, node)
11440 }
11441
11442 #[inline]
11443 fn fold_class_string(&mut self, node: ClassString) -> ClassString {
11444 <V as Fold>::fold_class_string(&mut **self, node)
11445 }
11446
11447 #[inline]
11448 fn fold_class_string_disjunction(
11449 &mut self,
11450 node: ClassStringDisjunction,
11451 ) -> ClassStringDisjunction {
11452 <V as Fold>::fold_class_string_disjunction(&mut **self, node)
11453 }
11454
11455 #[inline]
11456 fn fold_class_strings(&mut self, node: Vec<ClassString>) -> Vec<ClassString> {
11457 <V as Fold>::fold_class_strings(&mut **self, node)
11458 }
11459
11460 #[inline]
11461 fn fold_disjunction(&mut self, node: Disjunction) -> Disjunction {
11462 <V as Fold>::fold_disjunction(&mut **self, node)
11463 }
11464
11465 #[inline]
11466 fn fold_dot(&mut self, node: Dot) -> Dot {
11467 <V as Fold>::fold_dot(&mut **self, node)
11468 }
11469
11470 #[inline]
11471 fn fold_ignore_group(&mut self, node: IgnoreGroup) -> IgnoreGroup {
11472 <V as Fold>::fold_ignore_group(&mut **self, node)
11473 }
11474
11475 #[inline]
11476 fn fold_indexed_reference(&mut self, node: IndexedReference) -> IndexedReference {
11477 <V as Fold>::fold_indexed_reference(&mut **self, node)
11478 }
11479
11480 #[inline]
11481 fn fold_look_around_assertion(&mut self, node: LookAroundAssertion) -> LookAroundAssertion {
11482 <V as Fold>::fold_look_around_assertion(&mut **self, node)
11483 }
11484
11485 #[inline]
11486 fn fold_look_around_assertion_kind(
11487 &mut self,
11488 node: LookAroundAssertionKind,
11489 ) -> LookAroundAssertionKind {
11490 <V as Fold>::fold_look_around_assertion_kind(&mut **self, node)
11491 }
11492
11493 #[inline]
11494 fn fold_modifier(&mut self, node: Modifier) -> Modifier {
11495 <V as Fold>::fold_modifier(&mut **self, node)
11496 }
11497
11498 #[inline]
11499 fn fold_modifiers(&mut self, node: Modifiers) -> Modifiers {
11500 <V as Fold>::fold_modifiers(&mut **self, node)
11501 }
11502
11503 #[inline]
11504 fn fold_named_reference(&mut self, node: NamedReference) -> NamedReference {
11505 <V as Fold>::fold_named_reference(&mut **self, node)
11506 }
11507
11508 #[inline]
11509 fn fold_opt_atom(&mut self, node: Option<swc_atoms::Atom>) -> Option<swc_atoms::Atom> {
11510 <V as Fold>::fold_opt_atom(&mut **self, node)
11511 }
11512
11513 #[inline]
11514 fn fold_opt_modifiers(&mut self, node: Option<Modifiers>) -> Option<Modifiers> {
11515 <V as Fold>::fold_opt_modifiers(&mut **self, node)
11516 }
11517
11518 #[inline]
11519 fn fold_pattern(&mut self, node: Pattern) -> Pattern {
11520 <V as Fold>::fold_pattern(&mut **self, node)
11521 }
11522
11523 #[inline]
11524 fn fold_quantifier(&mut self, node: Quantifier) -> Quantifier {
11525 <V as Fold>::fold_quantifier(&mut **self, node)
11526 }
11527
11528 #[inline]
11529 fn fold_span(&mut self, node: swc_common::Span) -> swc_common::Span {
11530 <V as Fold>::fold_span(&mut **self, node)
11531 }
11532
11533 #[inline]
11534 fn fold_term(&mut self, node: Term) -> Term {
11535 <V as Fold>::fold_term(&mut **self, node)
11536 }
11537
11538 #[inline]
11539 fn fold_terms(&mut self, node: Vec<Term>) -> Vec<Term> {
11540 <V as Fold>::fold_terms(&mut **self, node)
11541 }
11542
11543 #[inline]
11544 fn fold_unicode_property_escape(
11545 &mut self,
11546 node: UnicodePropertyEscape,
11547 ) -> UnicodePropertyEscape {
11548 <V as Fold>::fold_unicode_property_escape(&mut **self, node)
11549 }
11550}
11551impl<A, B> Fold for ::swc_visit::Either<A, B>
11552where
11553 A: Fold,
11554 B: Fold,
11555{
11556 #[inline]
11557 fn fold_alternative(&mut self, node: Alternative) -> Alternative {
11558 match self {
11559 swc_visit::Either::Left(visitor) => Fold::fold_alternative(visitor, node),
11560 swc_visit::Either::Right(visitor) => Fold::fold_alternative(visitor, node),
11561 }
11562 }
11563
11564 #[inline]
11565 fn fold_alternatives(&mut self, node: Vec<Alternative>) -> Vec<Alternative> {
11566 match self {
11567 swc_visit::Either::Left(visitor) => Fold::fold_alternatives(visitor, node),
11568 swc_visit::Either::Right(visitor) => Fold::fold_alternatives(visitor, node),
11569 }
11570 }
11571
11572 #[inline]
11573 fn fold_atom(&mut self, node: swc_atoms::Atom) -> swc_atoms::Atom {
11574 match self {
11575 swc_visit::Either::Left(visitor) => Fold::fold_atom(visitor, node),
11576 swc_visit::Either::Right(visitor) => Fold::fold_atom(visitor, node),
11577 }
11578 }
11579
11580 #[inline]
11581 fn fold_boundary_assertion(&mut self, node: BoundaryAssertion) -> BoundaryAssertion {
11582 match self {
11583 swc_visit::Either::Left(visitor) => Fold::fold_boundary_assertion(visitor, node),
11584 swc_visit::Either::Right(visitor) => Fold::fold_boundary_assertion(visitor, node),
11585 }
11586 }
11587
11588 #[inline]
11589 fn fold_boundary_assertion_kind(
11590 &mut self,
11591 node: BoundaryAssertionKind,
11592 ) -> BoundaryAssertionKind {
11593 match self {
11594 swc_visit::Either::Left(visitor) => Fold::fold_boundary_assertion_kind(visitor, node),
11595 swc_visit::Either::Right(visitor) => Fold::fold_boundary_assertion_kind(visitor, node),
11596 }
11597 }
11598
11599 #[inline]
11600 fn fold_capturing_group(&mut self, node: CapturingGroup) -> CapturingGroup {
11601 match self {
11602 swc_visit::Either::Left(visitor) => Fold::fold_capturing_group(visitor, node),
11603 swc_visit::Either::Right(visitor) => Fold::fold_capturing_group(visitor, node),
11604 }
11605 }
11606
11607 #[inline]
11608 fn fold_character(&mut self, node: Character) -> Character {
11609 match self {
11610 swc_visit::Either::Left(visitor) => Fold::fold_character(visitor, node),
11611 swc_visit::Either::Right(visitor) => Fold::fold_character(visitor, node),
11612 }
11613 }
11614
11615 #[inline]
11616 fn fold_character_class(&mut self, node: CharacterClass) -> CharacterClass {
11617 match self {
11618 swc_visit::Either::Left(visitor) => Fold::fold_character_class(visitor, node),
11619 swc_visit::Either::Right(visitor) => Fold::fold_character_class(visitor, node),
11620 }
11621 }
11622
11623 #[inline]
11624 fn fold_character_class_contents(
11625 &mut self,
11626 node: CharacterClassContents,
11627 ) -> CharacterClassContents {
11628 match self {
11629 swc_visit::Either::Left(visitor) => Fold::fold_character_class_contents(visitor, node),
11630 swc_visit::Either::Right(visitor) => Fold::fold_character_class_contents(visitor, node),
11631 }
11632 }
11633
11634 #[inline]
11635 fn fold_character_class_contents_kind(
11636 &mut self,
11637 node: CharacterClassContentsKind,
11638 ) -> CharacterClassContentsKind {
11639 match self {
11640 swc_visit::Either::Left(visitor) => {
11641 Fold::fold_character_class_contents_kind(visitor, node)
11642 }
11643 swc_visit::Either::Right(visitor) => {
11644 Fold::fold_character_class_contents_kind(visitor, node)
11645 }
11646 }
11647 }
11648
11649 #[inline]
11650 fn fold_character_class_contentss(
11651 &mut self,
11652 node: Vec<CharacterClassContents>,
11653 ) -> Vec<CharacterClassContents> {
11654 match self {
11655 swc_visit::Either::Left(visitor) => Fold::fold_character_class_contentss(visitor, node),
11656 swc_visit::Either::Right(visitor) => {
11657 Fold::fold_character_class_contentss(visitor, node)
11658 }
11659 }
11660 }
11661
11662 #[inline]
11663 fn fold_character_class_escape(&mut self, node: CharacterClassEscape) -> CharacterClassEscape {
11664 match self {
11665 swc_visit::Either::Left(visitor) => Fold::fold_character_class_escape(visitor, node),
11666 swc_visit::Either::Right(visitor) => Fold::fold_character_class_escape(visitor, node),
11667 }
11668 }
11669
11670 #[inline]
11671 fn fold_character_class_escape_kind(
11672 &mut self,
11673 node: CharacterClassEscapeKind,
11674 ) -> CharacterClassEscapeKind {
11675 match self {
11676 swc_visit::Either::Left(visitor) => {
11677 Fold::fold_character_class_escape_kind(visitor, node)
11678 }
11679 swc_visit::Either::Right(visitor) => {
11680 Fold::fold_character_class_escape_kind(visitor, node)
11681 }
11682 }
11683 }
11684
11685 #[inline]
11686 fn fold_character_class_range(&mut self, node: CharacterClassRange) -> CharacterClassRange {
11687 match self {
11688 swc_visit::Either::Left(visitor) => Fold::fold_character_class_range(visitor, node),
11689 swc_visit::Either::Right(visitor) => Fold::fold_character_class_range(visitor, node),
11690 }
11691 }
11692
11693 #[inline]
11694 fn fold_character_kind(&mut self, node: CharacterKind) -> CharacterKind {
11695 match self {
11696 swc_visit::Either::Left(visitor) => Fold::fold_character_kind(visitor, node),
11697 swc_visit::Either::Right(visitor) => Fold::fold_character_kind(visitor, node),
11698 }
11699 }
11700
11701 #[inline]
11702 fn fold_characters(&mut self, node: Vec<Character>) -> Vec<Character> {
11703 match self {
11704 swc_visit::Either::Left(visitor) => Fold::fold_characters(visitor, node),
11705 swc_visit::Either::Right(visitor) => Fold::fold_characters(visitor, node),
11706 }
11707 }
11708
11709 #[inline]
11710 fn fold_class_string(&mut self, node: ClassString) -> ClassString {
11711 match self {
11712 swc_visit::Either::Left(visitor) => Fold::fold_class_string(visitor, node),
11713 swc_visit::Either::Right(visitor) => Fold::fold_class_string(visitor, node),
11714 }
11715 }
11716
11717 #[inline]
11718 fn fold_class_string_disjunction(
11719 &mut self,
11720 node: ClassStringDisjunction,
11721 ) -> ClassStringDisjunction {
11722 match self {
11723 swc_visit::Either::Left(visitor) => Fold::fold_class_string_disjunction(visitor, node),
11724 swc_visit::Either::Right(visitor) => Fold::fold_class_string_disjunction(visitor, node),
11725 }
11726 }
11727
11728 #[inline]
11729 fn fold_class_strings(&mut self, node: Vec<ClassString>) -> Vec<ClassString> {
11730 match self {
11731 swc_visit::Either::Left(visitor) => Fold::fold_class_strings(visitor, node),
11732 swc_visit::Either::Right(visitor) => Fold::fold_class_strings(visitor, node),
11733 }
11734 }
11735
11736 #[inline]
11737 fn fold_disjunction(&mut self, node: Disjunction) -> Disjunction {
11738 match self {
11739 swc_visit::Either::Left(visitor) => Fold::fold_disjunction(visitor, node),
11740 swc_visit::Either::Right(visitor) => Fold::fold_disjunction(visitor, node),
11741 }
11742 }
11743
11744 #[inline]
11745 fn fold_dot(&mut self, node: Dot) -> Dot {
11746 match self {
11747 swc_visit::Either::Left(visitor) => Fold::fold_dot(visitor, node),
11748 swc_visit::Either::Right(visitor) => Fold::fold_dot(visitor, node),
11749 }
11750 }
11751
11752 #[inline]
11753 fn fold_ignore_group(&mut self, node: IgnoreGroup) -> IgnoreGroup {
11754 match self {
11755 swc_visit::Either::Left(visitor) => Fold::fold_ignore_group(visitor, node),
11756 swc_visit::Either::Right(visitor) => Fold::fold_ignore_group(visitor, node),
11757 }
11758 }
11759
11760 #[inline]
11761 fn fold_indexed_reference(&mut self, node: IndexedReference) -> IndexedReference {
11762 match self {
11763 swc_visit::Either::Left(visitor) => Fold::fold_indexed_reference(visitor, node),
11764 swc_visit::Either::Right(visitor) => Fold::fold_indexed_reference(visitor, node),
11765 }
11766 }
11767
11768 #[inline]
11769 fn fold_look_around_assertion(&mut self, node: LookAroundAssertion) -> LookAroundAssertion {
11770 match self {
11771 swc_visit::Either::Left(visitor) => Fold::fold_look_around_assertion(visitor, node),
11772 swc_visit::Either::Right(visitor) => Fold::fold_look_around_assertion(visitor, node),
11773 }
11774 }
11775
11776 #[inline]
11777 fn fold_look_around_assertion_kind(
11778 &mut self,
11779 node: LookAroundAssertionKind,
11780 ) -> LookAroundAssertionKind {
11781 match self {
11782 swc_visit::Either::Left(visitor) => {
11783 Fold::fold_look_around_assertion_kind(visitor, node)
11784 }
11785 swc_visit::Either::Right(visitor) => {
11786 Fold::fold_look_around_assertion_kind(visitor, node)
11787 }
11788 }
11789 }
11790
11791 #[inline]
11792 fn fold_modifier(&mut self, node: Modifier) -> Modifier {
11793 match self {
11794 swc_visit::Either::Left(visitor) => Fold::fold_modifier(visitor, node),
11795 swc_visit::Either::Right(visitor) => Fold::fold_modifier(visitor, node),
11796 }
11797 }
11798
11799 #[inline]
11800 fn fold_modifiers(&mut self, node: Modifiers) -> Modifiers {
11801 match self {
11802 swc_visit::Either::Left(visitor) => Fold::fold_modifiers(visitor, node),
11803 swc_visit::Either::Right(visitor) => Fold::fold_modifiers(visitor, node),
11804 }
11805 }
11806
11807 #[inline]
11808 fn fold_named_reference(&mut self, node: NamedReference) -> NamedReference {
11809 match self {
11810 swc_visit::Either::Left(visitor) => Fold::fold_named_reference(visitor, node),
11811 swc_visit::Either::Right(visitor) => Fold::fold_named_reference(visitor, node),
11812 }
11813 }
11814
11815 #[inline]
11816 fn fold_opt_atom(&mut self, node: Option<swc_atoms::Atom>) -> Option<swc_atoms::Atom> {
11817 match self {
11818 swc_visit::Either::Left(visitor) => Fold::fold_opt_atom(visitor, node),
11819 swc_visit::Either::Right(visitor) => Fold::fold_opt_atom(visitor, node),
11820 }
11821 }
11822
11823 #[inline]
11824 fn fold_opt_modifiers(&mut self, node: Option<Modifiers>) -> Option<Modifiers> {
11825 match self {
11826 swc_visit::Either::Left(visitor) => Fold::fold_opt_modifiers(visitor, node),
11827 swc_visit::Either::Right(visitor) => Fold::fold_opt_modifiers(visitor, node),
11828 }
11829 }
11830
11831 #[inline]
11832 fn fold_pattern(&mut self, node: Pattern) -> Pattern {
11833 match self {
11834 swc_visit::Either::Left(visitor) => Fold::fold_pattern(visitor, node),
11835 swc_visit::Either::Right(visitor) => Fold::fold_pattern(visitor, node),
11836 }
11837 }
11838
11839 #[inline]
11840 fn fold_quantifier(&mut self, node: Quantifier) -> Quantifier {
11841 match self {
11842 swc_visit::Either::Left(visitor) => Fold::fold_quantifier(visitor, node),
11843 swc_visit::Either::Right(visitor) => Fold::fold_quantifier(visitor, node),
11844 }
11845 }
11846
11847 #[inline]
11848 fn fold_span(&mut self, node: swc_common::Span) -> swc_common::Span {
11849 match self {
11850 swc_visit::Either::Left(visitor) => Fold::fold_span(visitor, node),
11851 swc_visit::Either::Right(visitor) => Fold::fold_span(visitor, node),
11852 }
11853 }
11854
11855 #[inline]
11856 fn fold_term(&mut self, node: Term) -> Term {
11857 match self {
11858 swc_visit::Either::Left(visitor) => Fold::fold_term(visitor, node),
11859 swc_visit::Either::Right(visitor) => Fold::fold_term(visitor, node),
11860 }
11861 }
11862
11863 #[inline]
11864 fn fold_terms(&mut self, node: Vec<Term>) -> Vec<Term> {
11865 match self {
11866 swc_visit::Either::Left(visitor) => Fold::fold_terms(visitor, node),
11867 swc_visit::Either::Right(visitor) => Fold::fold_terms(visitor, node),
11868 }
11869 }
11870
11871 #[inline]
11872 fn fold_unicode_property_escape(
11873 &mut self,
11874 node: UnicodePropertyEscape,
11875 ) -> UnicodePropertyEscape {
11876 match self {
11877 swc_visit::Either::Left(visitor) => Fold::fold_unicode_property_escape(visitor, node),
11878 swc_visit::Either::Right(visitor) => Fold::fold_unicode_property_escape(visitor, node),
11879 }
11880 }
11881}
11882impl<V> Fold for ::swc_visit::Optional<V>
11883where
11884 V: Fold,
11885{
11886 #[inline]
11887 fn fold_alternative(&mut self, node: Alternative) -> Alternative {
11888 if self.enabled {
11889 <V as Fold>::fold_alternative(&mut self.visitor, node)
11890 } else {
11891 node
11892 }
11893 }
11894
11895 #[inline]
11896 fn fold_alternatives(&mut self, node: Vec<Alternative>) -> Vec<Alternative> {
11897 if self.enabled {
11898 <V as Fold>::fold_alternatives(&mut self.visitor, node)
11899 } else {
11900 node
11901 }
11902 }
11903
11904 #[inline]
11905 fn fold_atom(&mut self, node: swc_atoms::Atom) -> swc_atoms::Atom {
11906 if self.enabled {
11907 <V as Fold>::fold_atom(&mut self.visitor, node)
11908 } else {
11909 node
11910 }
11911 }
11912
11913 #[inline]
11914 fn fold_boundary_assertion(&mut self, node: BoundaryAssertion) -> BoundaryAssertion {
11915 if self.enabled {
11916 <V as Fold>::fold_boundary_assertion(&mut self.visitor, node)
11917 } else {
11918 node
11919 }
11920 }
11921
11922 #[inline]
11923 fn fold_boundary_assertion_kind(
11924 &mut self,
11925 node: BoundaryAssertionKind,
11926 ) -> BoundaryAssertionKind {
11927 if self.enabled {
11928 <V as Fold>::fold_boundary_assertion_kind(&mut self.visitor, node)
11929 } else {
11930 node
11931 }
11932 }
11933
11934 #[inline]
11935 fn fold_capturing_group(&mut self, node: CapturingGroup) -> CapturingGroup {
11936 if self.enabled {
11937 <V as Fold>::fold_capturing_group(&mut self.visitor, node)
11938 } else {
11939 node
11940 }
11941 }
11942
11943 #[inline]
11944 fn fold_character(&mut self, node: Character) -> Character {
11945 if self.enabled {
11946 <V as Fold>::fold_character(&mut self.visitor, node)
11947 } else {
11948 node
11949 }
11950 }
11951
11952 #[inline]
11953 fn fold_character_class(&mut self, node: CharacterClass) -> CharacterClass {
11954 if self.enabled {
11955 <V as Fold>::fold_character_class(&mut self.visitor, node)
11956 } else {
11957 node
11958 }
11959 }
11960
11961 #[inline]
11962 fn fold_character_class_contents(
11963 &mut self,
11964 node: CharacterClassContents,
11965 ) -> CharacterClassContents {
11966 if self.enabled {
11967 <V as Fold>::fold_character_class_contents(&mut self.visitor, node)
11968 } else {
11969 node
11970 }
11971 }
11972
11973 #[inline]
11974 fn fold_character_class_contents_kind(
11975 &mut self,
11976 node: CharacterClassContentsKind,
11977 ) -> CharacterClassContentsKind {
11978 if self.enabled {
11979 <V as Fold>::fold_character_class_contents_kind(&mut self.visitor, node)
11980 } else {
11981 node
11982 }
11983 }
11984
11985 #[inline]
11986 fn fold_character_class_contentss(
11987 &mut self,
11988 node: Vec<CharacterClassContents>,
11989 ) -> Vec<CharacterClassContents> {
11990 if self.enabled {
11991 <V as Fold>::fold_character_class_contentss(&mut self.visitor, node)
11992 } else {
11993 node
11994 }
11995 }
11996
11997 #[inline]
11998 fn fold_character_class_escape(&mut self, node: CharacterClassEscape) -> CharacterClassEscape {
11999 if self.enabled {
12000 <V as Fold>::fold_character_class_escape(&mut self.visitor, node)
12001 } else {
12002 node
12003 }
12004 }
12005
12006 #[inline]
12007 fn fold_character_class_escape_kind(
12008 &mut self,
12009 node: CharacterClassEscapeKind,
12010 ) -> CharacterClassEscapeKind {
12011 if self.enabled {
12012 <V as Fold>::fold_character_class_escape_kind(&mut self.visitor, node)
12013 } else {
12014 node
12015 }
12016 }
12017
12018 #[inline]
12019 fn fold_character_class_range(&mut self, node: CharacterClassRange) -> CharacterClassRange {
12020 if self.enabled {
12021 <V as Fold>::fold_character_class_range(&mut self.visitor, node)
12022 } else {
12023 node
12024 }
12025 }
12026
12027 #[inline]
12028 fn fold_character_kind(&mut self, node: CharacterKind) -> CharacterKind {
12029 if self.enabled {
12030 <V as Fold>::fold_character_kind(&mut self.visitor, node)
12031 } else {
12032 node
12033 }
12034 }
12035
12036 #[inline]
12037 fn fold_characters(&mut self, node: Vec<Character>) -> Vec<Character> {
12038 if self.enabled {
12039 <V as Fold>::fold_characters(&mut self.visitor, node)
12040 } else {
12041 node
12042 }
12043 }
12044
12045 #[inline]
12046 fn fold_class_string(&mut self, node: ClassString) -> ClassString {
12047 if self.enabled {
12048 <V as Fold>::fold_class_string(&mut self.visitor, node)
12049 } else {
12050 node
12051 }
12052 }
12053
12054 #[inline]
12055 fn fold_class_string_disjunction(
12056 &mut self,
12057 node: ClassStringDisjunction,
12058 ) -> ClassStringDisjunction {
12059 if self.enabled {
12060 <V as Fold>::fold_class_string_disjunction(&mut self.visitor, node)
12061 } else {
12062 node
12063 }
12064 }
12065
12066 #[inline]
12067 fn fold_class_strings(&mut self, node: Vec<ClassString>) -> Vec<ClassString> {
12068 if self.enabled {
12069 <V as Fold>::fold_class_strings(&mut self.visitor, node)
12070 } else {
12071 node
12072 }
12073 }
12074
12075 #[inline]
12076 fn fold_disjunction(&mut self, node: Disjunction) -> Disjunction {
12077 if self.enabled {
12078 <V as Fold>::fold_disjunction(&mut self.visitor, node)
12079 } else {
12080 node
12081 }
12082 }
12083
12084 #[inline]
12085 fn fold_dot(&mut self, node: Dot) -> Dot {
12086 if self.enabled {
12087 <V as Fold>::fold_dot(&mut self.visitor, node)
12088 } else {
12089 node
12090 }
12091 }
12092
12093 #[inline]
12094 fn fold_ignore_group(&mut self, node: IgnoreGroup) -> IgnoreGroup {
12095 if self.enabled {
12096 <V as Fold>::fold_ignore_group(&mut self.visitor, node)
12097 } else {
12098 node
12099 }
12100 }
12101
12102 #[inline]
12103 fn fold_indexed_reference(&mut self, node: IndexedReference) -> IndexedReference {
12104 if self.enabled {
12105 <V as Fold>::fold_indexed_reference(&mut self.visitor, node)
12106 } else {
12107 node
12108 }
12109 }
12110
12111 #[inline]
12112 fn fold_look_around_assertion(&mut self, node: LookAroundAssertion) -> LookAroundAssertion {
12113 if self.enabled {
12114 <V as Fold>::fold_look_around_assertion(&mut self.visitor, node)
12115 } else {
12116 node
12117 }
12118 }
12119
12120 #[inline]
12121 fn fold_look_around_assertion_kind(
12122 &mut self,
12123 node: LookAroundAssertionKind,
12124 ) -> LookAroundAssertionKind {
12125 if self.enabled {
12126 <V as Fold>::fold_look_around_assertion_kind(&mut self.visitor, node)
12127 } else {
12128 node
12129 }
12130 }
12131
12132 #[inline]
12133 fn fold_modifier(&mut self, node: Modifier) -> Modifier {
12134 if self.enabled {
12135 <V as Fold>::fold_modifier(&mut self.visitor, node)
12136 } else {
12137 node
12138 }
12139 }
12140
12141 #[inline]
12142 fn fold_modifiers(&mut self, node: Modifiers) -> Modifiers {
12143 if self.enabled {
12144 <V as Fold>::fold_modifiers(&mut self.visitor, node)
12145 } else {
12146 node
12147 }
12148 }
12149
12150 #[inline]
12151 fn fold_named_reference(&mut self, node: NamedReference) -> NamedReference {
12152 if self.enabled {
12153 <V as Fold>::fold_named_reference(&mut self.visitor, node)
12154 } else {
12155 node
12156 }
12157 }
12158
12159 #[inline]
12160 fn fold_opt_atom(&mut self, node: Option<swc_atoms::Atom>) -> Option<swc_atoms::Atom> {
12161 if self.enabled {
12162 <V as Fold>::fold_opt_atom(&mut self.visitor, node)
12163 } else {
12164 node
12165 }
12166 }
12167
12168 #[inline]
12169 fn fold_opt_modifiers(&mut self, node: Option<Modifiers>) -> Option<Modifiers> {
12170 if self.enabled {
12171 <V as Fold>::fold_opt_modifiers(&mut self.visitor, node)
12172 } else {
12173 node
12174 }
12175 }
12176
12177 #[inline]
12178 fn fold_pattern(&mut self, node: Pattern) -> Pattern {
12179 if self.enabled {
12180 <V as Fold>::fold_pattern(&mut self.visitor, node)
12181 } else {
12182 node
12183 }
12184 }
12185
12186 #[inline]
12187 fn fold_quantifier(&mut self, node: Quantifier) -> Quantifier {
12188 if self.enabled {
12189 <V as Fold>::fold_quantifier(&mut self.visitor, node)
12190 } else {
12191 node
12192 }
12193 }
12194
12195 #[inline]
12196 fn fold_span(&mut self, node: swc_common::Span) -> swc_common::Span {
12197 if self.enabled {
12198 <V as Fold>::fold_span(&mut self.visitor, node)
12199 } else {
12200 node
12201 }
12202 }
12203
12204 #[inline]
12205 fn fold_term(&mut self, node: Term) -> Term {
12206 if self.enabled {
12207 <V as Fold>::fold_term(&mut self.visitor, node)
12208 } else {
12209 node
12210 }
12211 }
12212
12213 #[inline]
12214 fn fold_terms(&mut self, node: Vec<Term>) -> Vec<Term> {
12215 if self.enabled {
12216 <V as Fold>::fold_terms(&mut self.visitor, node)
12217 } else {
12218 node
12219 }
12220 }
12221
12222 #[inline]
12223 fn fold_unicode_property_escape(
12224 &mut self,
12225 node: UnicodePropertyEscape,
12226 ) -> UnicodePropertyEscape {
12227 if self.enabled {
12228 <V as Fold>::fold_unicode_property_escape(&mut self.visitor, node)
12229 } else {
12230 node
12231 }
12232 }
12233}
12234#[doc = r" A trait implemented for types that can be visited using a visitor."]
12235pub trait FoldWith<V: ?Sized + Fold> {
12236 #[doc = r" Calls a visitor method (visitor.fold_xxx) with self."]
12237 fn fold_with(self, visitor: &mut V) -> Self;
12238 #[doc = r" Visit children nodes of `self`` with `visitor`."]
12239 fn fold_children_with(self, visitor: &mut V) -> Self;
12240}
12241impl<V: ?Sized + Fold> FoldWith<V> for Alternative {
12242 #[doc = "Calls [Fold`::fold_alternative`] with `self`."]
12243 fn fold_with(self, visitor: &mut V) -> Self {
12244 <V as Fold>::fold_alternative(visitor, self)
12245 }
12246
12247 fn fold_children_with(self, visitor: &mut V) -> Self {
12248 match self {
12249 Alternative { span, body } => {
12250 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12251 let body = { <Vec<Term> as FoldWith<V>>::fold_with(body, visitor) };
12252 Alternative { span, body }
12253 }
12254 }
12255 }
12256}
12257impl<V: ?Sized + Fold> FoldWith<V> for BoundaryAssertion {
12258 #[doc = "Calls [Fold`::fold_boundary_assertion`] with `self`."]
12259 fn fold_with(self, visitor: &mut V) -> Self {
12260 <V as Fold>::fold_boundary_assertion(visitor, self)
12261 }
12262
12263 fn fold_children_with(self, visitor: &mut V) -> Self {
12264 match self {
12265 BoundaryAssertion { span, kind } => {
12266 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12267 let kind = { <BoundaryAssertionKind as FoldWith<V>>::fold_with(kind, visitor) };
12268 BoundaryAssertion { span, kind }
12269 }
12270 }
12271 }
12272}
12273impl<V: ?Sized + Fold> FoldWith<V> for BoundaryAssertionKind {
12274 #[doc = "Calls [Fold`::fold_boundary_assertion_kind`] with `self`."]
12275 fn fold_with(self, visitor: &mut V) -> Self {
12276 <V as Fold>::fold_boundary_assertion_kind(visitor, self)
12277 }
12278
12279 fn fold_children_with(self, visitor: &mut V) -> Self {
12280 match self {
12281 BoundaryAssertionKind::Start => BoundaryAssertionKind::Start,
12282 BoundaryAssertionKind::End => BoundaryAssertionKind::End,
12283 BoundaryAssertionKind::Boundary => BoundaryAssertionKind::Boundary,
12284 BoundaryAssertionKind::NegativeBoundary => BoundaryAssertionKind::NegativeBoundary,
12285 }
12286 }
12287}
12288impl<V: ?Sized + Fold> FoldWith<V> for CapturingGroup {
12289 #[doc = "Calls [Fold`::fold_capturing_group`] with `self`."]
12290 fn fold_with(self, visitor: &mut V) -> Self {
12291 <V as Fold>::fold_capturing_group(visitor, self)
12292 }
12293
12294 fn fold_children_with(self, visitor: &mut V) -> Self {
12295 match self {
12296 CapturingGroup { span, name, body } => {
12297 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12298 let name = { <Option<swc_atoms::Atom> as FoldWith<V>>::fold_with(name, visitor) };
12299 let body = { <Disjunction as FoldWith<V>>::fold_with(body, visitor) };
12300 CapturingGroup { span, name, body }
12301 }
12302 }
12303 }
12304}
12305impl<V: ?Sized + Fold> FoldWith<V> for Character {
12306 #[doc = "Calls [Fold`::fold_character`] with `self`."]
12307 fn fold_with(self, visitor: &mut V) -> Self {
12308 <V as Fold>::fold_character(visitor, self)
12309 }
12310
12311 fn fold_children_with(self, visitor: &mut V) -> Self {
12312 match self {
12313 Character { span, kind, value } => {
12314 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12315 let kind = { <CharacterKind as FoldWith<V>>::fold_with(kind, visitor) };
12316 Character { span, kind, value }
12317 }
12318 }
12319 }
12320}
12321impl<V: ?Sized + Fold> FoldWith<V> for CharacterClass {
12322 #[doc = "Calls [Fold`::fold_character_class`] with `self`."]
12323 fn fold_with(self, visitor: &mut V) -> Self {
12324 <V as Fold>::fold_character_class(visitor, self)
12325 }
12326
12327 fn fold_children_with(self, visitor: &mut V) -> Self {
12328 match self {
12329 CharacterClass {
12330 span,
12331 negative,
12332 strings,
12333 kind,
12334 body,
12335 } => {
12336 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12337 let kind =
12338 { <CharacterClassContentsKind as FoldWith<V>>::fold_with(kind, visitor) };
12339 let body =
12340 { <Vec<CharacterClassContents> as FoldWith<V>>::fold_with(body, visitor) };
12341 CharacterClass {
12342 span,
12343 negative,
12344 strings,
12345 kind,
12346 body,
12347 }
12348 }
12349 }
12350 }
12351}
12352impl<V: ?Sized + Fold> FoldWith<V> for CharacterClassContents {
12353 #[doc = "Calls [Fold`::fold_character_class_contents`] with `self`."]
12354 fn fold_with(self, visitor: &mut V) -> Self {
12355 <V as Fold>::fold_character_class_contents(visitor, self)
12356 }
12357
12358 fn fold_children_with(self, visitor: &mut V) -> Self {
12359 match self {
12360 CharacterClassContents::CharacterClassRange { 0: _field_0 } => {
12361 let _field_0 =
12362 <Box<CharacterClassRange> as FoldWith<V>>::fold_with(_field_0, visitor);
12363 CharacterClassContents::CharacterClassRange { 0: _field_0 }
12364 }
12365 CharacterClassContents::CharacterClassEscape { 0: _field_0 } => {
12366 let _field_0 =
12367 <Box<CharacterClassEscape> as FoldWith<V>>::fold_with(_field_0, visitor);
12368 CharacterClassContents::CharacterClassEscape { 0: _field_0 }
12369 }
12370 CharacterClassContents::UnicodePropertyEscape { 0: _field_0 } => {
12371 let _field_0 =
12372 <Box<UnicodePropertyEscape> as FoldWith<V>>::fold_with(_field_0, visitor);
12373 CharacterClassContents::UnicodePropertyEscape { 0: _field_0 }
12374 }
12375 CharacterClassContents::Character { 0: _field_0 } => {
12376 let _field_0 = <Box<Character> as FoldWith<V>>::fold_with(_field_0, visitor);
12377 CharacterClassContents::Character { 0: _field_0 }
12378 }
12379 CharacterClassContents::NestedCharacterClass { 0: _field_0 } => {
12380 let _field_0 = <Box<CharacterClass> as FoldWith<V>>::fold_with(_field_0, visitor);
12381 CharacterClassContents::NestedCharacterClass { 0: _field_0 }
12382 }
12383 CharacterClassContents::ClassStringDisjunction { 0: _field_0 } => {
12384 let _field_0 =
12385 <Box<ClassStringDisjunction> as FoldWith<V>>::fold_with(_field_0, visitor);
12386 CharacterClassContents::ClassStringDisjunction { 0: _field_0 }
12387 }
12388 }
12389 }
12390}
12391impl<V: ?Sized + Fold> FoldWith<V> for CharacterClassContentsKind {
12392 #[doc = "Calls [Fold`::fold_character_class_contents_kind`] with `self`."]
12393 fn fold_with(self, visitor: &mut V) -> Self {
12394 <V as Fold>::fold_character_class_contents_kind(visitor, self)
12395 }
12396
12397 fn fold_children_with(self, visitor: &mut V) -> Self {
12398 match self {
12399 CharacterClassContentsKind::Union => CharacterClassContentsKind::Union,
12400 CharacterClassContentsKind::Intersection => CharacterClassContentsKind::Intersection,
12401 CharacterClassContentsKind::Subtraction => CharacterClassContentsKind::Subtraction,
12402 }
12403 }
12404}
12405impl<V: ?Sized + Fold> FoldWith<V> for CharacterClassEscape {
12406 #[doc = "Calls [Fold`::fold_character_class_escape`] with `self`."]
12407 fn fold_with(self, visitor: &mut V) -> Self {
12408 <V as Fold>::fold_character_class_escape(visitor, self)
12409 }
12410
12411 fn fold_children_with(self, visitor: &mut V) -> Self {
12412 match self {
12413 CharacterClassEscape { span, kind } => {
12414 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12415 let kind = { <CharacterClassEscapeKind as FoldWith<V>>::fold_with(kind, visitor) };
12416 CharacterClassEscape { span, kind }
12417 }
12418 }
12419 }
12420}
12421impl<V: ?Sized + Fold> FoldWith<V> for CharacterClassEscapeKind {
12422 #[doc = "Calls [Fold`::fold_character_class_escape_kind`] with `self`."]
12423 fn fold_with(self, visitor: &mut V) -> Self {
12424 <V as Fold>::fold_character_class_escape_kind(visitor, self)
12425 }
12426
12427 fn fold_children_with(self, visitor: &mut V) -> Self {
12428 match self {
12429 CharacterClassEscapeKind::D => CharacterClassEscapeKind::D,
12430 CharacterClassEscapeKind::NegativeD => CharacterClassEscapeKind::NegativeD,
12431 CharacterClassEscapeKind::S => CharacterClassEscapeKind::S,
12432 CharacterClassEscapeKind::NegativeS => CharacterClassEscapeKind::NegativeS,
12433 CharacterClassEscapeKind::W => CharacterClassEscapeKind::W,
12434 CharacterClassEscapeKind::NegativeW => CharacterClassEscapeKind::NegativeW,
12435 }
12436 }
12437}
12438impl<V: ?Sized + Fold> FoldWith<V> for CharacterClassRange {
12439 #[doc = "Calls [Fold`::fold_character_class_range`] with `self`."]
12440 fn fold_with(self, visitor: &mut V) -> Self {
12441 <V as Fold>::fold_character_class_range(visitor, self)
12442 }
12443
12444 fn fold_children_with(self, visitor: &mut V) -> Self {
12445 match self {
12446 CharacterClassRange { span, min, max } => {
12447 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12448 let min = { <Character as FoldWith<V>>::fold_with(min, visitor) };
12449 let max = { <Character as FoldWith<V>>::fold_with(max, visitor) };
12450 CharacterClassRange { span, min, max }
12451 }
12452 }
12453 }
12454}
12455impl<V: ?Sized + Fold> FoldWith<V> for CharacterKind {
12456 #[doc = "Calls [Fold`::fold_character_kind`] with `self`."]
12457 fn fold_with(self, visitor: &mut V) -> Self {
12458 <V as Fold>::fold_character_kind(visitor, self)
12459 }
12460
12461 fn fold_children_with(self, visitor: &mut V) -> Self {
12462 match self {
12463 CharacterKind::ControlLetter => CharacterKind::ControlLetter,
12464 CharacterKind::HexadecimalEscape => CharacterKind::HexadecimalEscape,
12465 CharacterKind::Identifier => CharacterKind::Identifier,
12466 CharacterKind::Null => CharacterKind::Null,
12467 CharacterKind::Octal1 => CharacterKind::Octal1,
12468 CharacterKind::Octal2 => CharacterKind::Octal2,
12469 CharacterKind::Octal3 => CharacterKind::Octal3,
12470 CharacterKind::SingleEscape => CharacterKind::SingleEscape,
12471 CharacterKind::Symbol => CharacterKind::Symbol,
12472 CharacterKind::UnicodeEscape => CharacterKind::UnicodeEscape,
12473 }
12474 }
12475}
12476impl<V: ?Sized + Fold> FoldWith<V> for ClassString {
12477 #[doc = "Calls [Fold`::fold_class_string`] with `self`."]
12478 fn fold_with(self, visitor: &mut V) -> Self {
12479 <V as Fold>::fold_class_string(visitor, self)
12480 }
12481
12482 fn fold_children_with(self, visitor: &mut V) -> Self {
12483 match self {
12484 ClassString {
12485 span,
12486 strings,
12487 body,
12488 } => {
12489 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12490 let body = { <Vec<Character> as FoldWith<V>>::fold_with(body, visitor) };
12491 ClassString {
12492 span,
12493 strings,
12494 body,
12495 }
12496 }
12497 }
12498 }
12499}
12500impl<V: ?Sized + Fold> FoldWith<V> for ClassStringDisjunction {
12501 #[doc = "Calls [Fold`::fold_class_string_disjunction`] with `self`."]
12502 fn fold_with(self, visitor: &mut V) -> Self {
12503 <V as Fold>::fold_class_string_disjunction(visitor, self)
12504 }
12505
12506 fn fold_children_with(self, visitor: &mut V) -> Self {
12507 match self {
12508 ClassStringDisjunction {
12509 span,
12510 strings,
12511 body,
12512 } => {
12513 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12514 let body = { <Vec<ClassString> as FoldWith<V>>::fold_with(body, visitor) };
12515 ClassStringDisjunction {
12516 span,
12517 strings,
12518 body,
12519 }
12520 }
12521 }
12522 }
12523}
12524impl<V: ?Sized + Fold> FoldWith<V> for Disjunction {
12525 #[doc = "Calls [Fold`::fold_disjunction`] with `self`."]
12526 fn fold_with(self, visitor: &mut V) -> Self {
12527 <V as Fold>::fold_disjunction(visitor, self)
12528 }
12529
12530 fn fold_children_with(self, visitor: &mut V) -> Self {
12531 match self {
12532 Disjunction { span, body } => {
12533 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12534 let body = { <Vec<Alternative> as FoldWith<V>>::fold_with(body, visitor) };
12535 Disjunction { span, body }
12536 }
12537 }
12538 }
12539}
12540impl<V: ?Sized + Fold> FoldWith<V> for Dot {
12541 #[doc = "Calls [Fold`::fold_dot`] with `self`."]
12542 fn fold_with(self, visitor: &mut V) -> Self {
12543 <V as Fold>::fold_dot(visitor, self)
12544 }
12545
12546 fn fold_children_with(self, visitor: &mut V) -> Self {
12547 match self {
12548 Dot { span } => {
12549 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12550 Dot { span }
12551 }
12552 }
12553 }
12554}
12555impl<V: ?Sized + Fold> FoldWith<V> for IgnoreGroup {
12556 #[doc = "Calls [Fold`::fold_ignore_group`] with `self`."]
12557 fn fold_with(self, visitor: &mut V) -> Self {
12558 <V as Fold>::fold_ignore_group(visitor, self)
12559 }
12560
12561 fn fold_children_with(self, visitor: &mut V) -> Self {
12562 match self {
12563 IgnoreGroup {
12564 span,
12565 modifiers,
12566 body,
12567 } => {
12568 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12569 let modifiers =
12570 { <Option<Modifiers> as FoldWith<V>>::fold_with(modifiers, visitor) };
12571 let body = { <Disjunction as FoldWith<V>>::fold_with(body, visitor) };
12572 IgnoreGroup {
12573 span,
12574 modifiers,
12575 body,
12576 }
12577 }
12578 }
12579 }
12580}
12581impl<V: ?Sized + Fold> FoldWith<V> for IndexedReference {
12582 #[doc = "Calls [Fold`::fold_indexed_reference`] with `self`."]
12583 fn fold_with(self, visitor: &mut V) -> Self {
12584 <V as Fold>::fold_indexed_reference(visitor, self)
12585 }
12586
12587 fn fold_children_with(self, visitor: &mut V) -> Self {
12588 match self {
12589 IndexedReference { span, index } => {
12590 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12591 IndexedReference { span, index }
12592 }
12593 }
12594 }
12595}
12596impl<V: ?Sized + Fold> FoldWith<V> for LookAroundAssertion {
12597 #[doc = "Calls [Fold`::fold_look_around_assertion`] with `self`."]
12598 fn fold_with(self, visitor: &mut V) -> Self {
12599 <V as Fold>::fold_look_around_assertion(visitor, self)
12600 }
12601
12602 fn fold_children_with(self, visitor: &mut V) -> Self {
12603 match self {
12604 LookAroundAssertion { span, kind, body } => {
12605 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12606 let kind = { <LookAroundAssertionKind as FoldWith<V>>::fold_with(kind, visitor) };
12607 let body = { <Disjunction as FoldWith<V>>::fold_with(body, visitor) };
12608 LookAroundAssertion { span, kind, body }
12609 }
12610 }
12611 }
12612}
12613impl<V: ?Sized + Fold> FoldWith<V> for LookAroundAssertionKind {
12614 #[doc = "Calls [Fold`::fold_look_around_assertion_kind`] with `self`."]
12615 fn fold_with(self, visitor: &mut V) -> Self {
12616 <V as Fold>::fold_look_around_assertion_kind(visitor, self)
12617 }
12618
12619 fn fold_children_with(self, visitor: &mut V) -> Self {
12620 match self {
12621 LookAroundAssertionKind::Lookahead => LookAroundAssertionKind::Lookahead,
12622 LookAroundAssertionKind::NegativeLookahead => {
12623 LookAroundAssertionKind::NegativeLookahead
12624 }
12625 LookAroundAssertionKind::Lookbehind => LookAroundAssertionKind::Lookbehind,
12626 LookAroundAssertionKind::NegativeLookbehind => {
12627 LookAroundAssertionKind::NegativeLookbehind
12628 }
12629 }
12630 }
12631}
12632impl<V: ?Sized + Fold> FoldWith<V> for Modifiers {
12633 #[doc = "Calls [Fold`::fold_modifiers`] with `self`."]
12634 fn fold_with(self, visitor: &mut V) -> Self {
12635 <V as Fold>::fold_modifiers(visitor, self)
12636 }
12637
12638 fn fold_children_with(self, visitor: &mut V) -> Self {
12639 match self {
12640 Modifiers {
12641 span,
12642 enabling,
12643 disabling,
12644 } => {
12645 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12646 let enabling = { <Modifier as FoldWith<V>>::fold_with(enabling, visitor) };
12647 let disabling = { <Modifier as FoldWith<V>>::fold_with(disabling, visitor) };
12648 Modifiers {
12649 span,
12650 enabling,
12651 disabling,
12652 }
12653 }
12654 }
12655 }
12656}
12657impl<V: ?Sized + Fold> FoldWith<V> for NamedReference {
12658 #[doc = "Calls [Fold`::fold_named_reference`] with `self`."]
12659 fn fold_with(self, visitor: &mut V) -> Self {
12660 <V as Fold>::fold_named_reference(visitor, self)
12661 }
12662
12663 fn fold_children_with(self, visitor: &mut V) -> Self {
12664 match self {
12665 NamedReference { span, name } => {
12666 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12667 let name = { <swc_atoms::Atom as FoldWith<V>>::fold_with(name, visitor) };
12668 NamedReference { span, name }
12669 }
12670 }
12671 }
12672}
12673impl<V: ?Sized + Fold> FoldWith<V> for Pattern {
12674 #[doc = "Calls [Fold`::fold_pattern`] with `self`."]
12675 fn fold_with(self, visitor: &mut V) -> Self {
12676 <V as Fold>::fold_pattern(visitor, self)
12677 }
12678
12679 fn fold_children_with(self, visitor: &mut V) -> Self {
12680 match self {
12681 Pattern { span, body } => {
12682 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12683 let body = { <Disjunction as FoldWith<V>>::fold_with(body, visitor) };
12684 Pattern { span, body }
12685 }
12686 }
12687 }
12688}
12689impl<V: ?Sized + Fold> FoldWith<V> for Quantifier {
12690 #[doc = "Calls [Fold`::fold_quantifier`] with `self`."]
12691 fn fold_with(self, visitor: &mut V) -> Self {
12692 <V as Fold>::fold_quantifier(visitor, self)
12693 }
12694
12695 fn fold_children_with(self, visitor: &mut V) -> Self {
12696 match self {
12697 Quantifier {
12698 span,
12699 min,
12700 max,
12701 greedy,
12702 body,
12703 } => {
12704 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12705 let body = { <Term as FoldWith<V>>::fold_with(body, visitor) };
12706 Quantifier {
12707 span,
12708 min,
12709 max,
12710 greedy,
12711 body,
12712 }
12713 }
12714 }
12715 }
12716}
12717impl<V: ?Sized + Fold> FoldWith<V> for Term {
12718 #[doc = "Calls [Fold`::fold_term`] with `self`."]
12719 fn fold_with(self, visitor: &mut V) -> Self {
12720 <V as Fold>::fold_term(visitor, self)
12721 }
12722
12723 fn fold_children_with(self, visitor: &mut V) -> Self {
12724 match self {
12725 Term::BoundaryAssertion { 0: _field_0 } => {
12726 let _field_0 =
12727 <Box<BoundaryAssertion> as FoldWith<V>>::fold_with(_field_0, visitor);
12728 Term::BoundaryAssertion { 0: _field_0 }
12729 }
12730 Term::LookAroundAssertion { 0: _field_0 } => {
12731 let _field_0 =
12732 <Box<LookAroundAssertion> as FoldWith<V>>::fold_with(_field_0, visitor);
12733 Term::LookAroundAssertion { 0: _field_0 }
12734 }
12735 Term::Quantifier { 0: _field_0 } => {
12736 let _field_0 = <Box<Quantifier> as FoldWith<V>>::fold_with(_field_0, visitor);
12737 Term::Quantifier { 0: _field_0 }
12738 }
12739 Term::Character { 0: _field_0 } => {
12740 let _field_0 = <Box<Character> as FoldWith<V>>::fold_with(_field_0, visitor);
12741 Term::Character { 0: _field_0 }
12742 }
12743 Term::Dot { 0: _field_0 } => {
12744 let _field_0 = <Dot as FoldWith<V>>::fold_with(_field_0, visitor);
12745 Term::Dot { 0: _field_0 }
12746 }
12747 Term::CharacterClassEscape { 0: _field_0 } => {
12748 let _field_0 =
12749 <Box<CharacterClassEscape> as FoldWith<V>>::fold_with(_field_0, visitor);
12750 Term::CharacterClassEscape { 0: _field_0 }
12751 }
12752 Term::UnicodePropertyEscape { 0: _field_0 } => {
12753 let _field_0 =
12754 <Box<UnicodePropertyEscape> as FoldWith<V>>::fold_with(_field_0, visitor);
12755 Term::UnicodePropertyEscape { 0: _field_0 }
12756 }
12757 Term::CharacterClass { 0: _field_0 } => {
12758 let _field_0 = <Box<CharacterClass> as FoldWith<V>>::fold_with(_field_0, visitor);
12759 Term::CharacterClass { 0: _field_0 }
12760 }
12761 Term::CapturingGroup { 0: _field_0 } => {
12762 let _field_0 = <Box<CapturingGroup> as FoldWith<V>>::fold_with(_field_0, visitor);
12763 Term::CapturingGroup { 0: _field_0 }
12764 }
12765 Term::IgnoreGroup { 0: _field_0 } => {
12766 let _field_0 = <Box<IgnoreGroup> as FoldWith<V>>::fold_with(_field_0, visitor);
12767 Term::IgnoreGroup { 0: _field_0 }
12768 }
12769 Term::IndexedReference { 0: _field_0 } => {
12770 let _field_0 = <Box<IndexedReference> as FoldWith<V>>::fold_with(_field_0, visitor);
12771 Term::IndexedReference { 0: _field_0 }
12772 }
12773 Term::NamedReference { 0: _field_0 } => {
12774 let _field_0 = <Box<NamedReference> as FoldWith<V>>::fold_with(_field_0, visitor);
12775 Term::NamedReference { 0: _field_0 }
12776 }
12777 }
12778 }
12779}
12780impl<V: ?Sized + Fold> FoldWith<V> for UnicodePropertyEscape {
12781 #[doc = "Calls [Fold`::fold_unicode_property_escape`] with `self`."]
12782 fn fold_with(self, visitor: &mut V) -> Self {
12783 <V as Fold>::fold_unicode_property_escape(visitor, self)
12784 }
12785
12786 fn fold_children_with(self, visitor: &mut V) -> Self {
12787 match self {
12788 UnicodePropertyEscape {
12789 span,
12790 negative,
12791 strings,
12792 name,
12793 value,
12794 } => {
12795 let span = { <swc_common::Span as FoldWith<V>>::fold_with(span, visitor) };
12796 let name = { <swc_atoms::Atom as FoldWith<V>>::fold_with(name, visitor) };
12797 let value = { <Option<swc_atoms::Atom> as FoldWith<V>>::fold_with(value, visitor) };
12798 UnicodePropertyEscape {
12799 span,
12800 negative,
12801 strings,
12802 name,
12803 value,
12804 }
12805 }
12806 }
12807 }
12808}
12809impl<V: ?Sized + Fold> FoldWith<V> for Vec<Alternative> {
12810 #[doc = "Calls [Fold`::fold_alternatives`] with `self`. (Extra impl)"]
12811 #[inline]
12812 fn fold_with(self, visitor: &mut V) -> Self {
12813 <V as Fold>::fold_alternatives(visitor, self)
12814 }
12815
12816 #[inline]
12817 fn fold_children_with(self, visitor: &mut V) -> Self {
12818 swc_visit::util::move_map::MoveMap::move_map(self, |item| {
12819 <Alternative as FoldWith<V>>::fold_with(item, visitor)
12820 })
12821 }
12822}
12823impl<V: ?Sized + Fold> FoldWith<V> for swc_atoms::Atom {
12824 #[doc = "Calls [Fold`::fold_atom`] with `self`. (Extra impl)"]
12825 #[inline]
12826 fn fold_with(self, visitor: &mut V) -> Self {
12827 <V as Fold>::fold_atom(visitor, self)
12828 }
12829
12830 #[inline]
12831 fn fold_children_with(self, visitor: &mut V) -> Self {
12832 self
12833 }
12834}
12835impl<V: ?Sized + Fold> FoldWith<V> for Vec<CharacterClassContents> {
12836 #[doc = "Calls [Fold`::fold_character_class_contentss`] with `self`. (Extra impl)"]
12837 #[inline]
12838 fn fold_with(self, visitor: &mut V) -> Self {
12839 <V as Fold>::fold_character_class_contentss(visitor, self)
12840 }
12841
12842 #[inline]
12843 fn fold_children_with(self, visitor: &mut V) -> Self {
12844 swc_visit::util::move_map::MoveMap::move_map(self, |item| {
12845 <CharacterClassContents as FoldWith<V>>::fold_with(item, visitor)
12846 })
12847 }
12848}
12849impl<V: ?Sized + Fold> FoldWith<V> for Vec<Character> {
12850 #[doc = "Calls [Fold`::fold_characters`] with `self`. (Extra impl)"]
12851 #[inline]
12852 fn fold_with(self, visitor: &mut V) -> Self {
12853 <V as Fold>::fold_characters(visitor, self)
12854 }
12855
12856 #[inline]
12857 fn fold_children_with(self, visitor: &mut V) -> Self {
12858 swc_visit::util::move_map::MoveMap::move_map(self, |item| {
12859 <Character as FoldWith<V>>::fold_with(item, visitor)
12860 })
12861 }
12862}
12863impl<V: ?Sized + Fold> FoldWith<V> for Vec<ClassString> {
12864 #[doc = "Calls [Fold`::fold_class_strings`] with `self`. (Extra impl)"]
12865 #[inline]
12866 fn fold_with(self, visitor: &mut V) -> Self {
12867 <V as Fold>::fold_class_strings(visitor, self)
12868 }
12869
12870 #[inline]
12871 fn fold_children_with(self, visitor: &mut V) -> Self {
12872 swc_visit::util::move_map::MoveMap::move_map(self, |item| {
12873 <ClassString as FoldWith<V>>::fold_with(item, visitor)
12874 })
12875 }
12876}
12877impl<V: ?Sized + Fold> FoldWith<V> for Modifier {
12878 #[doc = "Calls [Fold`::fold_modifier`] with `self`. (Extra impl)"]
12879 #[inline]
12880 fn fold_with(self, visitor: &mut V) -> Self {
12881 <V as Fold>::fold_modifier(visitor, self)
12882 }
12883
12884 #[inline]
12885 fn fold_children_with(self, visitor: &mut V) -> Self {
12886 self
12887 }
12888}
12889impl<V: ?Sized + Fold> FoldWith<V> for Option<swc_atoms::Atom> {
12890 #[doc = "Calls [Fold`::fold_opt_atom`] with `self`. (Extra impl)"]
12891 #[inline]
12892 fn fold_with(self, visitor: &mut V) -> Self {
12893 <V as Fold>::fold_opt_atom(visitor, self)
12894 }
12895
12896 #[inline]
12897 fn fold_children_with(self, visitor: &mut V) -> Self {
12898 self.map(|inner| <swc_atoms::Atom as FoldWith<V>>::fold_with(inner, visitor))
12899 }
12900}
12901impl<V: ?Sized + Fold> FoldWith<V> for Option<Modifiers> {
12902 #[doc = "Calls [Fold`::fold_opt_modifiers`] with `self`. (Extra impl)"]
12903 #[inline]
12904 fn fold_with(self, visitor: &mut V) -> Self {
12905 <V as Fold>::fold_opt_modifiers(visitor, self)
12906 }
12907
12908 #[inline]
12909 fn fold_children_with(self, visitor: &mut V) -> Self {
12910 self.map(|inner| <Modifiers as FoldWith<V>>::fold_with(inner, visitor))
12911 }
12912}
12913impl<V: ?Sized + Fold> FoldWith<V> for swc_common::Span {
12914 #[doc = "Calls [Fold`::fold_span`] with `self`. (Extra impl)"]
12915 #[inline]
12916 fn fold_with(self, visitor: &mut V) -> Self {
12917 <V as Fold>::fold_span(visitor, self)
12918 }
12919
12920 #[inline]
12921 fn fold_children_with(self, visitor: &mut V) -> Self {
12922 self
12923 }
12924}
12925impl<V: ?Sized + Fold> FoldWith<V> for Vec<Term> {
12926 #[doc = "Calls [Fold`::fold_terms`] with `self`. (Extra impl)"]
12927 #[inline]
12928 fn fold_with(self, visitor: &mut V) -> Self {
12929 <V as Fold>::fold_terms(visitor, self)
12930 }
12931
12932 #[inline]
12933 fn fold_children_with(self, visitor: &mut V) -> Self {
12934 swc_visit::util::move_map::MoveMap::move_map(self, |item| {
12935 <Term as FoldWith<V>>::fold_with(item, visitor)
12936 })
12937 }
12938}
12939impl<V, T> FoldWith<V> for std::boxed::Box<T>
12940where
12941 V: ?Sized + Fold,
12942 T: FoldWith<V>,
12943{
12944 #[inline]
12945 fn fold_with(self, visitor: &mut V) -> Self {
12946 swc_visit::util::map::Map::map(self, |inner| <T as FoldWith<V>>::fold_with(inner, visitor))
12947 }
12948
12949 #[inline]
12950 fn fold_children_with(self, visitor: &mut V) -> Self {
12951 swc_visit::util::map::Map::map(self, |inner| {
12952 <T as FoldWith<V>>::fold_children_with(inner, visitor)
12953 })
12954 }
12955}
12956#[doc = r" A visitor trait for traversing the AST."]
12957#[cfg(any(docsrs, feature = "path"))]
12958#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
12959pub trait FoldAstPath {
12960 #[doc = "Visit a node of type `Alternative`.\n\nBy default, this method calls \
12961 [`Alternative::fold_children_with_ast_path`]. If you want to recurse, you need to \
12962 call it manually."]
12963 #[inline]
12964 fn fold_alternative(&mut self, node: Alternative, __ast_path: &mut AstKindPath) -> Alternative {
12965 <Alternative as FoldWithAstPath<Self>>::fold_children_with_ast_path(node, self, __ast_path)
12966 }
12967 #[doc = "Visit a node of type `Vec < Alternative >`.\n\nBy default, this method calls [`Vec < \
12968 Alternative >::fold_children_with_ast_path`]. If you want to recurse, you need to \
12969 call it manually."]
12970 #[inline]
12971 fn fold_alternatives(
12972 &mut self,
12973 node: Vec<Alternative>,
12974 __ast_path: &mut AstKindPath,
12975 ) -> Vec<Alternative> {
12976 <Vec<Alternative> as FoldWithAstPath<Self>>::fold_children_with_ast_path(
12977 node, self, __ast_path,
12978 )
12979 }
12980 #[doc = "Visit a node of type `swc_atoms :: Atom`.\n\nBy default, this method calls \
12981 [`swc_atoms :: Atom::fold_children_with_ast_path`]. If you want to recurse, you need \
12982 to call it manually."]
12983 #[inline]
12984 fn fold_atom(
12985 &mut self,
12986 node: swc_atoms::Atom,
12987 __ast_path: &mut AstKindPath,
12988 ) -> swc_atoms::Atom {
12989 <swc_atoms::Atom as FoldWithAstPath<Self>>::fold_children_with_ast_path(
12990 node, self, __ast_path,
12991 )
12992 }
12993 #[doc = "Visit a node of type `BoundaryAssertion`.\n\nBy default, this method calls \
12994 [`BoundaryAssertion::fold_children_with_ast_path`]. If you want to recurse, you need \
12995 to call it manually."]
12996 #[inline]
12997 fn fold_boundary_assertion(
12998 &mut self,
12999 node: BoundaryAssertion,
13000 __ast_path: &mut AstKindPath,
13001 ) -> BoundaryAssertion {
13002 <BoundaryAssertion as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13003 node, self, __ast_path,
13004 )
13005 }
13006 #[doc = "Visit a node of type `BoundaryAssertionKind`.\n\nBy default, this method calls \
13007 [`BoundaryAssertionKind::fold_children_with_ast_path`]. If you want to recurse, you \
13008 need to call it manually."]
13009 #[inline]
13010 fn fold_boundary_assertion_kind(
13011 &mut self,
13012 node: BoundaryAssertionKind,
13013 __ast_path: &mut AstKindPath,
13014 ) -> BoundaryAssertionKind {
13015 <BoundaryAssertionKind as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13016 node, self, __ast_path,
13017 )
13018 }
13019 #[doc = "Visit a node of type `CapturingGroup`.\n\nBy default, this method calls \
13020 [`CapturingGroup::fold_children_with_ast_path`]. If you want to recurse, you need to \
13021 call it manually."]
13022 #[inline]
13023 fn fold_capturing_group(
13024 &mut self,
13025 node: CapturingGroup,
13026 __ast_path: &mut AstKindPath,
13027 ) -> CapturingGroup {
13028 <CapturingGroup as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13029 node, self, __ast_path,
13030 )
13031 }
13032 #[doc = "Visit a node of type `Character`.\n\nBy default, this method calls \
13033 [`Character::fold_children_with_ast_path`]. If you want to recurse, you need to call \
13034 it manually."]
13035 #[inline]
13036 fn fold_character(&mut self, node: Character, __ast_path: &mut AstKindPath) -> Character {
13037 <Character as FoldWithAstPath<Self>>::fold_children_with_ast_path(node, self, __ast_path)
13038 }
13039 #[doc = "Visit a node of type `CharacterClass`.\n\nBy default, this method calls \
13040 [`CharacterClass::fold_children_with_ast_path`]. If you want to recurse, you need to \
13041 call it manually."]
13042 #[inline]
13043 fn fold_character_class(
13044 &mut self,
13045 node: CharacterClass,
13046 __ast_path: &mut AstKindPath,
13047 ) -> CharacterClass {
13048 <CharacterClass as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13049 node, self, __ast_path,
13050 )
13051 }
13052 #[doc = "Visit a node of type `CharacterClassContents`.\n\nBy default, this method calls \
13053 [`CharacterClassContents::fold_children_with_ast_path`]. If you want to recurse, you \
13054 need to call it manually."]
13055 #[inline]
13056 fn fold_character_class_contents(
13057 &mut self,
13058 node: CharacterClassContents,
13059 __ast_path: &mut AstKindPath,
13060 ) -> CharacterClassContents {
13061 <CharacterClassContents as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13062 node, self, __ast_path,
13063 )
13064 }
13065 #[doc = "Visit a node of type `CharacterClassContentsKind`.\n\nBy default, this method calls \
13066 [`CharacterClassContentsKind::fold_children_with_ast_path`]. If you want to recurse, \
13067 you need to call it manually."]
13068 #[inline]
13069 fn fold_character_class_contents_kind(
13070 &mut self,
13071 node: CharacterClassContentsKind,
13072 __ast_path: &mut AstKindPath,
13073 ) -> CharacterClassContentsKind {
13074 <CharacterClassContentsKind as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13075 node, self, __ast_path,
13076 )
13077 }
13078 #[doc = "Visit a node of type `Vec < CharacterClassContents >`.\n\nBy default, this method \
13079 calls [`Vec < CharacterClassContents >::fold_children_with_ast_path`]. If you want to \
13080 recurse, you need to call it manually."]
13081 #[inline]
13082 fn fold_character_class_contentss(
13083 &mut self,
13084 node: Vec<CharacterClassContents>,
13085 __ast_path: &mut AstKindPath,
13086 ) -> Vec<CharacterClassContents> {
13087 <Vec<CharacterClassContents> as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13088 node, self, __ast_path,
13089 )
13090 }
13091 #[doc = "Visit a node of type `CharacterClassEscape`.\n\nBy default, this method calls \
13092 [`CharacterClassEscape::fold_children_with_ast_path`]. If you want to recurse, you \
13093 need to call it manually."]
13094 #[inline]
13095 fn fold_character_class_escape(
13096 &mut self,
13097 node: CharacterClassEscape,
13098 __ast_path: &mut AstKindPath,
13099 ) -> CharacterClassEscape {
13100 <CharacterClassEscape as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13101 node, self, __ast_path,
13102 )
13103 }
13104 #[doc = "Visit a node of type `CharacterClassEscapeKind`.\n\nBy default, this method calls \
13105 [`CharacterClassEscapeKind::fold_children_with_ast_path`]. If you want to recurse, \
13106 you need to call it manually."]
13107 #[inline]
13108 fn fold_character_class_escape_kind(
13109 &mut self,
13110 node: CharacterClassEscapeKind,
13111 __ast_path: &mut AstKindPath,
13112 ) -> CharacterClassEscapeKind {
13113 <CharacterClassEscapeKind as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13114 node, self, __ast_path,
13115 )
13116 }
13117 #[doc = "Visit a node of type `CharacterClassRange`.\n\nBy default, this method calls \
13118 [`CharacterClassRange::fold_children_with_ast_path`]. If you want to recurse, you \
13119 need to call it manually."]
13120 #[inline]
13121 fn fold_character_class_range(
13122 &mut self,
13123 node: CharacterClassRange,
13124 __ast_path: &mut AstKindPath,
13125 ) -> CharacterClassRange {
13126 <CharacterClassRange as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13127 node, self, __ast_path,
13128 )
13129 }
13130 #[doc = "Visit a node of type `CharacterKind`.\n\nBy default, this method calls \
13131 [`CharacterKind::fold_children_with_ast_path`]. If you want to recurse, you need to \
13132 call it manually."]
13133 #[inline]
13134 fn fold_character_kind(
13135 &mut self,
13136 node: CharacterKind,
13137 __ast_path: &mut AstKindPath,
13138 ) -> CharacterKind {
13139 <CharacterKind as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13140 node, self, __ast_path,
13141 )
13142 }
13143 #[doc = "Visit a node of type `Vec < Character >`.\n\nBy default, this method calls [`Vec < \
13144 Character >::fold_children_with_ast_path`]. If you want to recurse, you need to call \
13145 it manually."]
13146 #[inline]
13147 fn fold_characters(
13148 &mut self,
13149 node: Vec<Character>,
13150 __ast_path: &mut AstKindPath,
13151 ) -> Vec<Character> {
13152 <Vec<Character> as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13153 node, self, __ast_path,
13154 )
13155 }
13156 #[doc = "Visit a node of type `ClassString`.\n\nBy default, this method calls \
13157 [`ClassString::fold_children_with_ast_path`]. If you want to recurse, you need to \
13158 call it manually."]
13159 #[inline]
13160 fn fold_class_string(
13161 &mut self,
13162 node: ClassString,
13163 __ast_path: &mut AstKindPath,
13164 ) -> ClassString {
13165 <ClassString as FoldWithAstPath<Self>>::fold_children_with_ast_path(node, self, __ast_path)
13166 }
13167 #[doc = "Visit a node of type `ClassStringDisjunction`.\n\nBy default, this method calls \
13168 [`ClassStringDisjunction::fold_children_with_ast_path`]. If you want to recurse, you \
13169 need to call it manually."]
13170 #[inline]
13171 fn fold_class_string_disjunction(
13172 &mut self,
13173 node: ClassStringDisjunction,
13174 __ast_path: &mut AstKindPath,
13175 ) -> ClassStringDisjunction {
13176 <ClassStringDisjunction as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13177 node, self, __ast_path,
13178 )
13179 }
13180 #[doc = "Visit a node of type `Vec < ClassString >`.\n\nBy default, this method calls [`Vec < \
13181 ClassString >::fold_children_with_ast_path`]. If you want to recurse, you need to \
13182 call it manually."]
13183 #[inline]
13184 fn fold_class_strings(
13185 &mut self,
13186 node: Vec<ClassString>,
13187 __ast_path: &mut AstKindPath,
13188 ) -> Vec<ClassString> {
13189 <Vec<ClassString> as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13190 node, self, __ast_path,
13191 )
13192 }
13193 #[doc = "Visit a node of type `Disjunction`.\n\nBy default, this method calls \
13194 [`Disjunction::fold_children_with_ast_path`]. If you want to recurse, you need to \
13195 call it manually."]
13196 #[inline]
13197 fn fold_disjunction(&mut self, node: Disjunction, __ast_path: &mut AstKindPath) -> Disjunction {
13198 <Disjunction as FoldWithAstPath<Self>>::fold_children_with_ast_path(node, self, __ast_path)
13199 }
13200 #[doc = "Visit a node of type `Dot`.\n\nBy default, this method calls \
13201 [`Dot::fold_children_with_ast_path`]. If you want to recurse, you need to call it \
13202 manually."]
13203 #[inline]
13204 fn fold_dot(&mut self, node: Dot, __ast_path: &mut AstKindPath) -> Dot {
13205 <Dot as FoldWithAstPath<Self>>::fold_children_with_ast_path(node, self, __ast_path)
13206 }
13207 #[doc = "Visit a node of type `IgnoreGroup`.\n\nBy default, this method calls \
13208 [`IgnoreGroup::fold_children_with_ast_path`]. If you want to recurse, you need to \
13209 call it manually."]
13210 #[inline]
13211 fn fold_ignore_group(
13212 &mut self,
13213 node: IgnoreGroup,
13214 __ast_path: &mut AstKindPath,
13215 ) -> IgnoreGroup {
13216 <IgnoreGroup as FoldWithAstPath<Self>>::fold_children_with_ast_path(node, self, __ast_path)
13217 }
13218 #[doc = "Visit a node of type `IndexedReference`.\n\nBy default, this method calls \
13219 [`IndexedReference::fold_children_with_ast_path`]. If you want to recurse, you need \
13220 to call it manually."]
13221 #[inline]
13222 fn fold_indexed_reference(
13223 &mut self,
13224 node: IndexedReference,
13225 __ast_path: &mut AstKindPath,
13226 ) -> IndexedReference {
13227 <IndexedReference as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13228 node, self, __ast_path,
13229 )
13230 }
13231 #[doc = "Visit a node of type `LookAroundAssertion`.\n\nBy default, this method calls \
13232 [`LookAroundAssertion::fold_children_with_ast_path`]. If you want to recurse, you \
13233 need to call it manually."]
13234 #[inline]
13235 fn fold_look_around_assertion(
13236 &mut self,
13237 node: LookAroundAssertion,
13238 __ast_path: &mut AstKindPath,
13239 ) -> LookAroundAssertion {
13240 <LookAroundAssertion as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13241 node, self, __ast_path,
13242 )
13243 }
13244 #[doc = "Visit a node of type `LookAroundAssertionKind`.\n\nBy default, this method calls \
13245 [`LookAroundAssertionKind::fold_children_with_ast_path`]. If you want to recurse, you \
13246 need to call it manually."]
13247 #[inline]
13248 fn fold_look_around_assertion_kind(
13249 &mut self,
13250 node: LookAroundAssertionKind,
13251 __ast_path: &mut AstKindPath,
13252 ) -> LookAroundAssertionKind {
13253 <LookAroundAssertionKind as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13254 node, self, __ast_path,
13255 )
13256 }
13257 #[doc = "Visit a node of type `Modifier`.\n\nBy default, this method calls \
13258 [`Modifier::fold_children_with_ast_path`]. If you want to recurse, you need to call \
13259 it manually."]
13260 #[inline]
13261 fn fold_modifier(&mut self, node: Modifier, __ast_path: &mut AstKindPath) -> Modifier {
13262 <Modifier as FoldWithAstPath<Self>>::fold_children_with_ast_path(node, self, __ast_path)
13263 }
13264 #[doc = "Visit a node of type `Modifiers`.\n\nBy default, this method calls \
13265 [`Modifiers::fold_children_with_ast_path`]. If you want to recurse, you need to call \
13266 it manually."]
13267 #[inline]
13268 fn fold_modifiers(&mut self, node: Modifiers, __ast_path: &mut AstKindPath) -> Modifiers {
13269 <Modifiers as FoldWithAstPath<Self>>::fold_children_with_ast_path(node, self, __ast_path)
13270 }
13271 #[doc = "Visit a node of type `NamedReference`.\n\nBy default, this method calls \
13272 [`NamedReference::fold_children_with_ast_path`]. If you want to recurse, you need to \
13273 call it manually."]
13274 #[inline]
13275 fn fold_named_reference(
13276 &mut self,
13277 node: NamedReference,
13278 __ast_path: &mut AstKindPath,
13279 ) -> NamedReference {
13280 <NamedReference as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13281 node, self, __ast_path,
13282 )
13283 }
13284 #[doc = "Visit a node of type `Option < swc_atoms :: Atom >`.\n\nBy default, this method calls \
13285 [`Option < swc_atoms :: Atom >::fold_children_with_ast_path`]. If you want to \
13286 recurse, you need to call it manually."]
13287 #[inline]
13288 fn fold_opt_atom(
13289 &mut self,
13290 node: Option<swc_atoms::Atom>,
13291 __ast_path: &mut AstKindPath,
13292 ) -> Option<swc_atoms::Atom> {
13293 <Option<swc_atoms::Atom> as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13294 node, self, __ast_path,
13295 )
13296 }
13297 #[doc = "Visit a node of type `Option < Modifiers >`.\n\nBy default, this method calls \
13298 [`Option < Modifiers >::fold_children_with_ast_path`]. If you want to recurse, you \
13299 need to call it manually."]
13300 #[inline]
13301 fn fold_opt_modifiers(
13302 &mut self,
13303 node: Option<Modifiers>,
13304 __ast_path: &mut AstKindPath,
13305 ) -> Option<Modifiers> {
13306 <Option<Modifiers> as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13307 node, self, __ast_path,
13308 )
13309 }
13310 #[doc = "Visit a node of type `Pattern`.\n\nBy default, this method calls \
13311 [`Pattern::fold_children_with_ast_path`]. If you want to recurse, you need to call it \
13312 manually."]
13313 #[inline]
13314 fn fold_pattern(&mut self, node: Pattern, __ast_path: &mut AstKindPath) -> Pattern {
13315 <Pattern as FoldWithAstPath<Self>>::fold_children_with_ast_path(node, self, __ast_path)
13316 }
13317 #[doc = "Visit a node of type `Quantifier`.\n\nBy default, this method calls \
13318 [`Quantifier::fold_children_with_ast_path`]. If you want to recurse, you need to call \
13319 it manually."]
13320 #[inline]
13321 fn fold_quantifier(&mut self, node: Quantifier, __ast_path: &mut AstKindPath) -> Quantifier {
13322 <Quantifier as FoldWithAstPath<Self>>::fold_children_with_ast_path(node, self, __ast_path)
13323 }
13324 #[doc = "Visit a node of type `swc_common :: Span`.\n\nBy default, this method calls \
13325 [`swc_common :: Span::fold_children_with_ast_path`]. If you want to recurse, you need \
13326 to call it manually."]
13327 #[inline]
13328 fn fold_span(
13329 &mut self,
13330 node: swc_common::Span,
13331 __ast_path: &mut AstKindPath,
13332 ) -> swc_common::Span {
13333 <swc_common::Span as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13334 node, self, __ast_path,
13335 )
13336 }
13337 #[doc = "Visit a node of type `Term`.\n\nBy default, this method calls \
13338 [`Term::fold_children_with_ast_path`]. If you want to recurse, you need to call it \
13339 manually."]
13340 #[inline]
13341 fn fold_term(&mut self, node: Term, __ast_path: &mut AstKindPath) -> Term {
13342 <Term as FoldWithAstPath<Self>>::fold_children_with_ast_path(node, self, __ast_path)
13343 }
13344 #[doc = "Visit a node of type `Vec < Term >`.\n\nBy default, this method calls [`Vec < Term \
13345 >::fold_children_with_ast_path`]. If you want to recurse, you need to call it \
13346 manually."]
13347 #[inline]
13348 fn fold_terms(&mut self, node: Vec<Term>, __ast_path: &mut AstKindPath) -> Vec<Term> {
13349 <Vec<Term> as FoldWithAstPath<Self>>::fold_children_with_ast_path(node, self, __ast_path)
13350 }
13351 #[doc = "Visit a node of type `UnicodePropertyEscape`.\n\nBy default, this method calls \
13352 [`UnicodePropertyEscape::fold_children_with_ast_path`]. If you want to recurse, you \
13353 need to call it manually."]
13354 #[inline]
13355 fn fold_unicode_property_escape(
13356 &mut self,
13357 node: UnicodePropertyEscape,
13358 __ast_path: &mut AstKindPath,
13359 ) -> UnicodePropertyEscape {
13360 <UnicodePropertyEscape as FoldWithAstPath<Self>>::fold_children_with_ast_path(
13361 node, self, __ast_path,
13362 )
13363 }
13364}
13365#[cfg(any(docsrs, feature = "path"))]
13366#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
13367impl<V> FoldAstPath for &mut V
13368where
13369 V: ?Sized + FoldAstPath,
13370{
13371 #[inline]
13372 fn fold_alternative(&mut self, node: Alternative, __ast_path: &mut AstKindPath) -> Alternative {
13373 <V as FoldAstPath>::fold_alternative(&mut **self, node, __ast_path)
13374 }
13375
13376 #[inline]
13377 fn fold_alternatives(
13378 &mut self,
13379 node: Vec<Alternative>,
13380 __ast_path: &mut AstKindPath,
13381 ) -> Vec<Alternative> {
13382 <V as FoldAstPath>::fold_alternatives(&mut **self, node, __ast_path)
13383 }
13384
13385 #[inline]
13386 fn fold_atom(
13387 &mut self,
13388 node: swc_atoms::Atom,
13389 __ast_path: &mut AstKindPath,
13390 ) -> swc_atoms::Atom {
13391 <V as FoldAstPath>::fold_atom(&mut **self, node, __ast_path)
13392 }
13393
13394 #[inline]
13395 fn fold_boundary_assertion(
13396 &mut self,
13397 node: BoundaryAssertion,
13398 __ast_path: &mut AstKindPath,
13399 ) -> BoundaryAssertion {
13400 <V as FoldAstPath>::fold_boundary_assertion(&mut **self, node, __ast_path)
13401 }
13402
13403 #[inline]
13404 fn fold_boundary_assertion_kind(
13405 &mut self,
13406 node: BoundaryAssertionKind,
13407 __ast_path: &mut AstKindPath,
13408 ) -> BoundaryAssertionKind {
13409 <V as FoldAstPath>::fold_boundary_assertion_kind(&mut **self, node, __ast_path)
13410 }
13411
13412 #[inline]
13413 fn fold_capturing_group(
13414 &mut self,
13415 node: CapturingGroup,
13416 __ast_path: &mut AstKindPath,
13417 ) -> CapturingGroup {
13418 <V as FoldAstPath>::fold_capturing_group(&mut **self, node, __ast_path)
13419 }
13420
13421 #[inline]
13422 fn fold_character(&mut self, node: Character, __ast_path: &mut AstKindPath) -> Character {
13423 <V as FoldAstPath>::fold_character(&mut **self, node, __ast_path)
13424 }
13425
13426 #[inline]
13427 fn fold_character_class(
13428 &mut self,
13429 node: CharacterClass,
13430 __ast_path: &mut AstKindPath,
13431 ) -> CharacterClass {
13432 <V as FoldAstPath>::fold_character_class(&mut **self, node, __ast_path)
13433 }
13434
13435 #[inline]
13436 fn fold_character_class_contents(
13437 &mut self,
13438 node: CharacterClassContents,
13439 __ast_path: &mut AstKindPath,
13440 ) -> CharacterClassContents {
13441 <V as FoldAstPath>::fold_character_class_contents(&mut **self, node, __ast_path)
13442 }
13443
13444 #[inline]
13445 fn fold_character_class_contents_kind(
13446 &mut self,
13447 node: CharacterClassContentsKind,
13448 __ast_path: &mut AstKindPath,
13449 ) -> CharacterClassContentsKind {
13450 <V as FoldAstPath>::fold_character_class_contents_kind(&mut **self, node, __ast_path)
13451 }
13452
13453 #[inline]
13454 fn fold_character_class_contentss(
13455 &mut self,
13456 node: Vec<CharacterClassContents>,
13457 __ast_path: &mut AstKindPath,
13458 ) -> Vec<CharacterClassContents> {
13459 <V as FoldAstPath>::fold_character_class_contentss(&mut **self, node, __ast_path)
13460 }
13461
13462 #[inline]
13463 fn fold_character_class_escape(
13464 &mut self,
13465 node: CharacterClassEscape,
13466 __ast_path: &mut AstKindPath,
13467 ) -> CharacterClassEscape {
13468 <V as FoldAstPath>::fold_character_class_escape(&mut **self, node, __ast_path)
13469 }
13470
13471 #[inline]
13472 fn fold_character_class_escape_kind(
13473 &mut self,
13474 node: CharacterClassEscapeKind,
13475 __ast_path: &mut AstKindPath,
13476 ) -> CharacterClassEscapeKind {
13477 <V as FoldAstPath>::fold_character_class_escape_kind(&mut **self, node, __ast_path)
13478 }
13479
13480 #[inline]
13481 fn fold_character_class_range(
13482 &mut self,
13483 node: CharacterClassRange,
13484 __ast_path: &mut AstKindPath,
13485 ) -> CharacterClassRange {
13486 <V as FoldAstPath>::fold_character_class_range(&mut **self, node, __ast_path)
13487 }
13488
13489 #[inline]
13490 fn fold_character_kind(
13491 &mut self,
13492 node: CharacterKind,
13493 __ast_path: &mut AstKindPath,
13494 ) -> CharacterKind {
13495 <V as FoldAstPath>::fold_character_kind(&mut **self, node, __ast_path)
13496 }
13497
13498 #[inline]
13499 fn fold_characters(
13500 &mut self,
13501 node: Vec<Character>,
13502 __ast_path: &mut AstKindPath,
13503 ) -> Vec<Character> {
13504 <V as FoldAstPath>::fold_characters(&mut **self, node, __ast_path)
13505 }
13506
13507 #[inline]
13508 fn fold_class_string(
13509 &mut self,
13510 node: ClassString,
13511 __ast_path: &mut AstKindPath,
13512 ) -> ClassString {
13513 <V as FoldAstPath>::fold_class_string(&mut **self, node, __ast_path)
13514 }
13515
13516 #[inline]
13517 fn fold_class_string_disjunction(
13518 &mut self,
13519 node: ClassStringDisjunction,
13520 __ast_path: &mut AstKindPath,
13521 ) -> ClassStringDisjunction {
13522 <V as FoldAstPath>::fold_class_string_disjunction(&mut **self, node, __ast_path)
13523 }
13524
13525 #[inline]
13526 fn fold_class_strings(
13527 &mut self,
13528 node: Vec<ClassString>,
13529 __ast_path: &mut AstKindPath,
13530 ) -> Vec<ClassString> {
13531 <V as FoldAstPath>::fold_class_strings(&mut **self, node, __ast_path)
13532 }
13533
13534 #[inline]
13535 fn fold_disjunction(&mut self, node: Disjunction, __ast_path: &mut AstKindPath) -> Disjunction {
13536 <V as FoldAstPath>::fold_disjunction(&mut **self, node, __ast_path)
13537 }
13538
13539 #[inline]
13540 fn fold_dot(&mut self, node: Dot, __ast_path: &mut AstKindPath) -> Dot {
13541 <V as FoldAstPath>::fold_dot(&mut **self, node, __ast_path)
13542 }
13543
13544 #[inline]
13545 fn fold_ignore_group(
13546 &mut self,
13547 node: IgnoreGroup,
13548 __ast_path: &mut AstKindPath,
13549 ) -> IgnoreGroup {
13550 <V as FoldAstPath>::fold_ignore_group(&mut **self, node, __ast_path)
13551 }
13552
13553 #[inline]
13554 fn fold_indexed_reference(
13555 &mut self,
13556 node: IndexedReference,
13557 __ast_path: &mut AstKindPath,
13558 ) -> IndexedReference {
13559 <V as FoldAstPath>::fold_indexed_reference(&mut **self, node, __ast_path)
13560 }
13561
13562 #[inline]
13563 fn fold_look_around_assertion(
13564 &mut self,
13565 node: LookAroundAssertion,
13566 __ast_path: &mut AstKindPath,
13567 ) -> LookAroundAssertion {
13568 <V as FoldAstPath>::fold_look_around_assertion(&mut **self, node, __ast_path)
13569 }
13570
13571 #[inline]
13572 fn fold_look_around_assertion_kind(
13573 &mut self,
13574 node: LookAroundAssertionKind,
13575 __ast_path: &mut AstKindPath,
13576 ) -> LookAroundAssertionKind {
13577 <V as FoldAstPath>::fold_look_around_assertion_kind(&mut **self, node, __ast_path)
13578 }
13579
13580 #[inline]
13581 fn fold_modifier(&mut self, node: Modifier, __ast_path: &mut AstKindPath) -> Modifier {
13582 <V as FoldAstPath>::fold_modifier(&mut **self, node, __ast_path)
13583 }
13584
13585 #[inline]
13586 fn fold_modifiers(&mut self, node: Modifiers, __ast_path: &mut AstKindPath) -> Modifiers {
13587 <V as FoldAstPath>::fold_modifiers(&mut **self, node, __ast_path)
13588 }
13589
13590 #[inline]
13591 fn fold_named_reference(
13592 &mut self,
13593 node: NamedReference,
13594 __ast_path: &mut AstKindPath,
13595 ) -> NamedReference {
13596 <V as FoldAstPath>::fold_named_reference(&mut **self, node, __ast_path)
13597 }
13598
13599 #[inline]
13600 fn fold_opt_atom(
13601 &mut self,
13602 node: Option<swc_atoms::Atom>,
13603 __ast_path: &mut AstKindPath,
13604 ) -> Option<swc_atoms::Atom> {
13605 <V as FoldAstPath>::fold_opt_atom(&mut **self, node, __ast_path)
13606 }
13607
13608 #[inline]
13609 fn fold_opt_modifiers(
13610 &mut self,
13611 node: Option<Modifiers>,
13612 __ast_path: &mut AstKindPath,
13613 ) -> Option<Modifiers> {
13614 <V as FoldAstPath>::fold_opt_modifiers(&mut **self, node, __ast_path)
13615 }
13616
13617 #[inline]
13618 fn fold_pattern(&mut self, node: Pattern, __ast_path: &mut AstKindPath) -> Pattern {
13619 <V as FoldAstPath>::fold_pattern(&mut **self, node, __ast_path)
13620 }
13621
13622 #[inline]
13623 fn fold_quantifier(&mut self, node: Quantifier, __ast_path: &mut AstKindPath) -> Quantifier {
13624 <V as FoldAstPath>::fold_quantifier(&mut **self, node, __ast_path)
13625 }
13626
13627 #[inline]
13628 fn fold_span(
13629 &mut self,
13630 node: swc_common::Span,
13631 __ast_path: &mut AstKindPath,
13632 ) -> swc_common::Span {
13633 <V as FoldAstPath>::fold_span(&mut **self, node, __ast_path)
13634 }
13635
13636 #[inline]
13637 fn fold_term(&mut self, node: Term, __ast_path: &mut AstKindPath) -> Term {
13638 <V as FoldAstPath>::fold_term(&mut **self, node, __ast_path)
13639 }
13640
13641 #[inline]
13642 fn fold_terms(&mut self, node: Vec<Term>, __ast_path: &mut AstKindPath) -> Vec<Term> {
13643 <V as FoldAstPath>::fold_terms(&mut **self, node, __ast_path)
13644 }
13645
13646 #[inline]
13647 fn fold_unicode_property_escape(
13648 &mut self,
13649 node: UnicodePropertyEscape,
13650 __ast_path: &mut AstKindPath,
13651 ) -> UnicodePropertyEscape {
13652 <V as FoldAstPath>::fold_unicode_property_escape(&mut **self, node, __ast_path)
13653 }
13654}
13655#[cfg(any(docsrs, feature = "path"))]
13656#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
13657impl<V> FoldAstPath for Box<V>
13658where
13659 V: ?Sized + FoldAstPath,
13660{
13661 #[inline]
13662 fn fold_alternative(&mut self, node: Alternative, __ast_path: &mut AstKindPath) -> Alternative {
13663 <V as FoldAstPath>::fold_alternative(&mut **self, node, __ast_path)
13664 }
13665
13666 #[inline]
13667 fn fold_alternatives(
13668 &mut self,
13669 node: Vec<Alternative>,
13670 __ast_path: &mut AstKindPath,
13671 ) -> Vec<Alternative> {
13672 <V as FoldAstPath>::fold_alternatives(&mut **self, node, __ast_path)
13673 }
13674
13675 #[inline]
13676 fn fold_atom(
13677 &mut self,
13678 node: swc_atoms::Atom,
13679 __ast_path: &mut AstKindPath,
13680 ) -> swc_atoms::Atom {
13681 <V as FoldAstPath>::fold_atom(&mut **self, node, __ast_path)
13682 }
13683
13684 #[inline]
13685 fn fold_boundary_assertion(
13686 &mut self,
13687 node: BoundaryAssertion,
13688 __ast_path: &mut AstKindPath,
13689 ) -> BoundaryAssertion {
13690 <V as FoldAstPath>::fold_boundary_assertion(&mut **self, node, __ast_path)
13691 }
13692
13693 #[inline]
13694 fn fold_boundary_assertion_kind(
13695 &mut self,
13696 node: BoundaryAssertionKind,
13697 __ast_path: &mut AstKindPath,
13698 ) -> BoundaryAssertionKind {
13699 <V as FoldAstPath>::fold_boundary_assertion_kind(&mut **self, node, __ast_path)
13700 }
13701
13702 #[inline]
13703 fn fold_capturing_group(
13704 &mut self,
13705 node: CapturingGroup,
13706 __ast_path: &mut AstKindPath,
13707 ) -> CapturingGroup {
13708 <V as FoldAstPath>::fold_capturing_group(&mut **self, node, __ast_path)
13709 }
13710
13711 #[inline]
13712 fn fold_character(&mut self, node: Character, __ast_path: &mut AstKindPath) -> Character {
13713 <V as FoldAstPath>::fold_character(&mut **self, node, __ast_path)
13714 }
13715
13716 #[inline]
13717 fn fold_character_class(
13718 &mut self,
13719 node: CharacterClass,
13720 __ast_path: &mut AstKindPath,
13721 ) -> CharacterClass {
13722 <V as FoldAstPath>::fold_character_class(&mut **self, node, __ast_path)
13723 }
13724
13725 #[inline]
13726 fn fold_character_class_contents(
13727 &mut self,
13728 node: CharacterClassContents,
13729 __ast_path: &mut AstKindPath,
13730 ) -> CharacterClassContents {
13731 <V as FoldAstPath>::fold_character_class_contents(&mut **self, node, __ast_path)
13732 }
13733
13734 #[inline]
13735 fn fold_character_class_contents_kind(
13736 &mut self,
13737 node: CharacterClassContentsKind,
13738 __ast_path: &mut AstKindPath,
13739 ) -> CharacterClassContentsKind {
13740 <V as FoldAstPath>::fold_character_class_contents_kind(&mut **self, node, __ast_path)
13741 }
13742
13743 #[inline]
13744 fn fold_character_class_contentss(
13745 &mut self,
13746 node: Vec<CharacterClassContents>,
13747 __ast_path: &mut AstKindPath,
13748 ) -> Vec<CharacterClassContents> {
13749 <V as FoldAstPath>::fold_character_class_contentss(&mut **self, node, __ast_path)
13750 }
13751
13752 #[inline]
13753 fn fold_character_class_escape(
13754 &mut self,
13755 node: CharacterClassEscape,
13756 __ast_path: &mut AstKindPath,
13757 ) -> CharacterClassEscape {
13758 <V as FoldAstPath>::fold_character_class_escape(&mut **self, node, __ast_path)
13759 }
13760
13761 #[inline]
13762 fn fold_character_class_escape_kind(
13763 &mut self,
13764 node: CharacterClassEscapeKind,
13765 __ast_path: &mut AstKindPath,
13766 ) -> CharacterClassEscapeKind {
13767 <V as FoldAstPath>::fold_character_class_escape_kind(&mut **self, node, __ast_path)
13768 }
13769
13770 #[inline]
13771 fn fold_character_class_range(
13772 &mut self,
13773 node: CharacterClassRange,
13774 __ast_path: &mut AstKindPath,
13775 ) -> CharacterClassRange {
13776 <V as FoldAstPath>::fold_character_class_range(&mut **self, node, __ast_path)
13777 }
13778
13779 #[inline]
13780 fn fold_character_kind(
13781 &mut self,
13782 node: CharacterKind,
13783 __ast_path: &mut AstKindPath,
13784 ) -> CharacterKind {
13785 <V as FoldAstPath>::fold_character_kind(&mut **self, node, __ast_path)
13786 }
13787
13788 #[inline]
13789 fn fold_characters(
13790 &mut self,
13791 node: Vec<Character>,
13792 __ast_path: &mut AstKindPath,
13793 ) -> Vec<Character> {
13794 <V as FoldAstPath>::fold_characters(&mut **self, node, __ast_path)
13795 }
13796
13797 #[inline]
13798 fn fold_class_string(
13799 &mut self,
13800 node: ClassString,
13801 __ast_path: &mut AstKindPath,
13802 ) -> ClassString {
13803 <V as FoldAstPath>::fold_class_string(&mut **self, node, __ast_path)
13804 }
13805
13806 #[inline]
13807 fn fold_class_string_disjunction(
13808 &mut self,
13809 node: ClassStringDisjunction,
13810 __ast_path: &mut AstKindPath,
13811 ) -> ClassStringDisjunction {
13812 <V as FoldAstPath>::fold_class_string_disjunction(&mut **self, node, __ast_path)
13813 }
13814
13815 #[inline]
13816 fn fold_class_strings(
13817 &mut self,
13818 node: Vec<ClassString>,
13819 __ast_path: &mut AstKindPath,
13820 ) -> Vec<ClassString> {
13821 <V as FoldAstPath>::fold_class_strings(&mut **self, node, __ast_path)
13822 }
13823
13824 #[inline]
13825 fn fold_disjunction(&mut self, node: Disjunction, __ast_path: &mut AstKindPath) -> Disjunction {
13826 <V as FoldAstPath>::fold_disjunction(&mut **self, node, __ast_path)
13827 }
13828
13829 #[inline]
13830 fn fold_dot(&mut self, node: Dot, __ast_path: &mut AstKindPath) -> Dot {
13831 <V as FoldAstPath>::fold_dot(&mut **self, node, __ast_path)
13832 }
13833
13834 #[inline]
13835 fn fold_ignore_group(
13836 &mut self,
13837 node: IgnoreGroup,
13838 __ast_path: &mut AstKindPath,
13839 ) -> IgnoreGroup {
13840 <V as FoldAstPath>::fold_ignore_group(&mut **self, node, __ast_path)
13841 }
13842
13843 #[inline]
13844 fn fold_indexed_reference(
13845 &mut self,
13846 node: IndexedReference,
13847 __ast_path: &mut AstKindPath,
13848 ) -> IndexedReference {
13849 <V as FoldAstPath>::fold_indexed_reference(&mut **self, node, __ast_path)
13850 }
13851
13852 #[inline]
13853 fn fold_look_around_assertion(
13854 &mut self,
13855 node: LookAroundAssertion,
13856 __ast_path: &mut AstKindPath,
13857 ) -> LookAroundAssertion {
13858 <V as FoldAstPath>::fold_look_around_assertion(&mut **self, node, __ast_path)
13859 }
13860
13861 #[inline]
13862 fn fold_look_around_assertion_kind(
13863 &mut self,
13864 node: LookAroundAssertionKind,
13865 __ast_path: &mut AstKindPath,
13866 ) -> LookAroundAssertionKind {
13867 <V as FoldAstPath>::fold_look_around_assertion_kind(&mut **self, node, __ast_path)
13868 }
13869
13870 #[inline]
13871 fn fold_modifier(&mut self, node: Modifier, __ast_path: &mut AstKindPath) -> Modifier {
13872 <V as FoldAstPath>::fold_modifier(&mut **self, node, __ast_path)
13873 }
13874
13875 #[inline]
13876 fn fold_modifiers(&mut self, node: Modifiers, __ast_path: &mut AstKindPath) -> Modifiers {
13877 <V as FoldAstPath>::fold_modifiers(&mut **self, node, __ast_path)
13878 }
13879
13880 #[inline]
13881 fn fold_named_reference(
13882 &mut self,
13883 node: NamedReference,
13884 __ast_path: &mut AstKindPath,
13885 ) -> NamedReference {
13886 <V as FoldAstPath>::fold_named_reference(&mut **self, node, __ast_path)
13887 }
13888
13889 #[inline]
13890 fn fold_opt_atom(
13891 &mut self,
13892 node: Option<swc_atoms::Atom>,
13893 __ast_path: &mut AstKindPath,
13894 ) -> Option<swc_atoms::Atom> {
13895 <V as FoldAstPath>::fold_opt_atom(&mut **self, node, __ast_path)
13896 }
13897
13898 #[inline]
13899 fn fold_opt_modifiers(
13900 &mut self,
13901 node: Option<Modifiers>,
13902 __ast_path: &mut AstKindPath,
13903 ) -> Option<Modifiers> {
13904 <V as FoldAstPath>::fold_opt_modifiers(&mut **self, node, __ast_path)
13905 }
13906
13907 #[inline]
13908 fn fold_pattern(&mut self, node: Pattern, __ast_path: &mut AstKindPath) -> Pattern {
13909 <V as FoldAstPath>::fold_pattern(&mut **self, node, __ast_path)
13910 }
13911
13912 #[inline]
13913 fn fold_quantifier(&mut self, node: Quantifier, __ast_path: &mut AstKindPath) -> Quantifier {
13914 <V as FoldAstPath>::fold_quantifier(&mut **self, node, __ast_path)
13915 }
13916
13917 #[inline]
13918 fn fold_span(
13919 &mut self,
13920 node: swc_common::Span,
13921 __ast_path: &mut AstKindPath,
13922 ) -> swc_common::Span {
13923 <V as FoldAstPath>::fold_span(&mut **self, node, __ast_path)
13924 }
13925
13926 #[inline]
13927 fn fold_term(&mut self, node: Term, __ast_path: &mut AstKindPath) -> Term {
13928 <V as FoldAstPath>::fold_term(&mut **self, node, __ast_path)
13929 }
13930
13931 #[inline]
13932 fn fold_terms(&mut self, node: Vec<Term>, __ast_path: &mut AstKindPath) -> Vec<Term> {
13933 <V as FoldAstPath>::fold_terms(&mut **self, node, __ast_path)
13934 }
13935
13936 #[inline]
13937 fn fold_unicode_property_escape(
13938 &mut self,
13939 node: UnicodePropertyEscape,
13940 __ast_path: &mut AstKindPath,
13941 ) -> UnicodePropertyEscape {
13942 <V as FoldAstPath>::fold_unicode_property_escape(&mut **self, node, __ast_path)
13943 }
13944}
13945#[cfg(any(docsrs, feature = "path"))]
13946#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
13947impl<A, B> FoldAstPath for ::swc_visit::Either<A, B>
13948where
13949 A: FoldAstPath,
13950 B: FoldAstPath,
13951{
13952 #[inline]
13953 fn fold_alternative(&mut self, node: Alternative, __ast_path: &mut AstKindPath) -> Alternative {
13954 match self {
13955 swc_visit::Either::Left(visitor) => {
13956 FoldAstPath::fold_alternative(visitor, node, __ast_path)
13957 }
13958 swc_visit::Either::Right(visitor) => {
13959 FoldAstPath::fold_alternative(visitor, node, __ast_path)
13960 }
13961 }
13962 }
13963
13964 #[inline]
13965 fn fold_alternatives(
13966 &mut self,
13967 node: Vec<Alternative>,
13968 __ast_path: &mut AstKindPath,
13969 ) -> Vec<Alternative> {
13970 match self {
13971 swc_visit::Either::Left(visitor) => {
13972 FoldAstPath::fold_alternatives(visitor, node, __ast_path)
13973 }
13974 swc_visit::Either::Right(visitor) => {
13975 FoldAstPath::fold_alternatives(visitor, node, __ast_path)
13976 }
13977 }
13978 }
13979
13980 #[inline]
13981 fn fold_atom(
13982 &mut self,
13983 node: swc_atoms::Atom,
13984 __ast_path: &mut AstKindPath,
13985 ) -> swc_atoms::Atom {
13986 match self {
13987 swc_visit::Either::Left(visitor) => FoldAstPath::fold_atom(visitor, node, __ast_path),
13988 swc_visit::Either::Right(visitor) => FoldAstPath::fold_atom(visitor, node, __ast_path),
13989 }
13990 }
13991
13992 #[inline]
13993 fn fold_boundary_assertion(
13994 &mut self,
13995 node: BoundaryAssertion,
13996 __ast_path: &mut AstKindPath,
13997 ) -> BoundaryAssertion {
13998 match self {
13999 swc_visit::Either::Left(visitor) => {
14000 FoldAstPath::fold_boundary_assertion(visitor, node, __ast_path)
14001 }
14002 swc_visit::Either::Right(visitor) => {
14003 FoldAstPath::fold_boundary_assertion(visitor, node, __ast_path)
14004 }
14005 }
14006 }
14007
14008 #[inline]
14009 fn fold_boundary_assertion_kind(
14010 &mut self,
14011 node: BoundaryAssertionKind,
14012 __ast_path: &mut AstKindPath,
14013 ) -> BoundaryAssertionKind {
14014 match self {
14015 swc_visit::Either::Left(visitor) => {
14016 FoldAstPath::fold_boundary_assertion_kind(visitor, node, __ast_path)
14017 }
14018 swc_visit::Either::Right(visitor) => {
14019 FoldAstPath::fold_boundary_assertion_kind(visitor, node, __ast_path)
14020 }
14021 }
14022 }
14023
14024 #[inline]
14025 fn fold_capturing_group(
14026 &mut self,
14027 node: CapturingGroup,
14028 __ast_path: &mut AstKindPath,
14029 ) -> CapturingGroup {
14030 match self {
14031 swc_visit::Either::Left(visitor) => {
14032 FoldAstPath::fold_capturing_group(visitor, node, __ast_path)
14033 }
14034 swc_visit::Either::Right(visitor) => {
14035 FoldAstPath::fold_capturing_group(visitor, node, __ast_path)
14036 }
14037 }
14038 }
14039
14040 #[inline]
14041 fn fold_character(&mut self, node: Character, __ast_path: &mut AstKindPath) -> Character {
14042 match self {
14043 swc_visit::Either::Left(visitor) => {
14044 FoldAstPath::fold_character(visitor, node, __ast_path)
14045 }
14046 swc_visit::Either::Right(visitor) => {
14047 FoldAstPath::fold_character(visitor, node, __ast_path)
14048 }
14049 }
14050 }
14051
14052 #[inline]
14053 fn fold_character_class(
14054 &mut self,
14055 node: CharacterClass,
14056 __ast_path: &mut AstKindPath,
14057 ) -> CharacterClass {
14058 match self {
14059 swc_visit::Either::Left(visitor) => {
14060 FoldAstPath::fold_character_class(visitor, node, __ast_path)
14061 }
14062 swc_visit::Either::Right(visitor) => {
14063 FoldAstPath::fold_character_class(visitor, node, __ast_path)
14064 }
14065 }
14066 }
14067
14068 #[inline]
14069 fn fold_character_class_contents(
14070 &mut self,
14071 node: CharacterClassContents,
14072 __ast_path: &mut AstKindPath,
14073 ) -> CharacterClassContents {
14074 match self {
14075 swc_visit::Either::Left(visitor) => {
14076 FoldAstPath::fold_character_class_contents(visitor, node, __ast_path)
14077 }
14078 swc_visit::Either::Right(visitor) => {
14079 FoldAstPath::fold_character_class_contents(visitor, node, __ast_path)
14080 }
14081 }
14082 }
14083
14084 #[inline]
14085 fn fold_character_class_contents_kind(
14086 &mut self,
14087 node: CharacterClassContentsKind,
14088 __ast_path: &mut AstKindPath,
14089 ) -> CharacterClassContentsKind {
14090 match self {
14091 swc_visit::Either::Left(visitor) => {
14092 FoldAstPath::fold_character_class_contents_kind(visitor, node, __ast_path)
14093 }
14094 swc_visit::Either::Right(visitor) => {
14095 FoldAstPath::fold_character_class_contents_kind(visitor, node, __ast_path)
14096 }
14097 }
14098 }
14099
14100 #[inline]
14101 fn fold_character_class_contentss(
14102 &mut self,
14103 node: Vec<CharacterClassContents>,
14104 __ast_path: &mut AstKindPath,
14105 ) -> Vec<CharacterClassContents> {
14106 match self {
14107 swc_visit::Either::Left(visitor) => {
14108 FoldAstPath::fold_character_class_contentss(visitor, node, __ast_path)
14109 }
14110 swc_visit::Either::Right(visitor) => {
14111 FoldAstPath::fold_character_class_contentss(visitor, node, __ast_path)
14112 }
14113 }
14114 }
14115
14116 #[inline]
14117 fn fold_character_class_escape(
14118 &mut self,
14119 node: CharacterClassEscape,
14120 __ast_path: &mut AstKindPath,
14121 ) -> CharacterClassEscape {
14122 match self {
14123 swc_visit::Either::Left(visitor) => {
14124 FoldAstPath::fold_character_class_escape(visitor, node, __ast_path)
14125 }
14126 swc_visit::Either::Right(visitor) => {
14127 FoldAstPath::fold_character_class_escape(visitor, node, __ast_path)
14128 }
14129 }
14130 }
14131
14132 #[inline]
14133 fn fold_character_class_escape_kind(
14134 &mut self,
14135 node: CharacterClassEscapeKind,
14136 __ast_path: &mut AstKindPath,
14137 ) -> CharacterClassEscapeKind {
14138 match self {
14139 swc_visit::Either::Left(visitor) => {
14140 FoldAstPath::fold_character_class_escape_kind(visitor, node, __ast_path)
14141 }
14142 swc_visit::Either::Right(visitor) => {
14143 FoldAstPath::fold_character_class_escape_kind(visitor, node, __ast_path)
14144 }
14145 }
14146 }
14147
14148 #[inline]
14149 fn fold_character_class_range(
14150 &mut self,
14151 node: CharacterClassRange,
14152 __ast_path: &mut AstKindPath,
14153 ) -> CharacterClassRange {
14154 match self {
14155 swc_visit::Either::Left(visitor) => {
14156 FoldAstPath::fold_character_class_range(visitor, node, __ast_path)
14157 }
14158 swc_visit::Either::Right(visitor) => {
14159 FoldAstPath::fold_character_class_range(visitor, node, __ast_path)
14160 }
14161 }
14162 }
14163
14164 #[inline]
14165 fn fold_character_kind(
14166 &mut self,
14167 node: CharacterKind,
14168 __ast_path: &mut AstKindPath,
14169 ) -> CharacterKind {
14170 match self {
14171 swc_visit::Either::Left(visitor) => {
14172 FoldAstPath::fold_character_kind(visitor, node, __ast_path)
14173 }
14174 swc_visit::Either::Right(visitor) => {
14175 FoldAstPath::fold_character_kind(visitor, node, __ast_path)
14176 }
14177 }
14178 }
14179
14180 #[inline]
14181 fn fold_characters(
14182 &mut self,
14183 node: Vec<Character>,
14184 __ast_path: &mut AstKindPath,
14185 ) -> Vec<Character> {
14186 match self {
14187 swc_visit::Either::Left(visitor) => {
14188 FoldAstPath::fold_characters(visitor, node, __ast_path)
14189 }
14190 swc_visit::Either::Right(visitor) => {
14191 FoldAstPath::fold_characters(visitor, node, __ast_path)
14192 }
14193 }
14194 }
14195
14196 #[inline]
14197 fn fold_class_string(
14198 &mut self,
14199 node: ClassString,
14200 __ast_path: &mut AstKindPath,
14201 ) -> ClassString {
14202 match self {
14203 swc_visit::Either::Left(visitor) => {
14204 FoldAstPath::fold_class_string(visitor, node, __ast_path)
14205 }
14206 swc_visit::Either::Right(visitor) => {
14207 FoldAstPath::fold_class_string(visitor, node, __ast_path)
14208 }
14209 }
14210 }
14211
14212 #[inline]
14213 fn fold_class_string_disjunction(
14214 &mut self,
14215 node: ClassStringDisjunction,
14216 __ast_path: &mut AstKindPath,
14217 ) -> ClassStringDisjunction {
14218 match self {
14219 swc_visit::Either::Left(visitor) => {
14220 FoldAstPath::fold_class_string_disjunction(visitor, node, __ast_path)
14221 }
14222 swc_visit::Either::Right(visitor) => {
14223 FoldAstPath::fold_class_string_disjunction(visitor, node, __ast_path)
14224 }
14225 }
14226 }
14227
14228 #[inline]
14229 fn fold_class_strings(
14230 &mut self,
14231 node: Vec<ClassString>,
14232 __ast_path: &mut AstKindPath,
14233 ) -> Vec<ClassString> {
14234 match self {
14235 swc_visit::Either::Left(visitor) => {
14236 FoldAstPath::fold_class_strings(visitor, node, __ast_path)
14237 }
14238 swc_visit::Either::Right(visitor) => {
14239 FoldAstPath::fold_class_strings(visitor, node, __ast_path)
14240 }
14241 }
14242 }
14243
14244 #[inline]
14245 fn fold_disjunction(&mut self, node: Disjunction, __ast_path: &mut AstKindPath) -> Disjunction {
14246 match self {
14247 swc_visit::Either::Left(visitor) => {
14248 FoldAstPath::fold_disjunction(visitor, node, __ast_path)
14249 }
14250 swc_visit::Either::Right(visitor) => {
14251 FoldAstPath::fold_disjunction(visitor, node, __ast_path)
14252 }
14253 }
14254 }
14255
14256 #[inline]
14257 fn fold_dot(&mut self, node: Dot, __ast_path: &mut AstKindPath) -> Dot {
14258 match self {
14259 swc_visit::Either::Left(visitor) => FoldAstPath::fold_dot(visitor, node, __ast_path),
14260 swc_visit::Either::Right(visitor) => FoldAstPath::fold_dot(visitor, node, __ast_path),
14261 }
14262 }
14263
14264 #[inline]
14265 fn fold_ignore_group(
14266 &mut self,
14267 node: IgnoreGroup,
14268 __ast_path: &mut AstKindPath,
14269 ) -> IgnoreGroup {
14270 match self {
14271 swc_visit::Either::Left(visitor) => {
14272 FoldAstPath::fold_ignore_group(visitor, node, __ast_path)
14273 }
14274 swc_visit::Either::Right(visitor) => {
14275 FoldAstPath::fold_ignore_group(visitor, node, __ast_path)
14276 }
14277 }
14278 }
14279
14280 #[inline]
14281 fn fold_indexed_reference(
14282 &mut self,
14283 node: IndexedReference,
14284 __ast_path: &mut AstKindPath,
14285 ) -> IndexedReference {
14286 match self {
14287 swc_visit::Either::Left(visitor) => {
14288 FoldAstPath::fold_indexed_reference(visitor, node, __ast_path)
14289 }
14290 swc_visit::Either::Right(visitor) => {
14291 FoldAstPath::fold_indexed_reference(visitor, node, __ast_path)
14292 }
14293 }
14294 }
14295
14296 #[inline]
14297 fn fold_look_around_assertion(
14298 &mut self,
14299 node: LookAroundAssertion,
14300 __ast_path: &mut AstKindPath,
14301 ) -> LookAroundAssertion {
14302 match self {
14303 swc_visit::Either::Left(visitor) => {
14304 FoldAstPath::fold_look_around_assertion(visitor, node, __ast_path)
14305 }
14306 swc_visit::Either::Right(visitor) => {
14307 FoldAstPath::fold_look_around_assertion(visitor, node, __ast_path)
14308 }
14309 }
14310 }
14311
14312 #[inline]
14313 fn fold_look_around_assertion_kind(
14314 &mut self,
14315 node: LookAroundAssertionKind,
14316 __ast_path: &mut AstKindPath,
14317 ) -> LookAroundAssertionKind {
14318 match self {
14319 swc_visit::Either::Left(visitor) => {
14320 FoldAstPath::fold_look_around_assertion_kind(visitor, node, __ast_path)
14321 }
14322 swc_visit::Either::Right(visitor) => {
14323 FoldAstPath::fold_look_around_assertion_kind(visitor, node, __ast_path)
14324 }
14325 }
14326 }
14327
14328 #[inline]
14329 fn fold_modifier(&mut self, node: Modifier, __ast_path: &mut AstKindPath) -> Modifier {
14330 match self {
14331 swc_visit::Either::Left(visitor) => {
14332 FoldAstPath::fold_modifier(visitor, node, __ast_path)
14333 }
14334 swc_visit::Either::Right(visitor) => {
14335 FoldAstPath::fold_modifier(visitor, node, __ast_path)
14336 }
14337 }
14338 }
14339
14340 #[inline]
14341 fn fold_modifiers(&mut self, node: Modifiers, __ast_path: &mut AstKindPath) -> Modifiers {
14342 match self {
14343 swc_visit::Either::Left(visitor) => {
14344 FoldAstPath::fold_modifiers(visitor, node, __ast_path)
14345 }
14346 swc_visit::Either::Right(visitor) => {
14347 FoldAstPath::fold_modifiers(visitor, node, __ast_path)
14348 }
14349 }
14350 }
14351
14352 #[inline]
14353 fn fold_named_reference(
14354 &mut self,
14355 node: NamedReference,
14356 __ast_path: &mut AstKindPath,
14357 ) -> NamedReference {
14358 match self {
14359 swc_visit::Either::Left(visitor) => {
14360 FoldAstPath::fold_named_reference(visitor, node, __ast_path)
14361 }
14362 swc_visit::Either::Right(visitor) => {
14363 FoldAstPath::fold_named_reference(visitor, node, __ast_path)
14364 }
14365 }
14366 }
14367
14368 #[inline]
14369 fn fold_opt_atom(
14370 &mut self,
14371 node: Option<swc_atoms::Atom>,
14372 __ast_path: &mut AstKindPath,
14373 ) -> Option<swc_atoms::Atom> {
14374 match self {
14375 swc_visit::Either::Left(visitor) => {
14376 FoldAstPath::fold_opt_atom(visitor, node, __ast_path)
14377 }
14378 swc_visit::Either::Right(visitor) => {
14379 FoldAstPath::fold_opt_atom(visitor, node, __ast_path)
14380 }
14381 }
14382 }
14383
14384 #[inline]
14385 fn fold_opt_modifiers(
14386 &mut self,
14387 node: Option<Modifiers>,
14388 __ast_path: &mut AstKindPath,
14389 ) -> Option<Modifiers> {
14390 match self {
14391 swc_visit::Either::Left(visitor) => {
14392 FoldAstPath::fold_opt_modifiers(visitor, node, __ast_path)
14393 }
14394 swc_visit::Either::Right(visitor) => {
14395 FoldAstPath::fold_opt_modifiers(visitor, node, __ast_path)
14396 }
14397 }
14398 }
14399
14400 #[inline]
14401 fn fold_pattern(&mut self, node: Pattern, __ast_path: &mut AstKindPath) -> Pattern {
14402 match self {
14403 swc_visit::Either::Left(visitor) => {
14404 FoldAstPath::fold_pattern(visitor, node, __ast_path)
14405 }
14406 swc_visit::Either::Right(visitor) => {
14407 FoldAstPath::fold_pattern(visitor, node, __ast_path)
14408 }
14409 }
14410 }
14411
14412 #[inline]
14413 fn fold_quantifier(&mut self, node: Quantifier, __ast_path: &mut AstKindPath) -> Quantifier {
14414 match self {
14415 swc_visit::Either::Left(visitor) => {
14416 FoldAstPath::fold_quantifier(visitor, node, __ast_path)
14417 }
14418 swc_visit::Either::Right(visitor) => {
14419 FoldAstPath::fold_quantifier(visitor, node, __ast_path)
14420 }
14421 }
14422 }
14423
14424 #[inline]
14425 fn fold_span(
14426 &mut self,
14427 node: swc_common::Span,
14428 __ast_path: &mut AstKindPath,
14429 ) -> swc_common::Span {
14430 match self {
14431 swc_visit::Either::Left(visitor) => FoldAstPath::fold_span(visitor, node, __ast_path),
14432 swc_visit::Either::Right(visitor) => FoldAstPath::fold_span(visitor, node, __ast_path),
14433 }
14434 }
14435
14436 #[inline]
14437 fn fold_term(&mut self, node: Term, __ast_path: &mut AstKindPath) -> Term {
14438 match self {
14439 swc_visit::Either::Left(visitor) => FoldAstPath::fold_term(visitor, node, __ast_path),
14440 swc_visit::Either::Right(visitor) => FoldAstPath::fold_term(visitor, node, __ast_path),
14441 }
14442 }
14443
14444 #[inline]
14445 fn fold_terms(&mut self, node: Vec<Term>, __ast_path: &mut AstKindPath) -> Vec<Term> {
14446 match self {
14447 swc_visit::Either::Left(visitor) => FoldAstPath::fold_terms(visitor, node, __ast_path),
14448 swc_visit::Either::Right(visitor) => FoldAstPath::fold_terms(visitor, node, __ast_path),
14449 }
14450 }
14451
14452 #[inline]
14453 fn fold_unicode_property_escape(
14454 &mut self,
14455 node: UnicodePropertyEscape,
14456 __ast_path: &mut AstKindPath,
14457 ) -> UnicodePropertyEscape {
14458 match self {
14459 swc_visit::Either::Left(visitor) => {
14460 FoldAstPath::fold_unicode_property_escape(visitor, node, __ast_path)
14461 }
14462 swc_visit::Either::Right(visitor) => {
14463 FoldAstPath::fold_unicode_property_escape(visitor, node, __ast_path)
14464 }
14465 }
14466 }
14467}
14468#[cfg(any(docsrs, feature = "path"))]
14469#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
14470impl<V> FoldAstPath for ::swc_visit::Optional<V>
14471where
14472 V: FoldAstPath,
14473{
14474 #[inline]
14475 fn fold_alternative(&mut self, node: Alternative, __ast_path: &mut AstKindPath) -> Alternative {
14476 if self.enabled {
14477 <V as FoldAstPath>::fold_alternative(&mut self.visitor, node, __ast_path)
14478 } else {
14479 node
14480 }
14481 }
14482
14483 #[inline]
14484 fn fold_alternatives(
14485 &mut self,
14486 node: Vec<Alternative>,
14487 __ast_path: &mut AstKindPath,
14488 ) -> Vec<Alternative> {
14489 if self.enabled {
14490 <V as FoldAstPath>::fold_alternatives(&mut self.visitor, node, __ast_path)
14491 } else {
14492 node
14493 }
14494 }
14495
14496 #[inline]
14497 fn fold_atom(
14498 &mut self,
14499 node: swc_atoms::Atom,
14500 __ast_path: &mut AstKindPath,
14501 ) -> swc_atoms::Atom {
14502 if self.enabled {
14503 <V as FoldAstPath>::fold_atom(&mut self.visitor, node, __ast_path)
14504 } else {
14505 node
14506 }
14507 }
14508
14509 #[inline]
14510 fn fold_boundary_assertion(
14511 &mut self,
14512 node: BoundaryAssertion,
14513 __ast_path: &mut AstKindPath,
14514 ) -> BoundaryAssertion {
14515 if self.enabled {
14516 <V as FoldAstPath>::fold_boundary_assertion(&mut self.visitor, node, __ast_path)
14517 } else {
14518 node
14519 }
14520 }
14521
14522 #[inline]
14523 fn fold_boundary_assertion_kind(
14524 &mut self,
14525 node: BoundaryAssertionKind,
14526 __ast_path: &mut AstKindPath,
14527 ) -> BoundaryAssertionKind {
14528 if self.enabled {
14529 <V as FoldAstPath>::fold_boundary_assertion_kind(&mut self.visitor, node, __ast_path)
14530 } else {
14531 node
14532 }
14533 }
14534
14535 #[inline]
14536 fn fold_capturing_group(
14537 &mut self,
14538 node: CapturingGroup,
14539 __ast_path: &mut AstKindPath,
14540 ) -> CapturingGroup {
14541 if self.enabled {
14542 <V as FoldAstPath>::fold_capturing_group(&mut self.visitor, node, __ast_path)
14543 } else {
14544 node
14545 }
14546 }
14547
14548 #[inline]
14549 fn fold_character(&mut self, node: Character, __ast_path: &mut AstKindPath) -> Character {
14550 if self.enabled {
14551 <V as FoldAstPath>::fold_character(&mut self.visitor, node, __ast_path)
14552 } else {
14553 node
14554 }
14555 }
14556
14557 #[inline]
14558 fn fold_character_class(
14559 &mut self,
14560 node: CharacterClass,
14561 __ast_path: &mut AstKindPath,
14562 ) -> CharacterClass {
14563 if self.enabled {
14564 <V as FoldAstPath>::fold_character_class(&mut self.visitor, node, __ast_path)
14565 } else {
14566 node
14567 }
14568 }
14569
14570 #[inline]
14571 fn fold_character_class_contents(
14572 &mut self,
14573 node: CharacterClassContents,
14574 __ast_path: &mut AstKindPath,
14575 ) -> CharacterClassContents {
14576 if self.enabled {
14577 <V as FoldAstPath>::fold_character_class_contents(&mut self.visitor, node, __ast_path)
14578 } else {
14579 node
14580 }
14581 }
14582
14583 #[inline]
14584 fn fold_character_class_contents_kind(
14585 &mut self,
14586 node: CharacterClassContentsKind,
14587 __ast_path: &mut AstKindPath,
14588 ) -> CharacterClassContentsKind {
14589 if self.enabled {
14590 <V as FoldAstPath>::fold_character_class_contents_kind(
14591 &mut self.visitor,
14592 node,
14593 __ast_path,
14594 )
14595 } else {
14596 node
14597 }
14598 }
14599
14600 #[inline]
14601 fn fold_character_class_contentss(
14602 &mut self,
14603 node: Vec<CharacterClassContents>,
14604 __ast_path: &mut AstKindPath,
14605 ) -> Vec<CharacterClassContents> {
14606 if self.enabled {
14607 <V as FoldAstPath>::fold_character_class_contentss(&mut self.visitor, node, __ast_path)
14608 } else {
14609 node
14610 }
14611 }
14612
14613 #[inline]
14614 fn fold_character_class_escape(
14615 &mut self,
14616 node: CharacterClassEscape,
14617 __ast_path: &mut AstKindPath,
14618 ) -> CharacterClassEscape {
14619 if self.enabled {
14620 <V as FoldAstPath>::fold_character_class_escape(&mut self.visitor, node, __ast_path)
14621 } else {
14622 node
14623 }
14624 }
14625
14626 #[inline]
14627 fn fold_character_class_escape_kind(
14628 &mut self,
14629 node: CharacterClassEscapeKind,
14630 __ast_path: &mut AstKindPath,
14631 ) -> CharacterClassEscapeKind {
14632 if self.enabled {
14633 <V as FoldAstPath>::fold_character_class_escape_kind(
14634 &mut self.visitor,
14635 node,
14636 __ast_path,
14637 )
14638 } else {
14639 node
14640 }
14641 }
14642
14643 #[inline]
14644 fn fold_character_class_range(
14645 &mut self,
14646 node: CharacterClassRange,
14647 __ast_path: &mut AstKindPath,
14648 ) -> CharacterClassRange {
14649 if self.enabled {
14650 <V as FoldAstPath>::fold_character_class_range(&mut self.visitor, node, __ast_path)
14651 } else {
14652 node
14653 }
14654 }
14655
14656 #[inline]
14657 fn fold_character_kind(
14658 &mut self,
14659 node: CharacterKind,
14660 __ast_path: &mut AstKindPath,
14661 ) -> CharacterKind {
14662 if self.enabled {
14663 <V as FoldAstPath>::fold_character_kind(&mut self.visitor, node, __ast_path)
14664 } else {
14665 node
14666 }
14667 }
14668
14669 #[inline]
14670 fn fold_characters(
14671 &mut self,
14672 node: Vec<Character>,
14673 __ast_path: &mut AstKindPath,
14674 ) -> Vec<Character> {
14675 if self.enabled {
14676 <V as FoldAstPath>::fold_characters(&mut self.visitor, node, __ast_path)
14677 } else {
14678 node
14679 }
14680 }
14681
14682 #[inline]
14683 fn fold_class_string(
14684 &mut self,
14685 node: ClassString,
14686 __ast_path: &mut AstKindPath,
14687 ) -> ClassString {
14688 if self.enabled {
14689 <V as FoldAstPath>::fold_class_string(&mut self.visitor, node, __ast_path)
14690 } else {
14691 node
14692 }
14693 }
14694
14695 #[inline]
14696 fn fold_class_string_disjunction(
14697 &mut self,
14698 node: ClassStringDisjunction,
14699 __ast_path: &mut AstKindPath,
14700 ) -> ClassStringDisjunction {
14701 if self.enabled {
14702 <V as FoldAstPath>::fold_class_string_disjunction(&mut self.visitor, node, __ast_path)
14703 } else {
14704 node
14705 }
14706 }
14707
14708 #[inline]
14709 fn fold_class_strings(
14710 &mut self,
14711 node: Vec<ClassString>,
14712 __ast_path: &mut AstKindPath,
14713 ) -> Vec<ClassString> {
14714 if self.enabled {
14715 <V as FoldAstPath>::fold_class_strings(&mut self.visitor, node, __ast_path)
14716 } else {
14717 node
14718 }
14719 }
14720
14721 #[inline]
14722 fn fold_disjunction(&mut self, node: Disjunction, __ast_path: &mut AstKindPath) -> Disjunction {
14723 if self.enabled {
14724 <V as FoldAstPath>::fold_disjunction(&mut self.visitor, node, __ast_path)
14725 } else {
14726 node
14727 }
14728 }
14729
14730 #[inline]
14731 fn fold_dot(&mut self, node: Dot, __ast_path: &mut AstKindPath) -> Dot {
14732 if self.enabled {
14733 <V as FoldAstPath>::fold_dot(&mut self.visitor, node, __ast_path)
14734 } else {
14735 node
14736 }
14737 }
14738
14739 #[inline]
14740 fn fold_ignore_group(
14741 &mut self,
14742 node: IgnoreGroup,
14743 __ast_path: &mut AstKindPath,
14744 ) -> IgnoreGroup {
14745 if self.enabled {
14746 <V as FoldAstPath>::fold_ignore_group(&mut self.visitor, node, __ast_path)
14747 } else {
14748 node
14749 }
14750 }
14751
14752 #[inline]
14753 fn fold_indexed_reference(
14754 &mut self,
14755 node: IndexedReference,
14756 __ast_path: &mut AstKindPath,
14757 ) -> IndexedReference {
14758 if self.enabled {
14759 <V as FoldAstPath>::fold_indexed_reference(&mut self.visitor, node, __ast_path)
14760 } else {
14761 node
14762 }
14763 }
14764
14765 #[inline]
14766 fn fold_look_around_assertion(
14767 &mut self,
14768 node: LookAroundAssertion,
14769 __ast_path: &mut AstKindPath,
14770 ) -> LookAroundAssertion {
14771 if self.enabled {
14772 <V as FoldAstPath>::fold_look_around_assertion(&mut self.visitor, node, __ast_path)
14773 } else {
14774 node
14775 }
14776 }
14777
14778 #[inline]
14779 fn fold_look_around_assertion_kind(
14780 &mut self,
14781 node: LookAroundAssertionKind,
14782 __ast_path: &mut AstKindPath,
14783 ) -> LookAroundAssertionKind {
14784 if self.enabled {
14785 <V as FoldAstPath>::fold_look_around_assertion_kind(&mut self.visitor, node, __ast_path)
14786 } else {
14787 node
14788 }
14789 }
14790
14791 #[inline]
14792 fn fold_modifier(&mut self, node: Modifier, __ast_path: &mut AstKindPath) -> Modifier {
14793 if self.enabled {
14794 <V as FoldAstPath>::fold_modifier(&mut self.visitor, node, __ast_path)
14795 } else {
14796 node
14797 }
14798 }
14799
14800 #[inline]
14801 fn fold_modifiers(&mut self, node: Modifiers, __ast_path: &mut AstKindPath) -> Modifiers {
14802 if self.enabled {
14803 <V as FoldAstPath>::fold_modifiers(&mut self.visitor, node, __ast_path)
14804 } else {
14805 node
14806 }
14807 }
14808
14809 #[inline]
14810 fn fold_named_reference(
14811 &mut self,
14812 node: NamedReference,
14813 __ast_path: &mut AstKindPath,
14814 ) -> NamedReference {
14815 if self.enabled {
14816 <V as FoldAstPath>::fold_named_reference(&mut self.visitor, node, __ast_path)
14817 } else {
14818 node
14819 }
14820 }
14821
14822 #[inline]
14823 fn fold_opt_atom(
14824 &mut self,
14825 node: Option<swc_atoms::Atom>,
14826 __ast_path: &mut AstKindPath,
14827 ) -> Option<swc_atoms::Atom> {
14828 if self.enabled {
14829 <V as FoldAstPath>::fold_opt_atom(&mut self.visitor, node, __ast_path)
14830 } else {
14831 node
14832 }
14833 }
14834
14835 #[inline]
14836 fn fold_opt_modifiers(
14837 &mut self,
14838 node: Option<Modifiers>,
14839 __ast_path: &mut AstKindPath,
14840 ) -> Option<Modifiers> {
14841 if self.enabled {
14842 <V as FoldAstPath>::fold_opt_modifiers(&mut self.visitor, node, __ast_path)
14843 } else {
14844 node
14845 }
14846 }
14847
14848 #[inline]
14849 fn fold_pattern(&mut self, node: Pattern, __ast_path: &mut AstKindPath) -> Pattern {
14850 if self.enabled {
14851 <V as FoldAstPath>::fold_pattern(&mut self.visitor, node, __ast_path)
14852 } else {
14853 node
14854 }
14855 }
14856
14857 #[inline]
14858 fn fold_quantifier(&mut self, node: Quantifier, __ast_path: &mut AstKindPath) -> Quantifier {
14859 if self.enabled {
14860 <V as FoldAstPath>::fold_quantifier(&mut self.visitor, node, __ast_path)
14861 } else {
14862 node
14863 }
14864 }
14865
14866 #[inline]
14867 fn fold_span(
14868 &mut self,
14869 node: swc_common::Span,
14870 __ast_path: &mut AstKindPath,
14871 ) -> swc_common::Span {
14872 if self.enabled {
14873 <V as FoldAstPath>::fold_span(&mut self.visitor, node, __ast_path)
14874 } else {
14875 node
14876 }
14877 }
14878
14879 #[inline]
14880 fn fold_term(&mut self, node: Term, __ast_path: &mut AstKindPath) -> Term {
14881 if self.enabled {
14882 <V as FoldAstPath>::fold_term(&mut self.visitor, node, __ast_path)
14883 } else {
14884 node
14885 }
14886 }
14887
14888 #[inline]
14889 fn fold_terms(&mut self, node: Vec<Term>, __ast_path: &mut AstKindPath) -> Vec<Term> {
14890 if self.enabled {
14891 <V as FoldAstPath>::fold_terms(&mut self.visitor, node, __ast_path)
14892 } else {
14893 node
14894 }
14895 }
14896
14897 #[inline]
14898 fn fold_unicode_property_escape(
14899 &mut self,
14900 node: UnicodePropertyEscape,
14901 __ast_path: &mut AstKindPath,
14902 ) -> UnicodePropertyEscape {
14903 if self.enabled {
14904 <V as FoldAstPath>::fold_unicode_property_escape(&mut self.visitor, node, __ast_path)
14905 } else {
14906 node
14907 }
14908 }
14909}
14910#[doc = r" A trait implemented for types that can be visited using a visitor."]
14911#[cfg(any(docsrs, feature = "path"))]
14912#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
14913pub trait FoldWithAstPath<V: ?Sized + FoldAstPath> {
14914 #[doc = r" Calls a visitor method (visitor.fold_xxx) with self."]
14915 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self;
14916 #[doc = r" Visit children nodes of `self`` with `visitor`."]
14917 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self;
14918}
14919#[cfg(any(docsrs, feature = "path"))]
14920#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
14921impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for Alternative {
14922 #[doc = "Calls [FoldAstPath`::fold_alternative`] with `self`."]
14923 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
14924 <V as FoldAstPath>::fold_alternative(visitor, self, __ast_path)
14925 }
14926
14927 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
14928 match self {
14929 Alternative { span, body } => {
14930 let span = {
14931 let mut __ast_path = __ast_path.with_guard(AstParentKind::Alternative(
14932 self::fields::AlternativeField::Span,
14933 ));
14934 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
14935 span,
14936 visitor,
14937 &mut *__ast_path,
14938 )
14939 };
14940 let body = {
14941 let mut __ast_path = __ast_path.with_guard(AstParentKind::Alternative(
14942 self::fields::AlternativeField::Body(usize::MAX),
14943 ));
14944 <Vec<Term> as FoldWithAstPath<V>>::fold_with_ast_path(
14945 body,
14946 visitor,
14947 &mut *__ast_path,
14948 )
14949 };
14950 Alternative { span, body }
14951 }
14952 }
14953 }
14954}
14955#[cfg(any(docsrs, feature = "path"))]
14956#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
14957impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for BoundaryAssertion {
14958 #[doc = "Calls [FoldAstPath`::fold_boundary_assertion`] with `self`."]
14959 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
14960 <V as FoldAstPath>::fold_boundary_assertion(visitor, self, __ast_path)
14961 }
14962
14963 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
14964 match self {
14965 BoundaryAssertion { span, kind } => {
14966 let span = {
14967 let mut __ast_path = __ast_path.with_guard(AstParentKind::BoundaryAssertion(
14968 self::fields::BoundaryAssertionField::Span,
14969 ));
14970 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
14971 span,
14972 visitor,
14973 &mut *__ast_path,
14974 )
14975 };
14976 let kind = {
14977 let mut __ast_path = __ast_path.with_guard(AstParentKind::BoundaryAssertion(
14978 self::fields::BoundaryAssertionField::Kind,
14979 ));
14980 <BoundaryAssertionKind as FoldWithAstPath<V>>::fold_with_ast_path(
14981 kind,
14982 visitor,
14983 &mut *__ast_path,
14984 )
14985 };
14986 BoundaryAssertion { span, kind }
14987 }
14988 }
14989 }
14990}
14991#[cfg(any(docsrs, feature = "path"))]
14992#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
14993impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for BoundaryAssertionKind {
14994 #[doc = "Calls [FoldAstPath`::fold_boundary_assertion_kind`] with `self`."]
14995 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
14996 <V as FoldAstPath>::fold_boundary_assertion_kind(visitor, self, __ast_path)
14997 }
14998
14999 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15000 match self {
15001 BoundaryAssertionKind::Start => BoundaryAssertionKind::Start,
15002 BoundaryAssertionKind::End => BoundaryAssertionKind::End,
15003 BoundaryAssertionKind::Boundary => BoundaryAssertionKind::Boundary,
15004 BoundaryAssertionKind::NegativeBoundary => BoundaryAssertionKind::NegativeBoundary,
15005 }
15006 }
15007}
15008#[cfg(any(docsrs, feature = "path"))]
15009#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15010impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for CapturingGroup {
15011 #[doc = "Calls [FoldAstPath`::fold_capturing_group`] with `self`."]
15012 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15013 <V as FoldAstPath>::fold_capturing_group(visitor, self, __ast_path)
15014 }
15015
15016 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15017 match self {
15018 CapturingGroup { span, name, body } => {
15019 let span = {
15020 let mut __ast_path = __ast_path.with_guard(AstParentKind::CapturingGroup(
15021 self::fields::CapturingGroupField::Span,
15022 ));
15023 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
15024 span,
15025 visitor,
15026 &mut *__ast_path,
15027 )
15028 };
15029 let name = {
15030 let mut __ast_path = __ast_path.with_guard(AstParentKind::CapturingGroup(
15031 self::fields::CapturingGroupField::Name,
15032 ));
15033 <Option<swc_atoms::Atom> as FoldWithAstPath<V>>::fold_with_ast_path(
15034 name,
15035 visitor,
15036 &mut *__ast_path,
15037 )
15038 };
15039 let body = {
15040 let mut __ast_path = __ast_path.with_guard(AstParentKind::CapturingGroup(
15041 self::fields::CapturingGroupField::Body,
15042 ));
15043 <Disjunction as FoldWithAstPath<V>>::fold_with_ast_path(
15044 body,
15045 visitor,
15046 &mut *__ast_path,
15047 )
15048 };
15049 CapturingGroup { span, name, body }
15050 }
15051 }
15052 }
15053}
15054#[cfg(any(docsrs, feature = "path"))]
15055#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15056impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for Character {
15057 #[doc = "Calls [FoldAstPath`::fold_character`] with `self`."]
15058 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15059 <V as FoldAstPath>::fold_character(visitor, self, __ast_path)
15060 }
15061
15062 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15063 match self {
15064 Character { span, kind, value } => {
15065 let span = {
15066 let mut __ast_path = __ast_path
15067 .with_guard(AstParentKind::Character(self::fields::CharacterField::Span));
15068 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
15069 span,
15070 visitor,
15071 &mut *__ast_path,
15072 )
15073 };
15074 let kind = {
15075 let mut __ast_path = __ast_path
15076 .with_guard(AstParentKind::Character(self::fields::CharacterField::Kind));
15077 <CharacterKind as FoldWithAstPath<V>>::fold_with_ast_path(
15078 kind,
15079 visitor,
15080 &mut *__ast_path,
15081 )
15082 };
15083 Character { span, kind, value }
15084 }
15085 }
15086 }
15087}
15088#[cfg(any(docsrs, feature = "path"))]
15089#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15090impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for CharacterClass {
15091 #[doc = "Calls [FoldAstPath`::fold_character_class`] with `self`."]
15092 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15093 <V as FoldAstPath>::fold_character_class(visitor, self, __ast_path)
15094 }
15095
15096 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15097 match self {
15098 CharacterClass {
15099 span,
15100 negative,
15101 strings,
15102 kind,
15103 body,
15104 } => {
15105 let span = {
15106 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClass(
15107 self::fields::CharacterClassField::Span,
15108 ));
15109 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
15110 span,
15111 visitor,
15112 &mut *__ast_path,
15113 )
15114 };
15115 let kind = {
15116 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClass(
15117 self::fields::CharacterClassField::Kind,
15118 ));
15119 <CharacterClassContentsKind as FoldWithAstPath<V>>::fold_with_ast_path(
15120 kind,
15121 visitor,
15122 &mut *__ast_path,
15123 )
15124 };
15125 let body = {
15126 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClass(
15127 self::fields::CharacterClassField::Body(usize::MAX),
15128 ));
15129 <Vec<CharacterClassContents> as FoldWithAstPath<V>>::fold_with_ast_path(
15130 body,
15131 visitor,
15132 &mut *__ast_path,
15133 )
15134 };
15135 CharacterClass {
15136 span,
15137 negative,
15138 strings,
15139 kind,
15140 body,
15141 }
15142 }
15143 }
15144 }
15145}
15146#[cfg(any(docsrs, feature = "path"))]
15147#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15148impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for CharacterClassContents {
15149 #[doc = "Calls [FoldAstPath`::fold_character_class_contents`] with `self`."]
15150 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15151 <V as FoldAstPath>::fold_character_class_contents(visitor, self, __ast_path)
15152 }
15153
15154 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15155 match self {
15156 CharacterClassContents::CharacterClassRange { 0: _field_0 } => {
15157 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents(
15158 self::fields::CharacterClassContentsField::CharacterClassRange,
15159 ));
15160 let _field_0 = <Box<CharacterClassRange> as FoldWithAstPath<V>>::fold_with_ast_path(
15161 _field_0,
15162 visitor,
15163 &mut *__ast_path,
15164 );
15165 CharacterClassContents::CharacterClassRange { 0: _field_0 }
15166 }
15167 CharacterClassContents::CharacterClassEscape { 0: _field_0 } => {
15168 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents(
15169 self::fields::CharacterClassContentsField::CharacterClassEscape,
15170 ));
15171 let _field_0 =
15172 <Box<CharacterClassEscape> as FoldWithAstPath<V>>::fold_with_ast_path(
15173 _field_0,
15174 visitor,
15175 &mut *__ast_path,
15176 );
15177 CharacterClassContents::CharacterClassEscape { 0: _field_0 }
15178 }
15179 CharacterClassContents::UnicodePropertyEscape { 0: _field_0 } => {
15180 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents(
15181 self::fields::CharacterClassContentsField::UnicodePropertyEscape,
15182 ));
15183 let _field_0 =
15184 <Box<UnicodePropertyEscape> as FoldWithAstPath<V>>::fold_with_ast_path(
15185 _field_0,
15186 visitor,
15187 &mut *__ast_path,
15188 );
15189 CharacterClassContents::UnicodePropertyEscape { 0: _field_0 }
15190 }
15191 CharacterClassContents::Character { 0: _field_0 } => {
15192 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents(
15193 self::fields::CharacterClassContentsField::Character,
15194 ));
15195 let _field_0 = <Box<Character> as FoldWithAstPath<V>>::fold_with_ast_path(
15196 _field_0,
15197 visitor,
15198 &mut *__ast_path,
15199 );
15200 CharacterClassContents::Character { 0: _field_0 }
15201 }
15202 CharacterClassContents::NestedCharacterClass { 0: _field_0 } => {
15203 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents(
15204 self::fields::CharacterClassContentsField::NestedCharacterClass,
15205 ));
15206 let _field_0 = <Box<CharacterClass> as FoldWithAstPath<V>>::fold_with_ast_path(
15207 _field_0,
15208 visitor,
15209 &mut *__ast_path,
15210 );
15211 CharacterClassContents::NestedCharacterClass { 0: _field_0 }
15212 }
15213 CharacterClassContents::ClassStringDisjunction { 0: _field_0 } => {
15214 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassContents(
15215 self::fields::CharacterClassContentsField::ClassStringDisjunction,
15216 ));
15217 let _field_0 =
15218 <Box<ClassStringDisjunction> as FoldWithAstPath<V>>::fold_with_ast_path(
15219 _field_0,
15220 visitor,
15221 &mut *__ast_path,
15222 );
15223 CharacterClassContents::ClassStringDisjunction { 0: _field_0 }
15224 }
15225 }
15226 }
15227}
15228#[cfg(any(docsrs, feature = "path"))]
15229#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15230impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for CharacterClassContentsKind {
15231 #[doc = "Calls [FoldAstPath`::fold_character_class_contents_kind`] with `self`."]
15232 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15233 <V as FoldAstPath>::fold_character_class_contents_kind(visitor, self, __ast_path)
15234 }
15235
15236 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15237 match self {
15238 CharacterClassContentsKind::Union => CharacterClassContentsKind::Union,
15239 CharacterClassContentsKind::Intersection => CharacterClassContentsKind::Intersection,
15240 CharacterClassContentsKind::Subtraction => CharacterClassContentsKind::Subtraction,
15241 }
15242 }
15243}
15244#[cfg(any(docsrs, feature = "path"))]
15245#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15246impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for CharacterClassEscape {
15247 #[doc = "Calls [FoldAstPath`::fold_character_class_escape`] with `self`."]
15248 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15249 <V as FoldAstPath>::fold_character_class_escape(visitor, self, __ast_path)
15250 }
15251
15252 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15253 match self {
15254 CharacterClassEscape { span, kind } => {
15255 let span = {
15256 let mut __ast_path =
15257 __ast_path.with_guard(AstParentKind::CharacterClassEscape(
15258 self::fields::CharacterClassEscapeField::Span,
15259 ));
15260 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
15261 span,
15262 visitor,
15263 &mut *__ast_path,
15264 )
15265 };
15266 let kind = {
15267 let mut __ast_path =
15268 __ast_path.with_guard(AstParentKind::CharacterClassEscape(
15269 self::fields::CharacterClassEscapeField::Kind,
15270 ));
15271 <CharacterClassEscapeKind as FoldWithAstPath<V>>::fold_with_ast_path(
15272 kind,
15273 visitor,
15274 &mut *__ast_path,
15275 )
15276 };
15277 CharacterClassEscape { span, kind }
15278 }
15279 }
15280 }
15281}
15282#[cfg(any(docsrs, feature = "path"))]
15283#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15284impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for CharacterClassEscapeKind {
15285 #[doc = "Calls [FoldAstPath`::fold_character_class_escape_kind`] with `self`."]
15286 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15287 <V as FoldAstPath>::fold_character_class_escape_kind(visitor, self, __ast_path)
15288 }
15289
15290 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15291 match self {
15292 CharacterClassEscapeKind::D => CharacterClassEscapeKind::D,
15293 CharacterClassEscapeKind::NegativeD => CharacterClassEscapeKind::NegativeD,
15294 CharacterClassEscapeKind::S => CharacterClassEscapeKind::S,
15295 CharacterClassEscapeKind::NegativeS => CharacterClassEscapeKind::NegativeS,
15296 CharacterClassEscapeKind::W => CharacterClassEscapeKind::W,
15297 CharacterClassEscapeKind::NegativeW => CharacterClassEscapeKind::NegativeW,
15298 }
15299 }
15300}
15301#[cfg(any(docsrs, feature = "path"))]
15302#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15303impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for CharacterClassRange {
15304 #[doc = "Calls [FoldAstPath`::fold_character_class_range`] with `self`."]
15305 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15306 <V as FoldAstPath>::fold_character_class_range(visitor, self, __ast_path)
15307 }
15308
15309 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15310 match self {
15311 CharacterClassRange { span, min, max } => {
15312 let span = {
15313 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassRange(
15314 self::fields::CharacterClassRangeField::Span,
15315 ));
15316 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
15317 span,
15318 visitor,
15319 &mut *__ast_path,
15320 )
15321 };
15322 let min = {
15323 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassRange(
15324 self::fields::CharacterClassRangeField::Min,
15325 ));
15326 <Character as FoldWithAstPath<V>>::fold_with_ast_path(
15327 min,
15328 visitor,
15329 &mut *__ast_path,
15330 )
15331 };
15332 let max = {
15333 let mut __ast_path = __ast_path.with_guard(AstParentKind::CharacterClassRange(
15334 self::fields::CharacterClassRangeField::Max,
15335 ));
15336 <Character as FoldWithAstPath<V>>::fold_with_ast_path(
15337 max,
15338 visitor,
15339 &mut *__ast_path,
15340 )
15341 };
15342 CharacterClassRange { span, min, max }
15343 }
15344 }
15345 }
15346}
15347#[cfg(any(docsrs, feature = "path"))]
15348#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15349impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for CharacterKind {
15350 #[doc = "Calls [FoldAstPath`::fold_character_kind`] with `self`."]
15351 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15352 <V as FoldAstPath>::fold_character_kind(visitor, self, __ast_path)
15353 }
15354
15355 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15356 match self {
15357 CharacterKind::ControlLetter => CharacterKind::ControlLetter,
15358 CharacterKind::HexadecimalEscape => CharacterKind::HexadecimalEscape,
15359 CharacterKind::Identifier => CharacterKind::Identifier,
15360 CharacterKind::Null => CharacterKind::Null,
15361 CharacterKind::Octal1 => CharacterKind::Octal1,
15362 CharacterKind::Octal2 => CharacterKind::Octal2,
15363 CharacterKind::Octal3 => CharacterKind::Octal3,
15364 CharacterKind::SingleEscape => CharacterKind::SingleEscape,
15365 CharacterKind::Symbol => CharacterKind::Symbol,
15366 CharacterKind::UnicodeEscape => CharacterKind::UnicodeEscape,
15367 }
15368 }
15369}
15370#[cfg(any(docsrs, feature = "path"))]
15371#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15372impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for ClassString {
15373 #[doc = "Calls [FoldAstPath`::fold_class_string`] with `self`."]
15374 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15375 <V as FoldAstPath>::fold_class_string(visitor, self, __ast_path)
15376 }
15377
15378 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15379 match self {
15380 ClassString {
15381 span,
15382 strings,
15383 body,
15384 } => {
15385 let span = {
15386 let mut __ast_path = __ast_path.with_guard(AstParentKind::ClassString(
15387 self::fields::ClassStringField::Span,
15388 ));
15389 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
15390 span,
15391 visitor,
15392 &mut *__ast_path,
15393 )
15394 };
15395 let body = {
15396 let mut __ast_path = __ast_path.with_guard(AstParentKind::ClassString(
15397 self::fields::ClassStringField::Body(usize::MAX),
15398 ));
15399 <Vec<Character> as FoldWithAstPath<V>>::fold_with_ast_path(
15400 body,
15401 visitor,
15402 &mut *__ast_path,
15403 )
15404 };
15405 ClassString {
15406 span,
15407 strings,
15408 body,
15409 }
15410 }
15411 }
15412 }
15413}
15414#[cfg(any(docsrs, feature = "path"))]
15415#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15416impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for ClassStringDisjunction {
15417 #[doc = "Calls [FoldAstPath`::fold_class_string_disjunction`] with `self`."]
15418 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15419 <V as FoldAstPath>::fold_class_string_disjunction(visitor, self, __ast_path)
15420 }
15421
15422 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15423 match self {
15424 ClassStringDisjunction {
15425 span,
15426 strings,
15427 body,
15428 } => {
15429 let span = {
15430 let mut __ast_path =
15431 __ast_path.with_guard(AstParentKind::ClassStringDisjunction(
15432 self::fields::ClassStringDisjunctionField::Span,
15433 ));
15434 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
15435 span,
15436 visitor,
15437 &mut *__ast_path,
15438 )
15439 };
15440 let body = {
15441 let mut __ast_path =
15442 __ast_path.with_guard(AstParentKind::ClassStringDisjunction(
15443 self::fields::ClassStringDisjunctionField::Body(usize::MAX),
15444 ));
15445 <Vec<ClassString> as FoldWithAstPath<V>>::fold_with_ast_path(
15446 body,
15447 visitor,
15448 &mut *__ast_path,
15449 )
15450 };
15451 ClassStringDisjunction {
15452 span,
15453 strings,
15454 body,
15455 }
15456 }
15457 }
15458 }
15459}
15460#[cfg(any(docsrs, feature = "path"))]
15461#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15462impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for Disjunction {
15463 #[doc = "Calls [FoldAstPath`::fold_disjunction`] with `self`."]
15464 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15465 <V as FoldAstPath>::fold_disjunction(visitor, self, __ast_path)
15466 }
15467
15468 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15469 match self {
15470 Disjunction { span, body } => {
15471 let span = {
15472 let mut __ast_path = __ast_path.with_guard(AstParentKind::Disjunction(
15473 self::fields::DisjunctionField::Span,
15474 ));
15475 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
15476 span,
15477 visitor,
15478 &mut *__ast_path,
15479 )
15480 };
15481 let body = {
15482 let mut __ast_path = __ast_path.with_guard(AstParentKind::Disjunction(
15483 self::fields::DisjunctionField::Body(usize::MAX),
15484 ));
15485 <Vec<Alternative> as FoldWithAstPath<V>>::fold_with_ast_path(
15486 body,
15487 visitor,
15488 &mut *__ast_path,
15489 )
15490 };
15491 Disjunction { span, body }
15492 }
15493 }
15494 }
15495}
15496#[cfg(any(docsrs, feature = "path"))]
15497#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15498impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for Dot {
15499 #[doc = "Calls [FoldAstPath`::fold_dot`] with `self`."]
15500 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15501 <V as FoldAstPath>::fold_dot(visitor, self, __ast_path)
15502 }
15503
15504 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15505 match self {
15506 Dot { span } => {
15507 let span = {
15508 let mut __ast_path =
15509 __ast_path.with_guard(AstParentKind::Dot(self::fields::DotField::Span));
15510 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
15511 span,
15512 visitor,
15513 &mut *__ast_path,
15514 )
15515 };
15516 Dot { span }
15517 }
15518 }
15519 }
15520}
15521#[cfg(any(docsrs, feature = "path"))]
15522#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15523impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for IgnoreGroup {
15524 #[doc = "Calls [FoldAstPath`::fold_ignore_group`] with `self`."]
15525 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15526 <V as FoldAstPath>::fold_ignore_group(visitor, self, __ast_path)
15527 }
15528
15529 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15530 match self {
15531 IgnoreGroup {
15532 span,
15533 modifiers,
15534 body,
15535 } => {
15536 let span = {
15537 let mut __ast_path = __ast_path.with_guard(AstParentKind::IgnoreGroup(
15538 self::fields::IgnoreGroupField::Span,
15539 ));
15540 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
15541 span,
15542 visitor,
15543 &mut *__ast_path,
15544 )
15545 };
15546 let modifiers = {
15547 let mut __ast_path = __ast_path.with_guard(AstParentKind::IgnoreGroup(
15548 self::fields::IgnoreGroupField::Modifiers,
15549 ));
15550 <Option<Modifiers> as FoldWithAstPath<V>>::fold_with_ast_path(
15551 modifiers,
15552 visitor,
15553 &mut *__ast_path,
15554 )
15555 };
15556 let body = {
15557 let mut __ast_path = __ast_path.with_guard(AstParentKind::IgnoreGroup(
15558 self::fields::IgnoreGroupField::Body,
15559 ));
15560 <Disjunction as FoldWithAstPath<V>>::fold_with_ast_path(
15561 body,
15562 visitor,
15563 &mut *__ast_path,
15564 )
15565 };
15566 IgnoreGroup {
15567 span,
15568 modifiers,
15569 body,
15570 }
15571 }
15572 }
15573 }
15574}
15575#[cfg(any(docsrs, feature = "path"))]
15576#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15577impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for IndexedReference {
15578 #[doc = "Calls [FoldAstPath`::fold_indexed_reference`] with `self`."]
15579 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15580 <V as FoldAstPath>::fold_indexed_reference(visitor, self, __ast_path)
15581 }
15582
15583 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15584 match self {
15585 IndexedReference { span, index } => {
15586 let span = {
15587 let mut __ast_path = __ast_path.with_guard(AstParentKind::IndexedReference(
15588 self::fields::IndexedReferenceField::Span,
15589 ));
15590 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
15591 span,
15592 visitor,
15593 &mut *__ast_path,
15594 )
15595 };
15596 IndexedReference { span, index }
15597 }
15598 }
15599 }
15600}
15601#[cfg(any(docsrs, feature = "path"))]
15602#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15603impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for LookAroundAssertion {
15604 #[doc = "Calls [FoldAstPath`::fold_look_around_assertion`] with `self`."]
15605 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15606 <V as FoldAstPath>::fold_look_around_assertion(visitor, self, __ast_path)
15607 }
15608
15609 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15610 match self {
15611 LookAroundAssertion { span, kind, body } => {
15612 let span = {
15613 let mut __ast_path = __ast_path.with_guard(AstParentKind::LookAroundAssertion(
15614 self::fields::LookAroundAssertionField::Span,
15615 ));
15616 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
15617 span,
15618 visitor,
15619 &mut *__ast_path,
15620 )
15621 };
15622 let kind = {
15623 let mut __ast_path = __ast_path.with_guard(AstParentKind::LookAroundAssertion(
15624 self::fields::LookAroundAssertionField::Kind,
15625 ));
15626 <LookAroundAssertionKind as FoldWithAstPath<V>>::fold_with_ast_path(
15627 kind,
15628 visitor,
15629 &mut *__ast_path,
15630 )
15631 };
15632 let body = {
15633 let mut __ast_path = __ast_path.with_guard(AstParentKind::LookAroundAssertion(
15634 self::fields::LookAroundAssertionField::Body,
15635 ));
15636 <Disjunction as FoldWithAstPath<V>>::fold_with_ast_path(
15637 body,
15638 visitor,
15639 &mut *__ast_path,
15640 )
15641 };
15642 LookAroundAssertion { span, kind, body }
15643 }
15644 }
15645 }
15646}
15647#[cfg(any(docsrs, feature = "path"))]
15648#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15649impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for LookAroundAssertionKind {
15650 #[doc = "Calls [FoldAstPath`::fold_look_around_assertion_kind`] with `self`."]
15651 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15652 <V as FoldAstPath>::fold_look_around_assertion_kind(visitor, self, __ast_path)
15653 }
15654
15655 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15656 match self {
15657 LookAroundAssertionKind::Lookahead => LookAroundAssertionKind::Lookahead,
15658 LookAroundAssertionKind::NegativeLookahead => {
15659 LookAroundAssertionKind::NegativeLookahead
15660 }
15661 LookAroundAssertionKind::Lookbehind => LookAroundAssertionKind::Lookbehind,
15662 LookAroundAssertionKind::NegativeLookbehind => {
15663 LookAroundAssertionKind::NegativeLookbehind
15664 }
15665 }
15666 }
15667}
15668#[cfg(any(docsrs, feature = "path"))]
15669#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15670impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for Modifiers {
15671 #[doc = "Calls [FoldAstPath`::fold_modifiers`] with `self`."]
15672 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15673 <V as FoldAstPath>::fold_modifiers(visitor, self, __ast_path)
15674 }
15675
15676 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15677 match self {
15678 Modifiers {
15679 span,
15680 enabling,
15681 disabling,
15682 } => {
15683 let span = {
15684 let mut __ast_path = __ast_path
15685 .with_guard(AstParentKind::Modifiers(self::fields::ModifiersField::Span));
15686 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
15687 span,
15688 visitor,
15689 &mut *__ast_path,
15690 )
15691 };
15692 let enabling = {
15693 let mut __ast_path = __ast_path.with_guard(AstParentKind::Modifiers(
15694 self::fields::ModifiersField::Enabling,
15695 ));
15696 <Modifier as FoldWithAstPath<V>>::fold_with_ast_path(
15697 enabling,
15698 visitor,
15699 &mut *__ast_path,
15700 )
15701 };
15702 let disabling = {
15703 let mut __ast_path = __ast_path.with_guard(AstParentKind::Modifiers(
15704 self::fields::ModifiersField::Disabling,
15705 ));
15706 <Modifier as FoldWithAstPath<V>>::fold_with_ast_path(
15707 disabling,
15708 visitor,
15709 &mut *__ast_path,
15710 )
15711 };
15712 Modifiers {
15713 span,
15714 enabling,
15715 disabling,
15716 }
15717 }
15718 }
15719 }
15720}
15721#[cfg(any(docsrs, feature = "path"))]
15722#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15723impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for NamedReference {
15724 #[doc = "Calls [FoldAstPath`::fold_named_reference`] with `self`."]
15725 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15726 <V as FoldAstPath>::fold_named_reference(visitor, self, __ast_path)
15727 }
15728
15729 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15730 match self {
15731 NamedReference { span, name } => {
15732 let span = {
15733 let mut __ast_path = __ast_path.with_guard(AstParentKind::NamedReference(
15734 self::fields::NamedReferenceField::Span,
15735 ));
15736 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
15737 span,
15738 visitor,
15739 &mut *__ast_path,
15740 )
15741 };
15742 let name = {
15743 let mut __ast_path = __ast_path.with_guard(AstParentKind::NamedReference(
15744 self::fields::NamedReferenceField::Name,
15745 ));
15746 <swc_atoms::Atom as FoldWithAstPath<V>>::fold_with_ast_path(
15747 name,
15748 visitor,
15749 &mut *__ast_path,
15750 )
15751 };
15752 NamedReference { span, name }
15753 }
15754 }
15755 }
15756}
15757#[cfg(any(docsrs, feature = "path"))]
15758#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15759impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for Pattern {
15760 #[doc = "Calls [FoldAstPath`::fold_pattern`] with `self`."]
15761 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15762 <V as FoldAstPath>::fold_pattern(visitor, self, __ast_path)
15763 }
15764
15765 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15766 match self {
15767 Pattern { span, body } => {
15768 let span = {
15769 let mut __ast_path = __ast_path
15770 .with_guard(AstParentKind::Pattern(self::fields::PatternField::Span));
15771 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
15772 span,
15773 visitor,
15774 &mut *__ast_path,
15775 )
15776 };
15777 let body = {
15778 let mut __ast_path = __ast_path
15779 .with_guard(AstParentKind::Pattern(self::fields::PatternField::Body));
15780 <Disjunction as FoldWithAstPath<V>>::fold_with_ast_path(
15781 body,
15782 visitor,
15783 &mut *__ast_path,
15784 )
15785 };
15786 Pattern { span, body }
15787 }
15788 }
15789 }
15790}
15791#[cfg(any(docsrs, feature = "path"))]
15792#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15793impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for Quantifier {
15794 #[doc = "Calls [FoldAstPath`::fold_quantifier`] with `self`."]
15795 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15796 <V as FoldAstPath>::fold_quantifier(visitor, self, __ast_path)
15797 }
15798
15799 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15800 match self {
15801 Quantifier {
15802 span,
15803 min,
15804 max,
15805 greedy,
15806 body,
15807 } => {
15808 let span = {
15809 let mut __ast_path = __ast_path.with_guard(AstParentKind::Quantifier(
15810 self::fields::QuantifierField::Span,
15811 ));
15812 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
15813 span,
15814 visitor,
15815 &mut *__ast_path,
15816 )
15817 };
15818 let body = {
15819 let mut __ast_path = __ast_path.with_guard(AstParentKind::Quantifier(
15820 self::fields::QuantifierField::Body,
15821 ));
15822 <Term as FoldWithAstPath<V>>::fold_with_ast_path(
15823 body,
15824 visitor,
15825 &mut *__ast_path,
15826 )
15827 };
15828 Quantifier {
15829 span,
15830 min,
15831 max,
15832 greedy,
15833 body,
15834 }
15835 }
15836 }
15837 }
15838}
15839#[cfg(any(docsrs, feature = "path"))]
15840#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15841impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for Term {
15842 #[doc = "Calls [FoldAstPath`::fold_term`] with `self`."]
15843 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15844 <V as FoldAstPath>::fold_term(visitor, self, __ast_path)
15845 }
15846
15847 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15848 match self {
15849 Term::BoundaryAssertion { 0: _field_0 } => {
15850 let mut __ast_path = __ast_path.with_guard(AstParentKind::Term(
15851 self::fields::TermField::BoundaryAssertion,
15852 ));
15853 let _field_0 = <Box<BoundaryAssertion> as FoldWithAstPath<V>>::fold_with_ast_path(
15854 _field_0,
15855 visitor,
15856 &mut *__ast_path,
15857 );
15858 Term::BoundaryAssertion { 0: _field_0 }
15859 }
15860 Term::LookAroundAssertion { 0: _field_0 } => {
15861 let mut __ast_path = __ast_path.with_guard(AstParentKind::Term(
15862 self::fields::TermField::LookAroundAssertion,
15863 ));
15864 let _field_0 = <Box<LookAroundAssertion> as FoldWithAstPath<V>>::fold_with_ast_path(
15865 _field_0,
15866 visitor,
15867 &mut *__ast_path,
15868 );
15869 Term::LookAroundAssertion { 0: _field_0 }
15870 }
15871 Term::Quantifier { 0: _field_0 } => {
15872 let mut __ast_path =
15873 __ast_path.with_guard(AstParentKind::Term(self::fields::TermField::Quantifier));
15874 let _field_0 = <Box<Quantifier> as FoldWithAstPath<V>>::fold_with_ast_path(
15875 _field_0,
15876 visitor,
15877 &mut *__ast_path,
15878 );
15879 Term::Quantifier { 0: _field_0 }
15880 }
15881 Term::Character { 0: _field_0 } => {
15882 let mut __ast_path =
15883 __ast_path.with_guard(AstParentKind::Term(self::fields::TermField::Character));
15884 let _field_0 = <Box<Character> as FoldWithAstPath<V>>::fold_with_ast_path(
15885 _field_0,
15886 visitor,
15887 &mut *__ast_path,
15888 );
15889 Term::Character { 0: _field_0 }
15890 }
15891 Term::Dot { 0: _field_0 } => {
15892 let mut __ast_path =
15893 __ast_path.with_guard(AstParentKind::Term(self::fields::TermField::Dot));
15894 let _field_0 = <Dot as FoldWithAstPath<V>>::fold_with_ast_path(
15895 _field_0,
15896 visitor,
15897 &mut *__ast_path,
15898 );
15899 Term::Dot { 0: _field_0 }
15900 }
15901 Term::CharacterClassEscape { 0: _field_0 } => {
15902 let mut __ast_path = __ast_path.with_guard(AstParentKind::Term(
15903 self::fields::TermField::CharacterClassEscape,
15904 ));
15905 let _field_0 =
15906 <Box<CharacterClassEscape> as FoldWithAstPath<V>>::fold_with_ast_path(
15907 _field_0,
15908 visitor,
15909 &mut *__ast_path,
15910 );
15911 Term::CharacterClassEscape { 0: _field_0 }
15912 }
15913 Term::UnicodePropertyEscape { 0: _field_0 } => {
15914 let mut __ast_path = __ast_path.with_guard(AstParentKind::Term(
15915 self::fields::TermField::UnicodePropertyEscape,
15916 ));
15917 let _field_0 =
15918 <Box<UnicodePropertyEscape> as FoldWithAstPath<V>>::fold_with_ast_path(
15919 _field_0,
15920 visitor,
15921 &mut *__ast_path,
15922 );
15923 Term::UnicodePropertyEscape { 0: _field_0 }
15924 }
15925 Term::CharacterClass { 0: _field_0 } => {
15926 let mut __ast_path = __ast_path
15927 .with_guard(AstParentKind::Term(self::fields::TermField::CharacterClass));
15928 let _field_0 = <Box<CharacterClass> as FoldWithAstPath<V>>::fold_with_ast_path(
15929 _field_0,
15930 visitor,
15931 &mut *__ast_path,
15932 );
15933 Term::CharacterClass { 0: _field_0 }
15934 }
15935 Term::CapturingGroup { 0: _field_0 } => {
15936 let mut __ast_path = __ast_path
15937 .with_guard(AstParentKind::Term(self::fields::TermField::CapturingGroup));
15938 let _field_0 = <Box<CapturingGroup> as FoldWithAstPath<V>>::fold_with_ast_path(
15939 _field_0,
15940 visitor,
15941 &mut *__ast_path,
15942 );
15943 Term::CapturingGroup { 0: _field_0 }
15944 }
15945 Term::IgnoreGroup { 0: _field_0 } => {
15946 let mut __ast_path = __ast_path
15947 .with_guard(AstParentKind::Term(self::fields::TermField::IgnoreGroup));
15948 let _field_0 = <Box<IgnoreGroup> as FoldWithAstPath<V>>::fold_with_ast_path(
15949 _field_0,
15950 visitor,
15951 &mut *__ast_path,
15952 );
15953 Term::IgnoreGroup { 0: _field_0 }
15954 }
15955 Term::IndexedReference { 0: _field_0 } => {
15956 let mut __ast_path = __ast_path.with_guard(AstParentKind::Term(
15957 self::fields::TermField::IndexedReference,
15958 ));
15959 let _field_0 = <Box<IndexedReference> as FoldWithAstPath<V>>::fold_with_ast_path(
15960 _field_0,
15961 visitor,
15962 &mut *__ast_path,
15963 );
15964 Term::IndexedReference { 0: _field_0 }
15965 }
15966 Term::NamedReference { 0: _field_0 } => {
15967 let mut __ast_path = __ast_path
15968 .with_guard(AstParentKind::Term(self::fields::TermField::NamedReference));
15969 let _field_0 = <Box<NamedReference> as FoldWithAstPath<V>>::fold_with_ast_path(
15970 _field_0,
15971 visitor,
15972 &mut *__ast_path,
15973 );
15974 Term::NamedReference { 0: _field_0 }
15975 }
15976 }
15977 }
15978}
15979#[cfg(any(docsrs, feature = "path"))]
15980#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
15981impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for UnicodePropertyEscape {
15982 #[doc = "Calls [FoldAstPath`::fold_unicode_property_escape`] with `self`."]
15983 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15984 <V as FoldAstPath>::fold_unicode_property_escape(visitor, self, __ast_path)
15985 }
15986
15987 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
15988 match self {
15989 UnicodePropertyEscape {
15990 span,
15991 negative,
15992 strings,
15993 name,
15994 value,
15995 } => {
15996 let span = {
15997 let mut __ast_path =
15998 __ast_path.with_guard(AstParentKind::UnicodePropertyEscape(
15999 self::fields::UnicodePropertyEscapeField::Span,
16000 ));
16001 <swc_common::Span as FoldWithAstPath<V>>::fold_with_ast_path(
16002 span,
16003 visitor,
16004 &mut *__ast_path,
16005 )
16006 };
16007 let name = {
16008 let mut __ast_path =
16009 __ast_path.with_guard(AstParentKind::UnicodePropertyEscape(
16010 self::fields::UnicodePropertyEscapeField::Name,
16011 ));
16012 <swc_atoms::Atom as FoldWithAstPath<V>>::fold_with_ast_path(
16013 name,
16014 visitor,
16015 &mut *__ast_path,
16016 )
16017 };
16018 let value = {
16019 let mut __ast_path =
16020 __ast_path.with_guard(AstParentKind::UnicodePropertyEscape(
16021 self::fields::UnicodePropertyEscapeField::Value,
16022 ));
16023 <Option<swc_atoms::Atom> as FoldWithAstPath<V>>::fold_with_ast_path(
16024 value,
16025 visitor,
16026 &mut *__ast_path,
16027 )
16028 };
16029 UnicodePropertyEscape {
16030 span,
16031 negative,
16032 strings,
16033 name,
16034 value,
16035 }
16036 }
16037 }
16038 }
16039}
16040#[cfg(any(docsrs, feature = "path"))]
16041#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
16042impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for Vec<Alternative> {
16043 #[doc = "Calls [FoldAstPath`::fold_alternatives`] with `self`. (Extra impl)"]
16044 #[inline]
16045 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16046 <V as FoldAstPath>::fold_alternatives(visitor, self, __ast_path)
16047 }
16048
16049 #[inline]
16050 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16051 self.into_iter()
16052 .enumerate()
16053 .map(|(__idx, item)| {
16054 let mut __ast_path = __ast_path.with_index_guard(__idx);
16055 <Alternative as FoldWithAstPath<V>>::fold_with_ast_path(
16056 item,
16057 visitor,
16058 &mut *__ast_path,
16059 )
16060 })
16061 .collect()
16062 }
16063}
16064#[cfg(any(docsrs, feature = "path"))]
16065#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
16066impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for swc_atoms::Atom {
16067 #[doc = "Calls [FoldAstPath`::fold_atom`] with `self`. (Extra impl)"]
16068 #[inline]
16069 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16070 <V as FoldAstPath>::fold_atom(visitor, self, __ast_path)
16071 }
16072
16073 #[inline]
16074 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16075 self
16076 }
16077}
16078#[cfg(any(docsrs, feature = "path"))]
16079#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
16080impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for Vec<CharacterClassContents> {
16081 #[doc = "Calls [FoldAstPath`::fold_character_class_contentss`] with `self`. (Extra impl)"]
16082 #[inline]
16083 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16084 <V as FoldAstPath>::fold_character_class_contentss(visitor, self, __ast_path)
16085 }
16086
16087 #[inline]
16088 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16089 self.into_iter()
16090 .enumerate()
16091 .map(|(__idx, item)| {
16092 let mut __ast_path = __ast_path.with_index_guard(__idx);
16093 <CharacterClassContents as FoldWithAstPath<V>>::fold_with_ast_path(
16094 item,
16095 visitor,
16096 &mut *__ast_path,
16097 )
16098 })
16099 .collect()
16100 }
16101}
16102#[cfg(any(docsrs, feature = "path"))]
16103#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
16104impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for Vec<Character> {
16105 #[doc = "Calls [FoldAstPath`::fold_characters`] with `self`. (Extra impl)"]
16106 #[inline]
16107 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16108 <V as FoldAstPath>::fold_characters(visitor, self, __ast_path)
16109 }
16110
16111 #[inline]
16112 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16113 self.into_iter()
16114 .enumerate()
16115 .map(|(__idx, item)| {
16116 let mut __ast_path = __ast_path.with_index_guard(__idx);
16117 <Character as FoldWithAstPath<V>>::fold_with_ast_path(
16118 item,
16119 visitor,
16120 &mut *__ast_path,
16121 )
16122 })
16123 .collect()
16124 }
16125}
16126#[cfg(any(docsrs, feature = "path"))]
16127#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
16128impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for Vec<ClassString> {
16129 #[doc = "Calls [FoldAstPath`::fold_class_strings`] with `self`. (Extra impl)"]
16130 #[inline]
16131 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16132 <V as FoldAstPath>::fold_class_strings(visitor, self, __ast_path)
16133 }
16134
16135 #[inline]
16136 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16137 self.into_iter()
16138 .enumerate()
16139 .map(|(__idx, item)| {
16140 let mut __ast_path = __ast_path.with_index_guard(__idx);
16141 <ClassString as FoldWithAstPath<V>>::fold_with_ast_path(
16142 item,
16143 visitor,
16144 &mut *__ast_path,
16145 )
16146 })
16147 .collect()
16148 }
16149}
16150#[cfg(any(docsrs, feature = "path"))]
16151#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
16152impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for Modifier {
16153 #[doc = "Calls [FoldAstPath`::fold_modifier`] with `self`. (Extra impl)"]
16154 #[inline]
16155 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16156 <V as FoldAstPath>::fold_modifier(visitor, self, __ast_path)
16157 }
16158
16159 #[inline]
16160 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16161 self
16162 }
16163}
16164#[cfg(any(docsrs, feature = "path"))]
16165#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
16166impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for Option<swc_atoms::Atom> {
16167 #[doc = "Calls [FoldAstPath`::fold_opt_atom`] with `self`. (Extra impl)"]
16168 #[inline]
16169 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16170 <V as FoldAstPath>::fold_opt_atom(visitor, self, __ast_path)
16171 }
16172
16173 #[inline]
16174 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16175 self.map(|inner| {
16176 <swc_atoms::Atom as FoldWithAstPath<V>>::fold_with_ast_path(inner, visitor, __ast_path)
16177 })
16178 }
16179}
16180#[cfg(any(docsrs, feature = "path"))]
16181#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
16182impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for Option<Modifiers> {
16183 #[doc = "Calls [FoldAstPath`::fold_opt_modifiers`] with `self`. (Extra impl)"]
16184 #[inline]
16185 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16186 <V as FoldAstPath>::fold_opt_modifiers(visitor, self, __ast_path)
16187 }
16188
16189 #[inline]
16190 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16191 self.map(|inner| {
16192 <Modifiers as FoldWithAstPath<V>>::fold_with_ast_path(inner, visitor, __ast_path)
16193 })
16194 }
16195}
16196#[cfg(any(docsrs, feature = "path"))]
16197#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
16198impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for swc_common::Span {
16199 #[doc = "Calls [FoldAstPath`::fold_span`] with `self`. (Extra impl)"]
16200 #[inline]
16201 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16202 <V as FoldAstPath>::fold_span(visitor, self, __ast_path)
16203 }
16204
16205 #[inline]
16206 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16207 self
16208 }
16209}
16210#[cfg(any(docsrs, feature = "path"))]
16211#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
16212impl<V: ?Sized + FoldAstPath> FoldWithAstPath<V> for Vec<Term> {
16213 #[doc = "Calls [FoldAstPath`::fold_terms`] with `self`. (Extra impl)"]
16214 #[inline]
16215 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16216 <V as FoldAstPath>::fold_terms(visitor, self, __ast_path)
16217 }
16218
16219 #[inline]
16220 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16221 self.into_iter()
16222 .enumerate()
16223 .map(|(__idx, item)| {
16224 let mut __ast_path = __ast_path.with_index_guard(__idx);
16225 <Term as FoldWithAstPath<V>>::fold_with_ast_path(item, visitor, &mut *__ast_path)
16226 })
16227 .collect()
16228 }
16229}
16230#[cfg(any(docsrs, feature = "path"))]
16231#[cfg_attr(docsrs, doc(cfg(feature = "path")))]
16232impl<V, T> FoldWithAstPath<V> for std::boxed::Box<T>
16233where
16234 V: ?Sized + FoldAstPath,
16235 T: FoldWithAstPath<V>,
16236{
16237 #[inline]
16238 fn fold_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16239 swc_visit::util::map::Map::map(self, |inner| {
16240 <T as FoldWithAstPath<V>>::fold_with_ast_path(inner, visitor, __ast_path)
16241 })
16242 }
16243
16244 #[inline]
16245 fn fold_children_with_ast_path(self, visitor: &mut V, __ast_path: &mut AstKindPath) -> Self {
16246 swc_visit::util::map::Map::map(self, |inner| {
16247 <T as FoldWithAstPath<V>>::fold_children_with_ast_path(inner, visitor, __ast_path)
16248 })
16249 }
16250}
16251#[cfg(any(docsrs, feature = "path"))]
16252pub type AstKindPath = swc_visit::AstKindPath<AstParentKind>;
16253#[cfg(any(docsrs, feature = "path"))]
16254pub type AstNodePath<'ast> = swc_visit::AstNodePath<AstParentNodeRef<'ast>>;
16255#[cfg(any(docsrs, feature = "path"))]
16256pub mod fields {
16257 use swc_ecma_regexp_ast::*;
16258 #[inline(always)]
16259 fn assert_initial_index(idx: usize, index: usize) {
16260 #[cfg(debug_assertions)]
16261 if !(idx == usize::MAX || index == usize::MAX) {
16262 {
16263 panic!("Should be usize::MAX");
16264 }
16265 }
16266 }
16267 impl AlternativeField {
16268 pub(crate) fn set_index(&mut self, index: usize) {
16269 match self {
16270 Self::Body(idx) => {
16271 assert_initial_index(*idx, index);
16272 *idx = index;
16273 }
16274 _ => swc_visit::wrong_ast_path(),
16275 }
16276 }
16277 }
16278 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16279 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16280 pub enum AlternativeField {
16281 #[doc = "Represents [`Alternative::span`]"]
16282 Span,
16283 #[doc = "Represents [`Alternative::body`]"]
16284 Body(usize),
16285 }
16286 impl BoundaryAssertionField {
16287 pub(crate) fn set_index(&mut self, index: usize) {
16288 match self {
16289 _ => swc_visit::wrong_ast_path(),
16290 }
16291 }
16292 }
16293 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16294 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16295 pub enum BoundaryAssertionField {
16296 #[doc = "Represents [`BoundaryAssertion::span`]"]
16297 Span,
16298 #[doc = "Represents [`BoundaryAssertion::kind`]"]
16299 Kind,
16300 }
16301 impl BoundaryAssertionKindField {
16302 #[inline(always)]
16303 pub(crate) fn set_index(&mut self, _: usize) {
16304 swc_visit::wrong_ast_path();
16305 }
16306 }
16307 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16308 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16309 pub enum BoundaryAssertionKindField {
16310 #[doc = "Represents [`BoundaryAssertionKind::Start`]"]
16311 Start,
16312 #[doc = "Represents [`BoundaryAssertionKind::End`]"]
16313 End,
16314 #[doc = "Represents [`BoundaryAssertionKind::Boundary`]"]
16315 Boundary,
16316 #[doc = "Represents [`BoundaryAssertionKind::NegativeBoundary`]"]
16317 NegativeBoundary,
16318 }
16319 impl CapturingGroupField {
16320 pub(crate) fn set_index(&mut self, index: usize) {
16321 match self {
16322 _ => swc_visit::wrong_ast_path(),
16323 }
16324 }
16325 }
16326 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16327 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16328 pub enum CapturingGroupField {
16329 #[doc = "Represents [`CapturingGroup::span`]"]
16330 Span,
16331 #[doc = "Represents [`CapturingGroup::name`]"]
16332 Name,
16333 #[doc = "Represents [`CapturingGroup::body`]"]
16334 Body,
16335 }
16336 impl CharacterField {
16337 pub(crate) fn set_index(&mut self, index: usize) {
16338 match self {
16339 _ => swc_visit::wrong_ast_path(),
16340 }
16341 }
16342 }
16343 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16344 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16345 pub enum CharacterField {
16346 #[doc = "Represents [`Character::span`]"]
16347 Span,
16348 #[doc = "Represents [`Character::kind`]"]
16349 Kind,
16350 #[doc = "Represents [`Character::value`]"]
16351 Value,
16352 }
16353 impl CharacterClassField {
16354 pub(crate) fn set_index(&mut self, index: usize) {
16355 match self {
16356 Self::Body(idx) => {
16357 assert_initial_index(*idx, index);
16358 *idx = index;
16359 }
16360 _ => swc_visit::wrong_ast_path(),
16361 }
16362 }
16363 }
16364 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16365 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16366 pub enum CharacterClassField {
16367 #[doc = "Represents [`CharacterClass::span`]"]
16368 Span,
16369 #[doc = "Represents [`CharacterClass::negative`]"]
16370 Negative,
16371 #[doc = "Represents [`CharacterClass::strings`]"]
16372 Strings,
16373 #[doc = "Represents [`CharacterClass::kind`]"]
16374 Kind,
16375 #[doc = "Represents [`CharacterClass::body`]"]
16376 Body(usize),
16377 }
16378 impl CharacterClassContentsField {
16379 #[inline(always)]
16380 pub(crate) fn set_index(&mut self, _: usize) {
16381 swc_visit::wrong_ast_path();
16382 }
16383 }
16384 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16385 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16386 pub enum CharacterClassContentsField {
16387 #[doc = "Represents [`CharacterClassContents::CharacterClassRange`]"]
16388 CharacterClassRange,
16389 #[doc = "Represents [`CharacterClassContents::CharacterClassEscape`]"]
16390 CharacterClassEscape,
16391 #[doc = "Represents [`CharacterClassContents::UnicodePropertyEscape`]"]
16392 UnicodePropertyEscape,
16393 #[doc = "Represents [`CharacterClassContents::Character`]"]
16394 Character,
16395 #[doc = "Represents [`CharacterClassContents::NestedCharacterClass`]"]
16396 NestedCharacterClass,
16397 #[doc = "Represents [`CharacterClassContents::ClassStringDisjunction`]"]
16398 ClassStringDisjunction,
16399 }
16400 impl CharacterClassContentsKindField {
16401 #[inline(always)]
16402 pub(crate) fn set_index(&mut self, _: usize) {
16403 swc_visit::wrong_ast_path();
16404 }
16405 }
16406 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16407 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16408 pub enum CharacterClassContentsKindField {
16409 #[doc = "Represents [`CharacterClassContentsKind::Union`]"]
16410 Union,
16411 #[doc = "Represents [`CharacterClassContentsKind::Intersection`]"]
16412 Intersection,
16413 #[doc = "Represents [`CharacterClassContentsKind::Subtraction`]"]
16414 Subtraction,
16415 }
16416 impl CharacterClassEscapeField {
16417 pub(crate) fn set_index(&mut self, index: usize) {
16418 match self {
16419 _ => swc_visit::wrong_ast_path(),
16420 }
16421 }
16422 }
16423 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16424 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16425 pub enum CharacterClassEscapeField {
16426 #[doc = "Represents [`CharacterClassEscape::span`]"]
16427 Span,
16428 #[doc = "Represents [`CharacterClassEscape::kind`]"]
16429 Kind,
16430 }
16431 impl CharacterClassEscapeKindField {
16432 #[inline(always)]
16433 pub(crate) fn set_index(&mut self, _: usize) {
16434 swc_visit::wrong_ast_path();
16435 }
16436 }
16437 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16438 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16439 pub enum CharacterClassEscapeKindField {
16440 #[doc = "Represents [`CharacterClassEscapeKind::D`]"]
16441 D,
16442 #[doc = "Represents [`CharacterClassEscapeKind::NegativeD`]"]
16443 NegativeD,
16444 #[doc = "Represents [`CharacterClassEscapeKind::S`]"]
16445 S,
16446 #[doc = "Represents [`CharacterClassEscapeKind::NegativeS`]"]
16447 NegativeS,
16448 #[doc = "Represents [`CharacterClassEscapeKind::W`]"]
16449 W,
16450 #[doc = "Represents [`CharacterClassEscapeKind::NegativeW`]"]
16451 NegativeW,
16452 }
16453 impl CharacterClassRangeField {
16454 pub(crate) fn set_index(&mut self, index: usize) {
16455 match self {
16456 _ => swc_visit::wrong_ast_path(),
16457 }
16458 }
16459 }
16460 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16461 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16462 pub enum CharacterClassRangeField {
16463 #[doc = "Represents [`CharacterClassRange::span`]"]
16464 Span,
16465 #[doc = "Represents [`CharacterClassRange::min`]"]
16466 Min,
16467 #[doc = "Represents [`CharacterClassRange::max`]"]
16468 Max,
16469 }
16470 impl CharacterKindField {
16471 #[inline(always)]
16472 pub(crate) fn set_index(&mut self, _: usize) {
16473 swc_visit::wrong_ast_path();
16474 }
16475 }
16476 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16477 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16478 pub enum CharacterKindField {
16479 #[doc = "Represents [`CharacterKind::ControlLetter`]"]
16480 ControlLetter,
16481 #[doc = "Represents [`CharacterKind::HexadecimalEscape`]"]
16482 HexadecimalEscape,
16483 #[doc = "Represents [`CharacterKind::Identifier`]"]
16484 Identifier,
16485 #[doc = "Represents [`CharacterKind::Null`]"]
16486 Null,
16487 #[doc = "Represents [`CharacterKind::Octal1`]"]
16488 Octal1,
16489 #[doc = "Represents [`CharacterKind::Octal2`]"]
16490 Octal2,
16491 #[doc = "Represents [`CharacterKind::Octal3`]"]
16492 Octal3,
16493 #[doc = "Represents [`CharacterKind::SingleEscape`]"]
16494 SingleEscape,
16495 #[doc = "Represents [`CharacterKind::Symbol`]"]
16496 Symbol,
16497 #[doc = "Represents [`CharacterKind::UnicodeEscape`]"]
16498 UnicodeEscape,
16499 }
16500 impl ClassStringField {
16501 pub(crate) fn set_index(&mut self, index: usize) {
16502 match self {
16503 Self::Body(idx) => {
16504 assert_initial_index(*idx, index);
16505 *idx = index;
16506 }
16507 _ => swc_visit::wrong_ast_path(),
16508 }
16509 }
16510 }
16511 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16512 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16513 pub enum ClassStringField {
16514 #[doc = "Represents [`ClassString::span`]"]
16515 Span,
16516 #[doc = "Represents [`ClassString::strings`]"]
16517 Strings,
16518 #[doc = "Represents [`ClassString::body`]"]
16519 Body(usize),
16520 }
16521 impl ClassStringDisjunctionField {
16522 pub(crate) fn set_index(&mut self, index: usize) {
16523 match self {
16524 Self::Body(idx) => {
16525 assert_initial_index(*idx, index);
16526 *idx = index;
16527 }
16528 _ => swc_visit::wrong_ast_path(),
16529 }
16530 }
16531 }
16532 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16533 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16534 pub enum ClassStringDisjunctionField {
16535 #[doc = "Represents [`ClassStringDisjunction::span`]"]
16536 Span,
16537 #[doc = "Represents [`ClassStringDisjunction::strings`]"]
16538 Strings,
16539 #[doc = "Represents [`ClassStringDisjunction::body`]"]
16540 Body(usize),
16541 }
16542 impl DisjunctionField {
16543 pub(crate) fn set_index(&mut self, index: usize) {
16544 match self {
16545 Self::Body(idx) => {
16546 assert_initial_index(*idx, index);
16547 *idx = index;
16548 }
16549 _ => swc_visit::wrong_ast_path(),
16550 }
16551 }
16552 }
16553 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16554 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16555 pub enum DisjunctionField {
16556 #[doc = "Represents [`Disjunction::span`]"]
16557 Span,
16558 #[doc = "Represents [`Disjunction::body`]"]
16559 Body(usize),
16560 }
16561 impl DotField {
16562 pub(crate) fn set_index(&mut self, index: usize) {
16563 match self {
16564 _ => swc_visit::wrong_ast_path(),
16565 }
16566 }
16567 }
16568 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16569 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16570 pub enum DotField {
16571 #[doc = "Represents [`Dot::span`]"]
16572 Span,
16573 }
16574 impl IgnoreGroupField {
16575 pub(crate) fn set_index(&mut self, index: usize) {
16576 match self {
16577 _ => swc_visit::wrong_ast_path(),
16578 }
16579 }
16580 }
16581 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16582 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16583 pub enum IgnoreGroupField {
16584 #[doc = "Represents [`IgnoreGroup::span`]"]
16585 Span,
16586 #[doc = "Represents [`IgnoreGroup::modifiers`]"]
16587 Modifiers,
16588 #[doc = "Represents [`IgnoreGroup::body`]"]
16589 Body,
16590 }
16591 impl IndexedReferenceField {
16592 pub(crate) fn set_index(&mut self, index: usize) {
16593 match self {
16594 _ => swc_visit::wrong_ast_path(),
16595 }
16596 }
16597 }
16598 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16599 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16600 pub enum IndexedReferenceField {
16601 #[doc = "Represents [`IndexedReference::span`]"]
16602 Span,
16603 #[doc = "Represents [`IndexedReference::index`]"]
16604 Index,
16605 }
16606 impl LookAroundAssertionField {
16607 pub(crate) fn set_index(&mut self, index: usize) {
16608 match self {
16609 _ => swc_visit::wrong_ast_path(),
16610 }
16611 }
16612 }
16613 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16614 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16615 pub enum LookAroundAssertionField {
16616 #[doc = "Represents [`LookAroundAssertion::span`]"]
16617 Span,
16618 #[doc = "Represents [`LookAroundAssertion::kind`]"]
16619 Kind,
16620 #[doc = "Represents [`LookAroundAssertion::body`]"]
16621 Body,
16622 }
16623 impl LookAroundAssertionKindField {
16624 #[inline(always)]
16625 pub(crate) fn set_index(&mut self, _: usize) {
16626 swc_visit::wrong_ast_path();
16627 }
16628 }
16629 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16630 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16631 pub enum LookAroundAssertionKindField {
16632 #[doc = "Represents [`LookAroundAssertionKind::Lookahead`]"]
16633 Lookahead,
16634 #[doc = "Represents [`LookAroundAssertionKind::NegativeLookahead`]"]
16635 NegativeLookahead,
16636 #[doc = "Represents [`LookAroundAssertionKind::Lookbehind`]"]
16637 Lookbehind,
16638 #[doc = "Represents [`LookAroundAssertionKind::NegativeLookbehind`]"]
16639 NegativeLookbehind,
16640 }
16641 impl ModifiersField {
16642 pub(crate) fn set_index(&mut self, index: usize) {
16643 match self {
16644 _ => swc_visit::wrong_ast_path(),
16645 }
16646 }
16647 }
16648 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16649 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16650 pub enum ModifiersField {
16651 #[doc = "Represents [`Modifiers::span`]"]
16652 Span,
16653 #[doc = "Represents [`Modifiers::enabling`]"]
16654 Enabling,
16655 #[doc = "Represents [`Modifiers::disabling`]"]
16656 Disabling,
16657 }
16658 impl NamedReferenceField {
16659 pub(crate) fn set_index(&mut self, index: usize) {
16660 match self {
16661 _ => swc_visit::wrong_ast_path(),
16662 }
16663 }
16664 }
16665 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16666 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16667 pub enum NamedReferenceField {
16668 #[doc = "Represents [`NamedReference::span`]"]
16669 Span,
16670 #[doc = "Represents [`NamedReference::name`]"]
16671 Name,
16672 }
16673 impl PatternField {
16674 pub(crate) fn set_index(&mut self, index: usize) {
16675 match self {
16676 _ => swc_visit::wrong_ast_path(),
16677 }
16678 }
16679 }
16680 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16681 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16682 pub enum PatternField {
16683 #[doc = "Represents [`Pattern::span`]"]
16684 Span,
16685 #[doc = "Represents [`Pattern::body`]"]
16686 Body,
16687 }
16688 impl QuantifierField {
16689 pub(crate) fn set_index(&mut self, index: usize) {
16690 match self {
16691 _ => swc_visit::wrong_ast_path(),
16692 }
16693 }
16694 }
16695 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16696 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16697 pub enum QuantifierField {
16698 #[doc = "Represents [`Quantifier::span`]"]
16699 Span,
16700 #[doc = "Represents [`Quantifier::min`]"]
16701 Min,
16702 #[doc = "Represents [`Quantifier::max`]"]
16703 Max,
16704 #[doc = "Represents [`Quantifier::greedy`]"]
16705 Greedy,
16706 #[doc = "Represents [`Quantifier::body`]"]
16707 Body,
16708 }
16709 impl TermField {
16710 #[inline(always)]
16711 pub(crate) fn set_index(&mut self, _: usize) {
16712 swc_visit::wrong_ast_path();
16713 }
16714 }
16715 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16716 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16717 pub enum TermField {
16718 #[doc = "Represents [`Term::BoundaryAssertion`]"]
16719 BoundaryAssertion,
16720 #[doc = "Represents [`Term::LookAroundAssertion`]"]
16721 LookAroundAssertion,
16722 #[doc = "Represents [`Term::Quantifier`]"]
16723 Quantifier,
16724 #[doc = "Represents [`Term::Character`]"]
16725 Character,
16726 #[doc = "Represents [`Term::Dot`]"]
16727 Dot,
16728 #[doc = "Represents [`Term::CharacterClassEscape`]"]
16729 CharacterClassEscape,
16730 #[doc = "Represents [`Term::UnicodePropertyEscape`]"]
16731 UnicodePropertyEscape,
16732 #[doc = "Represents [`Term::CharacterClass`]"]
16733 CharacterClass,
16734 #[doc = "Represents [`Term::CapturingGroup`]"]
16735 CapturingGroup,
16736 #[doc = "Represents [`Term::IgnoreGroup`]"]
16737 IgnoreGroup,
16738 #[doc = "Represents [`Term::IndexedReference`]"]
16739 IndexedReference,
16740 #[doc = "Represents [`Term::NamedReference`]"]
16741 NamedReference,
16742 }
16743 impl UnicodePropertyEscapeField {
16744 pub(crate) fn set_index(&mut self, index: usize) {
16745 match self {
16746 _ => swc_visit::wrong_ast_path(),
16747 }
16748 }
16749 }
16750 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16751 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16752 pub enum UnicodePropertyEscapeField {
16753 #[doc = "Represents [`UnicodePropertyEscape::span`]"]
16754 Span,
16755 #[doc = "Represents [`UnicodePropertyEscape::negative`]"]
16756 Negative,
16757 #[doc = "Represents [`UnicodePropertyEscape::strings`]"]
16758 Strings,
16759 #[doc = "Represents [`UnicodePropertyEscape::name`]"]
16760 Name,
16761 #[doc = "Represents [`UnicodePropertyEscape::value`]"]
16762 Value,
16763 }
16764 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
16765 #[cfg_attr(feature = "serde-impl", derive(serde::Serialize, serde::Deserialize))]
16766 pub enum AstParentKind {
16767 Alternative(AlternativeField),
16768 BoundaryAssertion(BoundaryAssertionField),
16769 BoundaryAssertionKind(BoundaryAssertionKindField),
16770 CapturingGroup(CapturingGroupField),
16771 Character(CharacterField),
16772 CharacterClass(CharacterClassField),
16773 CharacterClassContents(CharacterClassContentsField),
16774 CharacterClassContentsKind(CharacterClassContentsKindField),
16775 CharacterClassEscape(CharacterClassEscapeField),
16776 CharacterClassEscapeKind(CharacterClassEscapeKindField),
16777 CharacterClassRange(CharacterClassRangeField),
16778 CharacterKind(CharacterKindField),
16779 ClassString(ClassStringField),
16780 ClassStringDisjunction(ClassStringDisjunctionField),
16781 Disjunction(DisjunctionField),
16782 Dot(DotField),
16783 IgnoreGroup(IgnoreGroupField),
16784 IndexedReference(IndexedReferenceField),
16785 LookAroundAssertion(LookAroundAssertionField),
16786 LookAroundAssertionKind(LookAroundAssertionKindField),
16787 Modifiers(ModifiersField),
16788 NamedReference(NamedReferenceField),
16789 Pattern(PatternField),
16790 Quantifier(QuantifierField),
16791 Term(TermField),
16792 UnicodePropertyEscape(UnicodePropertyEscapeField),
16793 }
16794 impl ::swc_visit::ParentKind for AstParentKind {
16795 #[inline]
16796 fn set_index(&mut self, index: usize) {
16797 match self {
16798 Self::Alternative(v) => v.set_index(index),
16799 Self::BoundaryAssertion(v) => v.set_index(index),
16800 Self::BoundaryAssertionKind(v) => v.set_index(index),
16801 Self::CapturingGroup(v) => v.set_index(index),
16802 Self::Character(v) => v.set_index(index),
16803 Self::CharacterClass(v) => v.set_index(index),
16804 Self::CharacterClassContents(v) => v.set_index(index),
16805 Self::CharacterClassContentsKind(v) => v.set_index(index),
16806 Self::CharacterClassEscape(v) => v.set_index(index),
16807 Self::CharacterClassEscapeKind(v) => v.set_index(index),
16808 Self::CharacterClassRange(v) => v.set_index(index),
16809 Self::CharacterKind(v) => v.set_index(index),
16810 Self::ClassString(v) => v.set_index(index),
16811 Self::ClassStringDisjunction(v) => v.set_index(index),
16812 Self::Disjunction(v) => v.set_index(index),
16813 Self::Dot(v) => v.set_index(index),
16814 Self::IgnoreGroup(v) => v.set_index(index),
16815 Self::IndexedReference(v) => v.set_index(index),
16816 Self::LookAroundAssertion(v) => v.set_index(index),
16817 Self::LookAroundAssertionKind(v) => v.set_index(index),
16818 Self::Modifiers(v) => v.set_index(index),
16819 Self::NamedReference(v) => v.set_index(index),
16820 Self::Pattern(v) => v.set_index(index),
16821 Self::Quantifier(v) => v.set_index(index),
16822 Self::Term(v) => v.set_index(index),
16823 Self::UnicodePropertyEscape(v) => v.set_index(index),
16824 }
16825 }
16826 }
16827 #[derive(Debug, Clone, Copy)]
16828 pub enum AstParentNodeRef<'ast> {
16829 Alternative(&'ast Alternative, AlternativeField),
16830 BoundaryAssertion(&'ast BoundaryAssertion, BoundaryAssertionField),
16831 BoundaryAssertionKind(&'ast BoundaryAssertionKind, BoundaryAssertionKindField),
16832 CapturingGroup(&'ast CapturingGroup, CapturingGroupField),
16833 Character(&'ast Character, CharacterField),
16834 CharacterClass(&'ast CharacterClass, CharacterClassField),
16835 CharacterClassContents(&'ast CharacterClassContents, CharacterClassContentsField),
16836 CharacterClassContentsKind(
16837 &'ast CharacterClassContentsKind,
16838 CharacterClassContentsKindField,
16839 ),
16840 CharacterClassEscape(&'ast CharacterClassEscape, CharacterClassEscapeField),
16841 CharacterClassEscapeKind(
16842 &'ast CharacterClassEscapeKind,
16843 CharacterClassEscapeKindField,
16844 ),
16845 CharacterClassRange(&'ast CharacterClassRange, CharacterClassRangeField),
16846 CharacterKind(&'ast CharacterKind, CharacterKindField),
16847 ClassString(&'ast ClassString, ClassStringField),
16848 ClassStringDisjunction(&'ast ClassStringDisjunction, ClassStringDisjunctionField),
16849 Disjunction(&'ast Disjunction, DisjunctionField),
16850 Dot(&'ast Dot, DotField),
16851 IgnoreGroup(&'ast IgnoreGroup, IgnoreGroupField),
16852 IndexedReference(&'ast IndexedReference, IndexedReferenceField),
16853 LookAroundAssertion(&'ast LookAroundAssertion, LookAroundAssertionField),
16854 LookAroundAssertionKind(&'ast LookAroundAssertionKind, LookAroundAssertionKindField),
16855 Modifiers(&'ast Modifiers, ModifiersField),
16856 NamedReference(&'ast NamedReference, NamedReferenceField),
16857 Pattern(&'ast Pattern, PatternField),
16858 Quantifier(&'ast Quantifier, QuantifierField),
16859 Term(&'ast Term, TermField),
16860 UnicodePropertyEscape(&'ast UnicodePropertyEscape, UnicodePropertyEscapeField),
16861 }
16862 impl<'ast> ::swc_visit::NodeRef for AstParentNodeRef<'ast> {
16863 type ParentKind = AstParentKind;
16864
16865 #[inline(always)]
16866 fn kind(&self) -> AstParentKind {
16867 self.kind()
16868 }
16869
16870 fn set_index(&mut self, index: usize) {
16871 match self {
16872 Self::Alternative(_, __field_kind) => __field_kind.set_index(index),
16873 Self::BoundaryAssertion(_, __field_kind) => __field_kind.set_index(index),
16874 Self::BoundaryAssertionKind(_, __field_kind) => __field_kind.set_index(index),
16875 Self::CapturingGroup(_, __field_kind) => __field_kind.set_index(index),
16876 Self::Character(_, __field_kind) => __field_kind.set_index(index),
16877 Self::CharacterClass(_, __field_kind) => __field_kind.set_index(index),
16878 Self::CharacterClassContents(_, __field_kind) => __field_kind.set_index(index),
16879 Self::CharacterClassContentsKind(_, __field_kind) => __field_kind.set_index(index),
16880 Self::CharacterClassEscape(_, __field_kind) => __field_kind.set_index(index),
16881 Self::CharacterClassEscapeKind(_, __field_kind) => __field_kind.set_index(index),
16882 Self::CharacterClassRange(_, __field_kind) => __field_kind.set_index(index),
16883 Self::CharacterKind(_, __field_kind) => __field_kind.set_index(index),
16884 Self::ClassString(_, __field_kind) => __field_kind.set_index(index),
16885 Self::ClassStringDisjunction(_, __field_kind) => __field_kind.set_index(index),
16886 Self::Disjunction(_, __field_kind) => __field_kind.set_index(index),
16887 Self::Dot(_, __field_kind) => __field_kind.set_index(index),
16888 Self::IgnoreGroup(_, __field_kind) => __field_kind.set_index(index),
16889 Self::IndexedReference(_, __field_kind) => __field_kind.set_index(index),
16890 Self::LookAroundAssertion(_, __field_kind) => __field_kind.set_index(index),
16891 Self::LookAroundAssertionKind(_, __field_kind) => __field_kind.set_index(index),
16892 Self::Modifiers(_, __field_kind) => __field_kind.set_index(index),
16893 Self::NamedReference(_, __field_kind) => __field_kind.set_index(index),
16894 Self::Pattern(_, __field_kind) => __field_kind.set_index(index),
16895 Self::Quantifier(_, __field_kind) => __field_kind.set_index(index),
16896 Self::Term(_, __field_kind) => __field_kind.set_index(index),
16897 Self::UnicodePropertyEscape(_, __field_kind) => __field_kind.set_index(index),
16898 }
16899 }
16900 }
16901 #[cfg(any(docsrs, feature = "path"))]
16902 impl<'ast> AstParentNodeRef<'ast> {
16903 #[inline]
16904 pub fn kind(&self) -> AstParentKind {
16905 match self {
16906 Self::Alternative(_, __field_kind) => AstParentKind::Alternative(*__field_kind),
16907 Self::BoundaryAssertion(_, __field_kind) => {
16908 AstParentKind::BoundaryAssertion(*__field_kind)
16909 }
16910 Self::BoundaryAssertionKind(_, __field_kind) => {
16911 AstParentKind::BoundaryAssertionKind(*__field_kind)
16912 }
16913 Self::CapturingGroup(_, __field_kind) => {
16914 AstParentKind::CapturingGroup(*__field_kind)
16915 }
16916 Self::Character(_, __field_kind) => AstParentKind::Character(*__field_kind),
16917 Self::CharacterClass(_, __field_kind) => {
16918 AstParentKind::CharacterClass(*__field_kind)
16919 }
16920 Self::CharacterClassContents(_, __field_kind) => {
16921 AstParentKind::CharacterClassContents(*__field_kind)
16922 }
16923 Self::CharacterClassContentsKind(_, __field_kind) => {
16924 AstParentKind::CharacterClassContentsKind(*__field_kind)
16925 }
16926 Self::CharacterClassEscape(_, __field_kind) => {
16927 AstParentKind::CharacterClassEscape(*__field_kind)
16928 }
16929 Self::CharacterClassEscapeKind(_, __field_kind) => {
16930 AstParentKind::CharacterClassEscapeKind(*__field_kind)
16931 }
16932 Self::CharacterClassRange(_, __field_kind) => {
16933 AstParentKind::CharacterClassRange(*__field_kind)
16934 }
16935 Self::CharacterKind(_, __field_kind) => AstParentKind::CharacterKind(*__field_kind),
16936 Self::ClassString(_, __field_kind) => AstParentKind::ClassString(*__field_kind),
16937 Self::ClassStringDisjunction(_, __field_kind) => {
16938 AstParentKind::ClassStringDisjunction(*__field_kind)
16939 }
16940 Self::Disjunction(_, __field_kind) => AstParentKind::Disjunction(*__field_kind),
16941 Self::Dot(_, __field_kind) => AstParentKind::Dot(*__field_kind),
16942 Self::IgnoreGroup(_, __field_kind) => AstParentKind::IgnoreGroup(*__field_kind),
16943 Self::IndexedReference(_, __field_kind) => {
16944 AstParentKind::IndexedReference(*__field_kind)
16945 }
16946 Self::LookAroundAssertion(_, __field_kind) => {
16947 AstParentKind::LookAroundAssertion(*__field_kind)
16948 }
16949 Self::LookAroundAssertionKind(_, __field_kind) => {
16950 AstParentKind::LookAroundAssertionKind(*__field_kind)
16951 }
16952 Self::Modifiers(_, __field_kind) => AstParentKind::Modifiers(*__field_kind),
16953 Self::NamedReference(_, __field_kind) => {
16954 AstParentKind::NamedReference(*__field_kind)
16955 }
16956 Self::Pattern(_, __field_kind) => AstParentKind::Pattern(*__field_kind),
16957 Self::Quantifier(_, __field_kind) => AstParentKind::Quantifier(*__field_kind),
16958 Self::Term(_, __field_kind) => AstParentKind::Term(*__field_kind),
16959 Self::UnicodePropertyEscape(_, __field_kind) => {
16960 AstParentKind::UnicodePropertyEscape(*__field_kind)
16961 }
16962 }
16963 }
16964 }
16965}
16966impl<'ast> From<&'ast Alternative> for NodeRef<'ast> {
16967 fn from(node: &'ast Alternative) -> Self {
16968 NodeRef::Alternative(node)
16969 }
16970}
16971impl<'ast> From<&'ast BoundaryAssertion> for NodeRef<'ast> {
16972 fn from(node: &'ast BoundaryAssertion) -> Self {
16973 NodeRef::BoundaryAssertion(node)
16974 }
16975}
16976impl<'ast> From<&'ast BoundaryAssertionKind> for NodeRef<'ast> {
16977 fn from(node: &'ast BoundaryAssertionKind) -> Self {
16978 NodeRef::BoundaryAssertionKind(node)
16979 }
16980}
16981impl<'ast> From<&'ast CapturingGroup> for NodeRef<'ast> {
16982 fn from(node: &'ast CapturingGroup) -> Self {
16983 NodeRef::CapturingGroup(node)
16984 }
16985}
16986impl<'ast> From<&'ast Character> for NodeRef<'ast> {
16987 fn from(node: &'ast Character) -> Self {
16988 NodeRef::Character(node)
16989 }
16990}
16991impl<'ast> From<&'ast CharacterClass> for NodeRef<'ast> {
16992 fn from(node: &'ast CharacterClass) -> Self {
16993 NodeRef::CharacterClass(node)
16994 }
16995}
16996impl<'ast> From<&'ast CharacterClassContents> for NodeRef<'ast> {
16997 fn from(node: &'ast CharacterClassContents) -> Self {
16998 NodeRef::CharacterClassContents(node)
16999 }
17000}
17001impl<'ast> From<&'ast CharacterClassContentsKind> for NodeRef<'ast> {
17002 fn from(node: &'ast CharacterClassContentsKind) -> Self {
17003 NodeRef::CharacterClassContentsKind(node)
17004 }
17005}
17006impl<'ast> From<&'ast CharacterClassEscape> for NodeRef<'ast> {
17007 fn from(node: &'ast CharacterClassEscape) -> Self {
17008 NodeRef::CharacterClassEscape(node)
17009 }
17010}
17011impl<'ast> From<&'ast CharacterClassEscapeKind> for NodeRef<'ast> {
17012 fn from(node: &'ast CharacterClassEscapeKind) -> Self {
17013 NodeRef::CharacterClassEscapeKind(node)
17014 }
17015}
17016impl<'ast> From<&'ast CharacterClassRange> for NodeRef<'ast> {
17017 fn from(node: &'ast CharacterClassRange) -> Self {
17018 NodeRef::CharacterClassRange(node)
17019 }
17020}
17021impl<'ast> From<&'ast CharacterKind> for NodeRef<'ast> {
17022 fn from(node: &'ast CharacterKind) -> Self {
17023 NodeRef::CharacterKind(node)
17024 }
17025}
17026impl<'ast> From<&'ast ClassString> for NodeRef<'ast> {
17027 fn from(node: &'ast ClassString) -> Self {
17028 NodeRef::ClassString(node)
17029 }
17030}
17031impl<'ast> From<&'ast ClassStringDisjunction> for NodeRef<'ast> {
17032 fn from(node: &'ast ClassStringDisjunction) -> Self {
17033 NodeRef::ClassStringDisjunction(node)
17034 }
17035}
17036impl<'ast> From<&'ast Disjunction> for NodeRef<'ast> {
17037 fn from(node: &'ast Disjunction) -> Self {
17038 NodeRef::Disjunction(node)
17039 }
17040}
17041impl<'ast> From<&'ast Dot> for NodeRef<'ast> {
17042 fn from(node: &'ast Dot) -> Self {
17043 NodeRef::Dot(node)
17044 }
17045}
17046impl<'ast> From<&'ast IgnoreGroup> for NodeRef<'ast> {
17047 fn from(node: &'ast IgnoreGroup) -> Self {
17048 NodeRef::IgnoreGroup(node)
17049 }
17050}
17051impl<'ast> From<&'ast IndexedReference> for NodeRef<'ast> {
17052 fn from(node: &'ast IndexedReference) -> Self {
17053 NodeRef::IndexedReference(node)
17054 }
17055}
17056impl<'ast> From<&'ast LookAroundAssertion> for NodeRef<'ast> {
17057 fn from(node: &'ast LookAroundAssertion) -> Self {
17058 NodeRef::LookAroundAssertion(node)
17059 }
17060}
17061impl<'ast> From<&'ast LookAroundAssertionKind> for NodeRef<'ast> {
17062 fn from(node: &'ast LookAroundAssertionKind) -> Self {
17063 NodeRef::LookAroundAssertionKind(node)
17064 }
17065}
17066impl<'ast> From<&'ast Modifiers> for NodeRef<'ast> {
17067 fn from(node: &'ast Modifiers) -> Self {
17068 NodeRef::Modifiers(node)
17069 }
17070}
17071impl<'ast> From<&'ast NamedReference> for NodeRef<'ast> {
17072 fn from(node: &'ast NamedReference) -> Self {
17073 NodeRef::NamedReference(node)
17074 }
17075}
17076impl<'ast> From<&'ast Pattern> for NodeRef<'ast> {
17077 fn from(node: &'ast Pattern) -> Self {
17078 NodeRef::Pattern(node)
17079 }
17080}
17081impl<'ast> From<&'ast Quantifier> for NodeRef<'ast> {
17082 fn from(node: &'ast Quantifier) -> Self {
17083 NodeRef::Quantifier(node)
17084 }
17085}
17086impl<'ast> From<&'ast Term> for NodeRef<'ast> {
17087 fn from(node: &'ast Term) -> Self {
17088 NodeRef::Term(node)
17089 }
17090}
17091impl<'ast> From<&'ast UnicodePropertyEscape> for NodeRef<'ast> {
17092 fn from(node: &'ast UnicodePropertyEscape) -> Self {
17093 NodeRef::UnicodePropertyEscape(node)
17094 }
17095}
17096#[derive(Debug, Clone, Copy)]
17097pub enum NodeRef<'ast> {
17098 Alternative(&'ast Alternative),
17099 BoundaryAssertion(&'ast BoundaryAssertion),
17100 BoundaryAssertionKind(&'ast BoundaryAssertionKind),
17101 CapturingGroup(&'ast CapturingGroup),
17102 Character(&'ast Character),
17103 CharacterClass(&'ast CharacterClass),
17104 CharacterClassContents(&'ast CharacterClassContents),
17105 CharacterClassContentsKind(&'ast CharacterClassContentsKind),
17106 CharacterClassEscape(&'ast CharacterClassEscape),
17107 CharacterClassEscapeKind(&'ast CharacterClassEscapeKind),
17108 CharacterClassRange(&'ast CharacterClassRange),
17109 CharacterKind(&'ast CharacterKind),
17110 ClassString(&'ast ClassString),
17111 ClassStringDisjunction(&'ast ClassStringDisjunction),
17112 Disjunction(&'ast Disjunction),
17113 Dot(&'ast Dot),
17114 IgnoreGroup(&'ast IgnoreGroup),
17115 IndexedReference(&'ast IndexedReference),
17116 LookAroundAssertion(&'ast LookAroundAssertion),
17117 LookAroundAssertionKind(&'ast LookAroundAssertionKind),
17118 Modifiers(&'ast Modifiers),
17119 NamedReference(&'ast NamedReference),
17120 Pattern(&'ast Pattern),
17121 Quantifier(&'ast Quantifier),
17122 Term(&'ast Term),
17123 UnicodePropertyEscape(&'ast UnicodePropertyEscape),
17124}
17125impl<'ast> NodeRef<'ast> {
17126 #[doc = r" This is not a part of semver-stable API. It is experimental and subject to change."]
17127 #[allow(unreachable_patterns)]
17128 pub fn experimental_raw_children<'a>(&'a self) -> Box<dyn 'a + Iterator<Item = NodeRef<'ast>>> {
17129 match self {
17130 NodeRef::Alternative(node) => {
17131 let iterator = ::std::iter::empty::<NodeRef<'ast>>().chain(
17132 node.body
17133 .iter()
17134 .flat_map(|item| ::std::iter::once(NodeRef::Term(&item))),
17135 );
17136 Box::new(iterator)
17137 }
17138 NodeRef::BoundaryAssertion(node) => {
17139 let iterator = ::std::iter::empty::<NodeRef<'ast>>().chain(::std::iter::once(
17140 NodeRef::BoundaryAssertionKind(&node.kind),
17141 ));
17142 Box::new(iterator)
17143 }
17144 NodeRef::BoundaryAssertionKind(node) => match node {
17145 _ => Box::new(::std::iter::empty::<NodeRef<'ast>>()),
17146 },
17147 NodeRef::CapturingGroup(node) => {
17148 let iterator = ::std::iter::empty::<NodeRef<'ast>>()
17149 .chain(::std::iter::once(NodeRef::Disjunction(&node.body)));
17150 Box::new(iterator)
17151 }
17152 NodeRef::Character(node) => {
17153 let iterator = ::std::iter::empty::<NodeRef<'ast>>()
17154 .chain(::std::iter::once(NodeRef::CharacterKind(&node.kind)));
17155 Box::new(iterator)
17156 }
17157 NodeRef::CharacterClass(node) => {
17158 let iterator = ::std::iter::empty::<NodeRef<'ast>>()
17159 .chain(::std::iter::once(NodeRef::CharacterClassContentsKind(
17160 &node.kind,
17161 )))
17162 .chain(node.body.iter().flat_map(|item| {
17163 ::std::iter::once(NodeRef::CharacterClassContents(&item))
17164 }));
17165 Box::new(iterator)
17166 }
17167 NodeRef::CharacterClassContents(node) => match node {
17168 CharacterClassContents::CharacterClassRange(v0) => {
17169 Box::new(::std::iter::once(NodeRef::CharacterClassRange(v0)))
17170 }
17171 CharacterClassContents::CharacterClassEscape(v0) => {
17172 Box::new(::std::iter::once(NodeRef::CharacterClassEscape(v0)))
17173 }
17174 CharacterClassContents::UnicodePropertyEscape(v0) => {
17175 Box::new(::std::iter::once(NodeRef::UnicodePropertyEscape(v0)))
17176 }
17177 CharacterClassContents::Character(v0) => {
17178 Box::new(::std::iter::once(NodeRef::Character(v0)))
17179 }
17180 CharacterClassContents::NestedCharacterClass(v0) => {
17181 Box::new(::std::iter::once(NodeRef::CharacterClass(v0)))
17182 }
17183 CharacterClassContents::ClassStringDisjunction(v0) => {
17184 Box::new(::std::iter::once(NodeRef::ClassStringDisjunction(v0)))
17185 }
17186 _ => Box::new(::std::iter::empty::<NodeRef<'ast>>()),
17187 },
17188 NodeRef::CharacterClassContentsKind(node) => match node {
17189 _ => Box::new(::std::iter::empty::<NodeRef<'ast>>()),
17190 },
17191 NodeRef::CharacterClassEscape(node) => {
17192 let iterator = ::std::iter::empty::<NodeRef<'ast>>().chain(::std::iter::once(
17193 NodeRef::CharacterClassEscapeKind(&node.kind),
17194 ));
17195 Box::new(iterator)
17196 }
17197 NodeRef::CharacterClassEscapeKind(node) => match node {
17198 _ => Box::new(::std::iter::empty::<NodeRef<'ast>>()),
17199 },
17200 NodeRef::CharacterClassRange(node) => {
17201 let iterator = ::std::iter::empty::<NodeRef<'ast>>()
17202 .chain(::std::iter::once(NodeRef::Character(&node.min)))
17203 .chain(::std::iter::once(NodeRef::Character(&node.max)));
17204 Box::new(iterator)
17205 }
17206 NodeRef::CharacterKind(node) => match node {
17207 _ => Box::new(::std::iter::empty::<NodeRef<'ast>>()),
17208 },
17209 NodeRef::ClassString(node) => {
17210 let iterator = ::std::iter::empty::<NodeRef<'ast>>().chain(
17211 node.body
17212 .iter()
17213 .flat_map(|item| ::std::iter::once(NodeRef::Character(&item))),
17214 );
17215 Box::new(iterator)
17216 }
17217 NodeRef::ClassStringDisjunction(node) => {
17218 let iterator = ::std::iter::empty::<NodeRef<'ast>>().chain(
17219 node.body
17220 .iter()
17221 .flat_map(|item| ::std::iter::once(NodeRef::ClassString(&item))),
17222 );
17223 Box::new(iterator)
17224 }
17225 NodeRef::Disjunction(node) => {
17226 let iterator = ::std::iter::empty::<NodeRef<'ast>>().chain(
17227 node.body
17228 .iter()
17229 .flat_map(|item| ::std::iter::once(NodeRef::Alternative(&item))),
17230 );
17231 Box::new(iterator)
17232 }
17233 NodeRef::Dot(node) => {
17234 let iterator = ::std::iter::empty::<NodeRef<'ast>>();
17235 Box::new(iterator)
17236 }
17237 NodeRef::IgnoreGroup(node) => {
17238 let iterator = ::std::iter::empty::<NodeRef<'ast>>()
17239 .chain(
17240 node.modifiers
17241 .iter()
17242 .flat_map(|item| ::std::iter::once(NodeRef::Modifiers(&item))),
17243 )
17244 .chain(::std::iter::once(NodeRef::Disjunction(&node.body)));
17245 Box::new(iterator)
17246 }
17247 NodeRef::IndexedReference(node) => {
17248 let iterator = ::std::iter::empty::<NodeRef<'ast>>();
17249 Box::new(iterator)
17250 }
17251 NodeRef::LookAroundAssertion(node) => {
17252 let iterator = ::std::iter::empty::<NodeRef<'ast>>()
17253 .chain(::std::iter::once(NodeRef::LookAroundAssertionKind(
17254 &node.kind,
17255 )))
17256 .chain(::std::iter::once(NodeRef::Disjunction(&node.body)));
17257 Box::new(iterator)
17258 }
17259 NodeRef::LookAroundAssertionKind(node) => match node {
17260 _ => Box::new(::std::iter::empty::<NodeRef<'ast>>()),
17261 },
17262 NodeRef::Modifiers(node) => {
17263 let iterator = ::std::iter::empty::<NodeRef<'ast>>();
17264 Box::new(iterator)
17265 }
17266 NodeRef::NamedReference(node) => {
17267 let iterator = ::std::iter::empty::<NodeRef<'ast>>();
17268 Box::new(iterator)
17269 }
17270 NodeRef::Pattern(node) => {
17271 let iterator = ::std::iter::empty::<NodeRef<'ast>>()
17272 .chain(::std::iter::once(NodeRef::Disjunction(&node.body)));
17273 Box::new(iterator)
17274 }
17275 NodeRef::Quantifier(node) => {
17276 let iterator = ::std::iter::empty::<NodeRef<'ast>>()
17277 .chain(::std::iter::once(NodeRef::Term(&node.body)));
17278 Box::new(iterator)
17279 }
17280 NodeRef::Term(node) => match node {
17281 Term::BoundaryAssertion(v0) => {
17282 Box::new(::std::iter::once(NodeRef::BoundaryAssertion(v0)))
17283 }
17284 Term::LookAroundAssertion(v0) => {
17285 Box::new(::std::iter::once(NodeRef::LookAroundAssertion(v0)))
17286 }
17287 Term::Quantifier(v0) => Box::new(::std::iter::once(NodeRef::Quantifier(v0))),
17288 Term::Character(v0) => Box::new(::std::iter::once(NodeRef::Character(v0))),
17289 Term::Dot(v0) => Box::new(::std::iter::once(NodeRef::Dot(v0))),
17290 Term::CharacterClassEscape(v0) => {
17291 Box::new(::std::iter::once(NodeRef::CharacterClassEscape(v0)))
17292 }
17293 Term::UnicodePropertyEscape(v0) => {
17294 Box::new(::std::iter::once(NodeRef::UnicodePropertyEscape(v0)))
17295 }
17296 Term::CharacterClass(v0) => {
17297 Box::new(::std::iter::once(NodeRef::CharacterClass(v0)))
17298 }
17299 Term::CapturingGroup(v0) => {
17300 Box::new(::std::iter::once(NodeRef::CapturingGroup(v0)))
17301 }
17302 Term::IgnoreGroup(v0) => Box::new(::std::iter::once(NodeRef::IgnoreGroup(v0))),
17303 Term::IndexedReference(v0) => {
17304 Box::new(::std::iter::once(NodeRef::IndexedReference(v0)))
17305 }
17306 Term::NamedReference(v0) => {
17307 Box::new(::std::iter::once(NodeRef::NamedReference(v0)))
17308 }
17309 _ => Box::new(::std::iter::empty::<NodeRef<'ast>>()),
17310 },
17311 NodeRef::UnicodePropertyEscape(node) => {
17312 let iterator = ::std::iter::empty::<NodeRef<'ast>>();
17313 Box::new(iterator)
17314 }
17315 }
17316 }
17317}
17318impl<'ast> NodeRef<'ast> {
17319 #[doc = r" Visit all nodes in self in preorder."]
17320 #[doc = r""]
17321 #[doc = r" This is not a part of semver-stable API. It is"]
17322 #[doc = r" experimental and subject to change."]
17323 pub fn experimental_traverse(&'ast self) -> Box<dyn 'ast + Iterator<Item = NodeRef<'ast>>> {
17324 let mut queue = std::collections::VecDeque::<NodeRef<'ast>>::new();
17325 queue.push_back(*self);
17326 Box::new(std::iter::from_fn(move || {
17327 let node: NodeRef<'ast> = queue.pop_front()?;
17328 {
17329 let children = node.experimental_raw_children();
17330 queue.extend(children);
17331 }
17332 Some(node)
17333 }))
17334 }
17335}
17336#[cfg(any(docsrs, feature = "path"))]
17337pub use self::fields::{AstParentKind, AstParentNodeRef};