Support ~ types on XHP attributes that are enum {'x', 'y'}
[hiphop-php.git] / hphp / hack / src / oxidized / aast_visitor / node_impl_gen.rs
blobd8bdb64228f2a17eabfc85ed1032c51c4313fd58
1 // Copyright (c) Facebook, Inc. and its affiliates.
2 //
3 // This source code is licensed under the MIT license found in the
4 // LICENSE file in the "hack" directory of this source tree.
5 //
6 // @generated SignedSource<<4ec9c84faa72364739b6d84c4b2549e8>>
7 //
8 // To regenerate this file, run:
9 //   hphp/hack/src/oxidized_regen.sh
11 #![allow(unused_variables)]
12 use super::node::Node;
13 use super::type_params::Params;
14 use super::visitor::Visitor;
15 use crate::{aast::*, aast_defs::*, ast_defs::*, doc_comment::*};
16 impl<P: Params> Node<P> for Abstraction {
17     fn accept<'node>(
18         &'node self,
19         c: &mut P::Context,
20         v: &mut dyn Visitor<'node, P = P>,
21     ) -> Result<(), P::Error> {
22         v.visit_abstraction(c, self)
23     }
24     fn recurse<'node>(
25         &'node self,
26         c: &mut P::Context,
27         v: &mut dyn Visitor<'node, P = P>,
28     ) -> Result<(), P::Error> {
29         match self {
30             Abstraction::Concrete => Ok(()),
31             Abstraction::Abstract => Ok(()),
32         }
33     }
35 impl<P: Params> Node<P> for Afield<P::Ex, P::En> {
36     fn accept<'node>(
37         &'node self,
38         c: &mut P::Context,
39         v: &mut dyn Visitor<'node, P = P>,
40     ) -> Result<(), P::Error> {
41         v.visit_afield(c, self)
42     }
43     fn recurse<'node>(
44         &'node self,
45         c: &mut P::Context,
46         v: &mut dyn Visitor<'node, P = P>,
47     ) -> Result<(), P::Error> {
48         match self {
49             Afield::AFvalue(a0) => {
50                 a0.accept(c, v)?;
51                 Ok(())
52             }
53             Afield::AFkvalue(a0, a1) => {
54                 a0.accept(c, v)?;
55                 a1.accept(c, v)?;
56                 Ok(())
57             }
58         }
59     }
61 impl<P: Params> Node<P> for AsExpr<P::Ex, P::En> {
62     fn accept<'node>(
63         &'node self,
64         c: &mut P::Context,
65         v: &mut dyn Visitor<'node, P = P>,
66     ) -> Result<(), P::Error> {
67         v.visit_as_expr(c, self)
68     }
69     fn recurse<'node>(
70         &'node self,
71         c: &mut P::Context,
72         v: &mut dyn Visitor<'node, P = P>,
73     ) -> Result<(), P::Error> {
74         match self {
75             AsExpr::AsV(a0) => {
76                 a0.accept(c, v)?;
77                 Ok(())
78             }
79             AsExpr::AsKv(a0, a1) => {
80                 a0.accept(c, v)?;
81                 a1.accept(c, v)?;
82                 Ok(())
83             }
84             AsExpr::AwaitAsV(a0, a1) => {
85                 a0.accept(c, v)?;
86                 a1.accept(c, v)?;
87                 Ok(())
88             }
89             AsExpr::AwaitAsKv(a0, a1, a2) => {
90                 a0.accept(c, v)?;
91                 a1.accept(c, v)?;
92                 a2.accept(c, v)?;
93                 Ok(())
94             }
95         }
96     }
98 impl<P: Params> Node<P> for Bop {
99     fn accept<'node>(
100         &'node self,
101         c: &mut P::Context,
102         v: &mut dyn Visitor<'node, P = P>,
103     ) -> Result<(), P::Error> {
104         v.visit_bop(c, self)
105     }
106     fn recurse<'node>(
107         &'node self,
108         c: &mut P::Context,
109         v: &mut dyn Visitor<'node, P = P>,
110     ) -> Result<(), P::Error> {
111         match self {
112             Bop::Plus => Ok(()),
113             Bop::Minus => Ok(()),
114             Bop::Star => Ok(()),
115             Bop::Slash => Ok(()),
116             Bop::Eqeq => Ok(()),
117             Bop::Eqeqeq => Ok(()),
118             Bop::Starstar => Ok(()),
119             Bop::Diff => Ok(()),
120             Bop::Diff2 => Ok(()),
121             Bop::Ampamp => Ok(()),
122             Bop::Barbar => Ok(()),
123             Bop::Lt => Ok(()),
124             Bop::Lte => Ok(()),
125             Bop::Gt => Ok(()),
126             Bop::Gte => Ok(()),
127             Bop::Dot => Ok(()),
128             Bop::Amp => Ok(()),
129             Bop::Bar => Ok(()),
130             Bop::Ltlt => Ok(()),
131             Bop::Gtgt => Ok(()),
132             Bop::Percent => Ok(()),
133             Bop::Xor => Ok(()),
134             Bop::Cmp => Ok(()),
135             Bop::QuestionQuestion => Ok(()),
136             Bop::Eq(a0) => {
137                 a0.accept(c, v)?;
138                 Ok(())
139             }
140         }
141     }
143 impl<P: Params> Node<P> for CaField<P::Ex, P::En> {
144     fn accept<'node>(
145         &'node self,
146         c: &mut P::Context,
147         v: &mut dyn Visitor<'node, P = P>,
148     ) -> Result<(), P::Error> {
149         v.visit_ca_field(c, self)
150     }
151     fn recurse<'node>(
152         &'node self,
153         c: &mut P::Context,
154         v: &mut dyn Visitor<'node, P = P>,
155     ) -> Result<(), P::Error> {
156         self.type_.accept(c, v)?;
157         self.id.accept(c, v)?;
158         self.value.accept(c, v)?;
159         self.required.accept(c, v)?;
160         Ok(())
161     }
163 impl<P: Params> Node<P> for CaType {
164     fn accept<'node>(
165         &'node self,
166         c: &mut P::Context,
167         v: &mut dyn Visitor<'node, P = P>,
168     ) -> Result<(), P::Error> {
169         v.visit_ca_type(c, self)
170     }
171     fn recurse<'node>(
172         &'node self,
173         c: &mut P::Context,
174         v: &mut dyn Visitor<'node, P = P>,
175     ) -> Result<(), P::Error> {
176         match self {
177             CaType::CAHint(a0) => {
178                 a0.accept(c, v)?;
179                 Ok(())
180             }
181             CaType::CAEnum(a0) => {
182                 a0.accept(c, v)?;
183                 Ok(())
184             }
185         }
186     }
188 impl<P: Params> Node<P> for Case<P::Ex, P::En> {
189     fn accept<'node>(
190         &'node self,
191         c: &mut P::Context,
192         v: &mut dyn Visitor<'node, P = P>,
193     ) -> Result<(), P::Error> {
194         v.visit_case(c, self)
195     }
196     fn recurse<'node>(
197         &'node self,
198         c: &mut P::Context,
199         v: &mut dyn Visitor<'node, P = P>,
200     ) -> Result<(), P::Error> {
201         match self {
202             Case::Default(a0, a1) => {
203                 a0.accept(c, v)?;
204                 a1.accept(c, v)?;
205                 Ok(())
206             }
207             Case::Case(a0, a1) => {
208                 a0.accept(c, v)?;
209                 a1.accept(c, v)?;
210                 Ok(())
211             }
212         }
213     }
215 impl<P: Params> Node<P> for Catch<P::Ex, P::En> {
216     fn accept<'node>(
217         &'node self,
218         c: &mut P::Context,
219         v: &mut dyn Visitor<'node, P = P>,
220     ) -> Result<(), P::Error> {
221         v.visit_catch(c, self)
222     }
223     fn recurse<'node>(
224         &'node self,
225         c: &mut P::Context,
226         v: &mut dyn Visitor<'node, P = P>,
227     ) -> Result<(), P::Error> {
228         self.0.accept(c, v)?;
229         self.1.accept(c, v)?;
230         self.2.accept(c, v)?;
231         Ok(())
232     }
234 impl<P: Params> Node<P> for ClassAbstractTypeconst {
235     fn accept<'node>(
236         &'node self,
237         c: &mut P::Context,
238         v: &mut dyn Visitor<'node, P = P>,
239     ) -> Result<(), P::Error> {
240         v.visit_class_abstract_typeconst(c, self)
241     }
242     fn recurse<'node>(
243         &'node self,
244         c: &mut P::Context,
245         v: &mut dyn Visitor<'node, P = P>,
246     ) -> Result<(), P::Error> {
247         self.as_constraint.accept(c, v)?;
248         self.super_constraint.accept(c, v)?;
249         self.default.accept(c, v)?;
250         Ok(())
251     }
253 impl<P: Params> Node<P> for ClassAttr<P::Ex, P::En> {
254     fn accept<'node>(
255         &'node self,
256         c: &mut P::Context,
257         v: &mut dyn Visitor<'node, P = P>,
258     ) -> Result<(), P::Error> {
259         v.visit_class_attr(c, self)
260     }
261     fn recurse<'node>(
262         &'node self,
263         c: &mut P::Context,
264         v: &mut dyn Visitor<'node, P = P>,
265     ) -> Result<(), P::Error> {
266         match self {
267             ClassAttr::CAName(a0) => {
268                 a0.accept(c, v)?;
269                 Ok(())
270             }
271             ClassAttr::CAField(a0) => {
272                 a0.accept(c, v)?;
273                 Ok(())
274             }
275         }
276     }
278 impl<P: Params> Node<P> for ClassConcreteTypeconst {
279     fn accept<'node>(
280         &'node self,
281         c: &mut P::Context,
282         v: &mut dyn Visitor<'node, P = P>,
283     ) -> Result<(), P::Error> {
284         v.visit_class_concrete_typeconst(c, self)
285     }
286     fn recurse<'node>(
287         &'node self,
288         c: &mut P::Context,
289         v: &mut dyn Visitor<'node, P = P>,
290     ) -> Result<(), P::Error> {
291         self.c_tc_type.accept(c, v)?;
292         Ok(())
293     }
295 impl<P: Params> Node<P> for ClassConst<P::Ex, P::En> {
296     fn accept<'node>(
297         &'node self,
298         c: &mut P::Context,
299         v: &mut dyn Visitor<'node, P = P>,
300     ) -> Result<(), P::Error> {
301         v.visit_class_const(c, self)
302     }
303     fn recurse<'node>(
304         &'node self,
305         c: &mut P::Context,
306         v: &mut dyn Visitor<'node, P = P>,
307     ) -> Result<(), P::Error> {
308         self.user_attributes.accept(c, v)?;
309         self.type_.accept(c, v)?;
310         self.id.accept(c, v)?;
311         self.kind.accept(c, v)?;
312         self.doc_comment.accept(c, v)?;
313         Ok(())
314     }
316 impl<P: Params> Node<P> for ClassConstKind<P::Ex, P::En> {
317     fn accept<'node>(
318         &'node self,
319         c: &mut P::Context,
320         v: &mut dyn Visitor<'node, P = P>,
321     ) -> Result<(), P::Error> {
322         v.visit_class_const_kind(c, self)
323     }
324     fn recurse<'node>(
325         &'node self,
326         c: &mut P::Context,
327         v: &mut dyn Visitor<'node, P = P>,
328     ) -> Result<(), P::Error> {
329         match self {
330             ClassConstKind::CCAbstract(a0) => {
331                 a0.accept(c, v)?;
332                 Ok(())
333             }
334             ClassConstKind::CCConcrete(a0) => {
335                 a0.accept(c, v)?;
336                 Ok(())
337             }
338         }
339     }
341 impl<P: Params> Node<P> for ClassGetExpr<P::Ex, P::En> {
342     fn accept<'node>(
343         &'node self,
344         c: &mut P::Context,
345         v: &mut dyn Visitor<'node, P = P>,
346     ) -> Result<(), P::Error> {
347         v.visit_class_get_expr(c, self)
348     }
349     fn recurse<'node>(
350         &'node self,
351         c: &mut P::Context,
352         v: &mut dyn Visitor<'node, P = P>,
353     ) -> Result<(), P::Error> {
354         match self {
355             ClassGetExpr::CGstring(a0) => {
356                 a0.accept(c, v)?;
357                 Ok(())
358             }
359             ClassGetExpr::CGexpr(a0) => {
360                 a0.accept(c, v)?;
361                 Ok(())
362             }
363         }
364     }
366 impl<P: Params> Node<P> for ClassId<P::Ex, P::En> {
367     fn accept<'node>(
368         &'node self,
369         c: &mut P::Context,
370         v: &mut dyn Visitor<'node, P = P>,
371     ) -> Result<(), P::Error> {
372         v.visit_class_id(c, self)
373     }
374     fn recurse<'node>(
375         &'node self,
376         c: &mut P::Context,
377         v: &mut dyn Visitor<'node, P = P>,
378     ) -> Result<(), P::Error> {
379         v.visit_ex(c, &self.0)?;
380         self.1.accept(c, v)?;
381         self.2.accept(c, v)?;
382         Ok(())
383     }
385 impl<P: Params> Node<P> for ClassId_<P::Ex, P::En> {
386     fn accept<'node>(
387         &'node self,
388         c: &mut P::Context,
389         v: &mut dyn Visitor<'node, P = P>,
390     ) -> Result<(), P::Error> {
391         v.visit_class_id_(c, self)
392     }
393     fn recurse<'node>(
394         &'node self,
395         c: &mut P::Context,
396         v: &mut dyn Visitor<'node, P = P>,
397     ) -> Result<(), P::Error> {
398         match self {
399             ClassId_::CIparent => Ok(()),
400             ClassId_::CIself => Ok(()),
401             ClassId_::CIstatic => Ok(()),
402             ClassId_::CIexpr(a0) => {
403                 a0.accept(c, v)?;
404                 Ok(())
405             }
406             ClassId_::CI(a0) => {
407                 a0.accept(c, v)?;
408                 Ok(())
409             }
410         }
411     }
413 impl<P: Params> Node<P> for ClassTypeconst {
414     fn accept<'node>(
415         &'node self,
416         c: &mut P::Context,
417         v: &mut dyn Visitor<'node, P = P>,
418     ) -> Result<(), P::Error> {
419         v.visit_class_typeconst(c, self)
420     }
421     fn recurse<'node>(
422         &'node self,
423         c: &mut P::Context,
424         v: &mut dyn Visitor<'node, P = P>,
425     ) -> Result<(), P::Error> {
426         match self {
427             ClassTypeconst::TCAbstract(a0) => {
428                 a0.accept(c, v)?;
429                 Ok(())
430             }
431             ClassTypeconst::TCConcrete(a0) => {
432                 a0.accept(c, v)?;
433                 Ok(())
434             }
435         }
436     }
438 impl<P: Params> Node<P> for ClassTypeconstDef<P::Ex, P::En> {
439     fn accept<'node>(
440         &'node self,
441         c: &mut P::Context,
442         v: &mut dyn Visitor<'node, P = P>,
443     ) -> Result<(), P::Error> {
444         v.visit_class_typeconst_def(c, self)
445     }
446     fn recurse<'node>(
447         &'node self,
448         c: &mut P::Context,
449         v: &mut dyn Visitor<'node, P = P>,
450     ) -> Result<(), P::Error> {
451         self.user_attributes.accept(c, v)?;
452         self.name.accept(c, v)?;
453         self.kind.accept(c, v)?;
454         self.span.accept(c, v)?;
455         self.doc_comment.accept(c, v)?;
456         self.is_ctx.accept(c, v)?;
457         Ok(())
458     }
460 impl<P: Params> Node<P> for ClassVar<P::Ex, P::En> {
461     fn accept<'node>(
462         &'node self,
463         c: &mut P::Context,
464         v: &mut dyn Visitor<'node, P = P>,
465     ) -> Result<(), P::Error> {
466         v.visit_class_var(c, self)
467     }
468     fn recurse<'node>(
469         &'node self,
470         c: &mut P::Context,
471         v: &mut dyn Visitor<'node, P = P>,
472     ) -> Result<(), P::Error> {
473         self.final_.accept(c, v)?;
474         self.xhp_attr.accept(c, v)?;
475         self.abstract_.accept(c, v)?;
476         self.readonly.accept(c, v)?;
477         self.visibility.accept(c, v)?;
478         self.type_.accept(c, v)?;
479         self.id.accept(c, v)?;
480         self.expr.accept(c, v)?;
481         self.user_attributes.accept(c, v)?;
482         self.doc_comment.accept(c, v)?;
483         self.is_promoted_variadic.accept(c, v)?;
484         self.is_static.accept(c, v)?;
485         self.span.accept(c, v)?;
486         Ok(())
487     }
489 impl<P: Params> Node<P> for Class_<P::Ex, P::En> {
490     fn accept<'node>(
491         &'node self,
492         c: &mut P::Context,
493         v: &mut dyn Visitor<'node, P = P>,
494     ) -> Result<(), P::Error> {
495         v.visit_class_(c, self)
496     }
497     fn recurse<'node>(
498         &'node self,
499         c: &mut P::Context,
500         v: &mut dyn Visitor<'node, P = P>,
501     ) -> Result<(), P::Error> {
502         self.span.accept(c, v)?;
503         v.visit_en(c, &self.annotation)?;
504         self.mode.accept(c, v)?;
505         self.final_.accept(c, v)?;
506         self.is_xhp.accept(c, v)?;
507         self.has_xhp_keyword.accept(c, v)?;
508         self.kind.accept(c, v)?;
509         self.name.accept(c, v)?;
510         self.tparams.accept(c, v)?;
511         self.extends.accept(c, v)?;
512         self.uses.accept(c, v)?;
513         self.use_as_alias.accept(c, v)?;
514         self.insteadof_alias.accept(c, v)?;
515         self.xhp_attr_uses.accept(c, v)?;
516         self.xhp_category.accept(c, v)?;
517         self.reqs.accept(c, v)?;
518         self.implements.accept(c, v)?;
519         self.where_constraints.accept(c, v)?;
520         self.consts.accept(c, v)?;
521         self.typeconsts.accept(c, v)?;
522         self.vars.accept(c, v)?;
523         self.methods.accept(c, v)?;
524         self.attributes.accept(c, v)?;
525         self.xhp_children.accept(c, v)?;
526         self.xhp_attrs.accept(c, v)?;
527         self.namespace.accept(c, v)?;
528         self.user_attributes.accept(c, v)?;
529         self.file_attributes.accept(c, v)?;
530         self.enum_.accept(c, v)?;
531         self.doc_comment.accept(c, v)?;
532         self.emit_id.accept(c, v)?;
533         Ok(())
534     }
536 impl<P: Params> Node<P> for ClassishKind {
537     fn accept<'node>(
538         &'node self,
539         c: &mut P::Context,
540         v: &mut dyn Visitor<'node, P = P>,
541     ) -> Result<(), P::Error> {
542         v.visit_classish_kind(c, self)
543     }
544     fn recurse<'node>(
545         &'node self,
546         c: &mut P::Context,
547         v: &mut dyn Visitor<'node, P = P>,
548     ) -> Result<(), P::Error> {
549         match self {
550             ClassishKind::Cclass(a0) => {
551                 a0.accept(c, v)?;
552                 Ok(())
553             }
554             ClassishKind::Cinterface => Ok(()),
555             ClassishKind::Ctrait => Ok(()),
556             ClassishKind::Cenum => Ok(()),
557             ClassishKind::CenumClass(a0) => {
558                 a0.accept(c, v)?;
559                 Ok(())
560             }
561         }
562     }
564 impl<P: Params> Node<P> for CollectionTarg<P::Ex> {
565     fn accept<'node>(
566         &'node self,
567         c: &mut P::Context,
568         v: &mut dyn Visitor<'node, P = P>,
569     ) -> Result<(), P::Error> {
570         v.visit_collection_targ(c, self)
571     }
572     fn recurse<'node>(
573         &'node self,
574         c: &mut P::Context,
575         v: &mut dyn Visitor<'node, P = P>,
576     ) -> Result<(), P::Error> {
577         match self {
578             CollectionTarg::CollectionTV(a0) => {
579                 a0.accept(c, v)?;
580                 Ok(())
581             }
582             CollectionTarg::CollectionTKV(a0, a1) => {
583                 a0.accept(c, v)?;
584                 a1.accept(c, v)?;
585                 Ok(())
586             }
587         }
588     }
590 impl<P: Params> Node<P> for ConstraintKind {
591     fn accept<'node>(
592         &'node self,
593         c: &mut P::Context,
594         v: &mut dyn Visitor<'node, P = P>,
595     ) -> Result<(), P::Error> {
596         v.visit_constraint_kind(c, self)
597     }
598     fn recurse<'node>(
599         &'node self,
600         c: &mut P::Context,
601         v: &mut dyn Visitor<'node, P = P>,
602     ) -> Result<(), P::Error> {
603         match self {
604             ConstraintKind::ConstraintAs => Ok(()),
605             ConstraintKind::ConstraintEq => Ok(()),
606             ConstraintKind::ConstraintSuper => Ok(()),
607         }
608     }
610 impl<P: Params> Node<P> for Contexts {
611     fn accept<'node>(
612         &'node self,
613         c: &mut P::Context,
614         v: &mut dyn Visitor<'node, P = P>,
615     ) -> Result<(), P::Error> {
616         v.visit_contexts(c, self)
617     }
618     fn recurse<'node>(
619         &'node self,
620         c: &mut P::Context,
621         v: &mut dyn Visitor<'node, P = P>,
622     ) -> Result<(), P::Error> {
623         self.0.accept(c, v)?;
624         self.1.accept(c, v)?;
625         Ok(())
626     }
628 impl<P: Params> Node<P> for Def<P::Ex, P::En> {
629     fn accept<'node>(
630         &'node self,
631         c: &mut P::Context,
632         v: &mut dyn Visitor<'node, P = P>,
633     ) -> Result<(), P::Error> {
634         v.visit_def(c, self)
635     }
636     fn recurse<'node>(
637         &'node self,
638         c: &mut P::Context,
639         v: &mut dyn Visitor<'node, P = P>,
640     ) -> Result<(), P::Error> {
641         match self {
642             Def::Fun(a0) => {
643                 a0.accept(c, v)?;
644                 Ok(())
645             }
646             Def::Class(a0) => {
647                 a0.accept(c, v)?;
648                 Ok(())
649             }
650             Def::Stmt(a0) => {
651                 a0.accept(c, v)?;
652                 Ok(())
653             }
654             Def::Typedef(a0) => {
655                 a0.accept(c, v)?;
656                 Ok(())
657             }
658             Def::Constant(a0) => {
659                 a0.accept(c, v)?;
660                 Ok(())
661             }
662             Def::Namespace(a) => {
663                 a.0.accept(c, v)?;
664                 a.1.accept(c, v)?;
665                 Ok(())
666             }
667             Def::NamespaceUse(a0) => {
668                 a0.accept(c, v)?;
669                 Ok(())
670             }
671             Def::SetNamespaceEnv(a0) => {
672                 a0.accept(c, v)?;
673                 Ok(())
674             }
675             Def::FileAttributes(a0) => {
676                 a0.accept(c, v)?;
677                 Ok(())
678             }
679         }
680     }
682 impl<P: Params> Node<P> for DocComment {
683     fn accept<'node>(
684         &'node self,
685         c: &mut P::Context,
686         v: &mut dyn Visitor<'node, P = P>,
687     ) -> Result<(), P::Error> {
688         v.visit_doc_comment(c, self)
689     }
690     fn recurse<'node>(
691         &'node self,
692         c: &mut P::Context,
693         v: &mut dyn Visitor<'node, P = P>,
694     ) -> Result<(), P::Error> {
695         self.0.accept(c, v)?;
696         Ok(())
697     }
699 impl<P: Params> Node<P> for EmitId {
700     fn accept<'node>(
701         &'node self,
702         c: &mut P::Context,
703         v: &mut dyn Visitor<'node, P = P>,
704     ) -> Result<(), P::Error> {
705         v.visit_emit_id(c, self)
706     }
707     fn recurse<'node>(
708         &'node self,
709         c: &mut P::Context,
710         v: &mut dyn Visitor<'node, P = P>,
711     ) -> Result<(), P::Error> {
712         match self {
713             EmitId::EmitId(a0) => {
714                 a0.accept(c, v)?;
715                 Ok(())
716             }
717             EmitId::Anonymous => Ok(()),
718         }
719     }
721 impl<P: Params> Node<P> for Enum_ {
722     fn accept<'node>(
723         &'node self,
724         c: &mut P::Context,
725         v: &mut dyn Visitor<'node, P = P>,
726     ) -> Result<(), P::Error> {
727         v.visit_enum_(c, self)
728     }
729     fn recurse<'node>(
730         &'node self,
731         c: &mut P::Context,
732         v: &mut dyn Visitor<'node, P = P>,
733     ) -> Result<(), P::Error> {
734         self.base.accept(c, v)?;
735         self.constraint.accept(c, v)?;
736         self.includes.accept(c, v)?;
737         Ok(())
738     }
740 impl<P: Params> Node<P> for EnvAnnot {
741     fn accept<'node>(
742         &'node self,
743         c: &mut P::Context,
744         v: &mut dyn Visitor<'node, P = P>,
745     ) -> Result<(), P::Error> {
746         v.visit_env_annot(c, self)
747     }
748     fn recurse<'node>(
749         &'node self,
750         c: &mut P::Context,
751         v: &mut dyn Visitor<'node, P = P>,
752     ) -> Result<(), P::Error> {
753         match self {
754             EnvAnnot::Join => Ok(()),
755             EnvAnnot::Refinement => Ok(()),
756         }
757     }
759 impl<P: Params> Node<P> for Expr<P::Ex, P::En> {
760     fn accept<'node>(
761         &'node self,
762         c: &mut P::Context,
763         v: &mut dyn Visitor<'node, P = P>,
764     ) -> Result<(), P::Error> {
765         v.visit_expr(c, self)
766     }
767     fn recurse<'node>(
768         &'node self,
769         c: &mut P::Context,
770         v: &mut dyn Visitor<'node, P = P>,
771     ) -> Result<(), P::Error> {
772         v.visit_ex(c, &self.0)?;
773         self.1.accept(c, v)?;
774         self.2.accept(c, v)?;
775         Ok(())
776     }
778 impl<P: Params> Node<P> for Expr_<P::Ex, P::En> {
779     fn accept<'node>(
780         &'node self,
781         c: &mut P::Context,
782         v: &mut dyn Visitor<'node, P = P>,
783     ) -> Result<(), P::Error> {
784         v.visit_expr_(c, self)
785     }
786     fn recurse<'node>(
787         &'node self,
788         c: &mut P::Context,
789         v: &mut dyn Visitor<'node, P = P>,
790     ) -> Result<(), P::Error> {
791         match self {
792             Expr_::Darray(a) => {
793                 a.0.accept(c, v)?;
794                 a.1.accept(c, v)?;
795                 Ok(())
796             }
797             Expr_::Varray(a) => {
798                 a.0.accept(c, v)?;
799                 a.1.accept(c, v)?;
800                 Ok(())
801             }
802             Expr_::Shape(a0) => {
803                 a0.accept(c, v)?;
804                 Ok(())
805             }
806             Expr_::ValCollection(a) => {
807                 a.0.accept(c, v)?;
808                 a.1.accept(c, v)?;
809                 a.2.accept(c, v)?;
810                 Ok(())
811             }
812             Expr_::KeyValCollection(a) => {
813                 a.0.accept(c, v)?;
814                 a.1.accept(c, v)?;
815                 a.2.accept(c, v)?;
816                 Ok(())
817             }
818             Expr_::Null => Ok(()),
819             Expr_::This => Ok(()),
820             Expr_::True => Ok(()),
821             Expr_::False => Ok(()),
822             Expr_::Omitted => Ok(()),
823             Expr_::Id(a0) => {
824                 a0.accept(c, v)?;
825                 Ok(())
826             }
827             Expr_::Lvar(a0) => {
828                 a0.accept(c, v)?;
829                 Ok(())
830             }
831             Expr_::Dollardollar(a0) => {
832                 a0.accept(c, v)?;
833                 Ok(())
834             }
835             Expr_::Clone(a0) => {
836                 a0.accept(c, v)?;
837                 Ok(())
838             }
839             Expr_::ArrayGet(a) => {
840                 a.0.accept(c, v)?;
841                 a.1.accept(c, v)?;
842                 Ok(())
843             }
844             Expr_::ObjGet(a) => {
845                 a.0.accept(c, v)?;
846                 a.1.accept(c, v)?;
847                 a.2.accept(c, v)?;
848                 a.3.accept(c, v)?;
849                 Ok(())
850             }
851             Expr_::ClassGet(a) => {
852                 a.0.accept(c, v)?;
853                 a.1.accept(c, v)?;
854                 a.2.accept(c, v)?;
855                 Ok(())
856             }
857             Expr_::ClassConst(a) => {
858                 a.0.accept(c, v)?;
859                 a.1.accept(c, v)?;
860                 Ok(())
861             }
862             Expr_::Call(a) => {
863                 a.0.accept(c, v)?;
864                 a.1.accept(c, v)?;
865                 a.2.accept(c, v)?;
866                 a.3.accept(c, v)?;
867                 Ok(())
868             }
869             Expr_::FunctionPointer(a) => {
870                 a.0.accept(c, v)?;
871                 a.1.accept(c, v)?;
872                 Ok(())
873             }
874             Expr_::Int(a0) => {
875                 a0.accept(c, v)?;
876                 Ok(())
877             }
878             Expr_::Float(a0) => {
879                 a0.accept(c, v)?;
880                 Ok(())
881             }
882             Expr_::String(a0) => {
883                 a0.accept(c, v)?;
884                 Ok(())
885             }
886             Expr_::String2(a0) => {
887                 a0.accept(c, v)?;
888                 Ok(())
889             }
890             Expr_::PrefixedString(a) => {
891                 a.0.accept(c, v)?;
892                 a.1.accept(c, v)?;
893                 Ok(())
894             }
895             Expr_::Yield(a0) => {
896                 a0.accept(c, v)?;
897                 Ok(())
898             }
899             Expr_::Await(a0) => {
900                 a0.accept(c, v)?;
901                 Ok(())
902             }
903             Expr_::ReadonlyExpr(a0) => {
904                 a0.accept(c, v)?;
905                 Ok(())
906             }
907             Expr_::Tuple(a0) => {
908                 a0.accept(c, v)?;
909                 Ok(())
910             }
911             Expr_::List(a0) => {
912                 a0.accept(c, v)?;
913                 Ok(())
914             }
915             Expr_::Cast(a) => {
916                 a.0.accept(c, v)?;
917                 a.1.accept(c, v)?;
918                 Ok(())
919             }
920             Expr_::Unop(a) => {
921                 a.0.accept(c, v)?;
922                 a.1.accept(c, v)?;
923                 Ok(())
924             }
925             Expr_::Binop(a) => {
926                 a.0.accept(c, v)?;
927                 a.1.accept(c, v)?;
928                 a.2.accept(c, v)?;
929                 Ok(())
930             }
931             Expr_::Pipe(a) => {
932                 a.0.accept(c, v)?;
933                 a.1.accept(c, v)?;
934                 a.2.accept(c, v)?;
935                 Ok(())
936             }
937             Expr_::Eif(a) => {
938                 a.0.accept(c, v)?;
939                 a.1.accept(c, v)?;
940                 a.2.accept(c, v)?;
941                 Ok(())
942             }
943             Expr_::Is(a) => {
944                 a.0.accept(c, v)?;
945                 a.1.accept(c, v)?;
946                 Ok(())
947             }
948             Expr_::As(a) => {
949                 a.0.accept(c, v)?;
950                 a.1.accept(c, v)?;
951                 a.2.accept(c, v)?;
952                 Ok(())
953             }
954             Expr_::Upcast(a) => {
955                 a.0.accept(c, v)?;
956                 a.1.accept(c, v)?;
957                 Ok(())
958             }
959             Expr_::New(a) => {
960                 a.0.accept(c, v)?;
961                 a.1.accept(c, v)?;
962                 a.2.accept(c, v)?;
963                 a.3.accept(c, v)?;
964                 v.visit_ex(c, &a.4)?;
965                 Ok(())
966             }
967             Expr_::Efun(a) => {
968                 a.0.accept(c, v)?;
969                 a.1.accept(c, v)?;
970                 Ok(())
971             }
972             Expr_::Lfun(a) => {
973                 a.0.accept(c, v)?;
974                 a.1.accept(c, v)?;
975                 Ok(())
976             }
977             Expr_::Xml(a) => {
978                 a.0.accept(c, v)?;
979                 a.1.accept(c, v)?;
980                 a.2.accept(c, v)?;
981                 Ok(())
982             }
983             Expr_::Import(a) => {
984                 a.0.accept(c, v)?;
985                 a.1.accept(c, v)?;
986                 Ok(())
987             }
988             Expr_::Collection(a) => {
989                 a.0.accept(c, v)?;
990                 a.1.accept(c, v)?;
991                 a.2.accept(c, v)?;
992                 Ok(())
993             }
994             Expr_::ExpressionTree(a0) => {
995                 a0.accept(c, v)?;
996                 Ok(())
997             }
998             Expr_::Lplaceholder(a0) => {
999                 a0.accept(c, v)?;
1000                 Ok(())
1001             }
1002             Expr_::FunId(a0) => {
1003                 a0.accept(c, v)?;
1004                 Ok(())
1005             }
1006             Expr_::MethodId(a) => {
1007                 a.0.accept(c, v)?;
1008                 a.1.accept(c, v)?;
1009                 Ok(())
1010             }
1011             Expr_::MethodCaller(a) => {
1012                 a.0.accept(c, v)?;
1013                 a.1.accept(c, v)?;
1014                 Ok(())
1015             }
1016             Expr_::SmethodId(a) => {
1017                 a.0.accept(c, v)?;
1018                 a.1.accept(c, v)?;
1019                 Ok(())
1020             }
1021             Expr_::Pair(a) => {
1022                 a.0.accept(c, v)?;
1023                 a.1.accept(c, v)?;
1024                 a.2.accept(c, v)?;
1025                 Ok(())
1026             }
1027             Expr_::ETSplice(a0) => {
1028                 a0.accept(c, v)?;
1029                 Ok(())
1030             }
1031             Expr_::EnumClassLabel(a) => {
1032                 a.0.accept(c, v)?;
1033                 a.1.accept(c, v)?;
1034                 Ok(())
1035             }
1036             Expr_::Hole(a) => {
1037                 a.0.accept(c, v)?;
1038                 v.visit_ex(c, &a.1)?;
1039                 v.visit_ex(c, &a.2)?;
1040                 a.3.accept(c, v)?;
1041                 Ok(())
1042             }
1043         }
1044     }
1046 impl<P: Params> Node<P> for ExpressionTree<P::Ex, P::En> {
1047     fn accept<'node>(
1048         &'node self,
1049         c: &mut P::Context,
1050         v: &mut dyn Visitor<'node, P = P>,
1051     ) -> Result<(), P::Error> {
1052         v.visit_expression_tree(c, self)
1053     }
1054     fn recurse<'node>(
1055         &'node self,
1056         c: &mut P::Context,
1057         v: &mut dyn Visitor<'node, P = P>,
1058     ) -> Result<(), P::Error> {
1059         self.hint.accept(c, v)?;
1060         self.splices.accept(c, v)?;
1061         self.function_pointers.accept(c, v)?;
1062         self.virtualized_expr.accept(c, v)?;
1063         self.runtime_expr.accept(c, v)?;
1064         self.dollardollar_pos.accept(c, v)?;
1065         Ok(())
1066     }
1068 impl<P: Params> Node<P> for Field<P::Ex, P::En> {
1069     fn accept<'node>(
1070         &'node self,
1071         c: &mut P::Context,
1072         v: &mut dyn Visitor<'node, P = P>,
1073     ) -> Result<(), P::Error> {
1074         v.visit_field(c, self)
1075     }
1076     fn recurse<'node>(
1077         &'node self,
1078         c: &mut P::Context,
1079         v: &mut dyn Visitor<'node, P = P>,
1080     ) -> Result<(), P::Error> {
1081         self.0.accept(c, v)?;
1082         self.1.accept(c, v)?;
1083         Ok(())
1084     }
1086 impl<P: Params> Node<P> for FileAttribute<P::Ex, P::En> {
1087     fn accept<'node>(
1088         &'node self,
1089         c: &mut P::Context,
1090         v: &mut dyn Visitor<'node, P = P>,
1091     ) -> Result<(), P::Error> {
1092         v.visit_file_attribute(c, self)
1093     }
1094     fn recurse<'node>(
1095         &'node self,
1096         c: &mut P::Context,
1097         v: &mut dyn Visitor<'node, P = P>,
1098     ) -> Result<(), P::Error> {
1099         self.user_attributes.accept(c, v)?;
1100         self.namespace.accept(c, v)?;
1101         Ok(())
1102     }
1104 impl<P: Params> Node<P> for FunDef<P::Ex, P::En> {
1105     fn accept<'node>(
1106         &'node self,
1107         c: &mut P::Context,
1108         v: &mut dyn Visitor<'node, P = P>,
1109     ) -> Result<(), P::Error> {
1110         v.visit_fun_def(c, self)
1111     }
1112     fn recurse<'node>(
1113         &'node self,
1114         c: &mut P::Context,
1115         v: &mut dyn Visitor<'node, P = P>,
1116     ) -> Result<(), P::Error> {
1117         self.namespace.accept(c, v)?;
1118         self.file_attributes.accept(c, v)?;
1119         self.mode.accept(c, v)?;
1120         self.fun.accept(c, v)?;
1121         Ok(())
1122     }
1124 impl<P: Params> Node<P> for FunKind {
1125     fn accept<'node>(
1126         &'node self,
1127         c: &mut P::Context,
1128         v: &mut dyn Visitor<'node, P = P>,
1129     ) -> Result<(), P::Error> {
1130         v.visit_fun_kind(c, self)
1131     }
1132     fn recurse<'node>(
1133         &'node self,
1134         c: &mut P::Context,
1135         v: &mut dyn Visitor<'node, P = P>,
1136     ) -> Result<(), P::Error> {
1137         match self {
1138             FunKind::FSync => Ok(()),
1139             FunKind::FAsync => Ok(()),
1140             FunKind::FGenerator => Ok(()),
1141             FunKind::FAsyncGenerator => Ok(()),
1142         }
1143     }
1145 impl<P: Params> Node<P> for FunParam<P::Ex, P::En> {
1146     fn accept<'node>(
1147         &'node self,
1148         c: &mut P::Context,
1149         v: &mut dyn Visitor<'node, P = P>,
1150     ) -> Result<(), P::Error> {
1151         v.visit_fun_param(c, self)
1152     }
1153     fn recurse<'node>(
1154         &'node self,
1155         c: &mut P::Context,
1156         v: &mut dyn Visitor<'node, P = P>,
1157     ) -> Result<(), P::Error> {
1158         v.visit_ex(c, &self.annotation)?;
1159         self.type_hint.accept(c, v)?;
1160         self.is_variadic.accept(c, v)?;
1161         self.pos.accept(c, v)?;
1162         self.name.accept(c, v)?;
1163         self.expr.accept(c, v)?;
1164         self.readonly.accept(c, v)?;
1165         self.callconv.accept(c, v)?;
1166         self.user_attributes.accept(c, v)?;
1167         self.visibility.accept(c, v)?;
1168         Ok(())
1169     }
1171 impl<P: Params> Node<P> for FunVariadicity<P::Ex, P::En> {
1172     fn accept<'node>(
1173         &'node self,
1174         c: &mut P::Context,
1175         v: &mut dyn Visitor<'node, P = P>,
1176     ) -> Result<(), P::Error> {
1177         v.visit_fun_variadicity(c, self)
1178     }
1179     fn recurse<'node>(
1180         &'node self,
1181         c: &mut P::Context,
1182         v: &mut dyn Visitor<'node, P = P>,
1183     ) -> Result<(), P::Error> {
1184         match self {
1185             FunVariadicity::FVvariadicArg(a0) => {
1186                 a0.accept(c, v)?;
1187                 Ok(())
1188             }
1189             FunVariadicity::FVnonVariadic => Ok(()),
1190         }
1191     }
1193 impl<P: Params> Node<P> for Fun_<P::Ex, P::En> {
1194     fn accept<'node>(
1195         &'node self,
1196         c: &mut P::Context,
1197         v: &mut dyn Visitor<'node, P = P>,
1198     ) -> Result<(), P::Error> {
1199         v.visit_fun_(c, self)
1200     }
1201     fn recurse<'node>(
1202         &'node self,
1203         c: &mut P::Context,
1204         v: &mut dyn Visitor<'node, P = P>,
1205     ) -> Result<(), P::Error> {
1206         self.span.accept(c, v)?;
1207         self.readonly_this.accept(c, v)?;
1208         v.visit_en(c, &self.annotation)?;
1209         self.readonly_ret.accept(c, v)?;
1210         self.ret.accept(c, v)?;
1211         self.name.accept(c, v)?;
1212         self.tparams.accept(c, v)?;
1213         self.where_constraints.accept(c, v)?;
1214         self.variadic.accept(c, v)?;
1215         self.params.accept(c, v)?;
1216         self.ctxs.accept(c, v)?;
1217         self.unsafe_ctxs.accept(c, v)?;
1218         self.body.accept(c, v)?;
1219         self.fun_kind.accept(c, v)?;
1220         self.user_attributes.accept(c, v)?;
1221         self.external.accept(c, v)?;
1222         self.doc_comment.accept(c, v)?;
1223         Ok(())
1224     }
1226 impl<P: Params> Node<P> for FuncBody<P::Ex, P::En> {
1227     fn accept<'node>(
1228         &'node self,
1229         c: &mut P::Context,
1230         v: &mut dyn Visitor<'node, P = P>,
1231     ) -> Result<(), P::Error> {
1232         v.visit_func_body(c, self)
1233     }
1234     fn recurse<'node>(
1235         &'node self,
1236         c: &mut P::Context,
1237         v: &mut dyn Visitor<'node, P = P>,
1238     ) -> Result<(), P::Error> {
1239         self.fb_ast.accept(c, v)?;
1240         Ok(())
1241     }
1243 impl<P: Params> Node<P> for FunctionPtrId<P::Ex, P::En> {
1244     fn accept<'node>(
1245         &'node self,
1246         c: &mut P::Context,
1247         v: &mut dyn Visitor<'node, P = P>,
1248     ) -> Result<(), P::Error> {
1249         v.visit_function_ptr_id(c, self)
1250     }
1251     fn recurse<'node>(
1252         &'node self,
1253         c: &mut P::Context,
1254         v: &mut dyn Visitor<'node, P = P>,
1255     ) -> Result<(), P::Error> {
1256         match self {
1257             FunctionPtrId::FPId(a0) => {
1258                 a0.accept(c, v)?;
1259                 Ok(())
1260             }
1261             FunctionPtrId::FPClassConst(a0, a1) => {
1262                 a0.accept(c, v)?;
1263                 a1.accept(c, v)?;
1264                 Ok(())
1265             }
1266         }
1267     }
1269 impl<P: Params> Node<P> for Gconst<P::Ex, P::En> {
1270     fn accept<'node>(
1271         &'node self,
1272         c: &mut P::Context,
1273         v: &mut dyn Visitor<'node, P = P>,
1274     ) -> Result<(), P::Error> {
1275         v.visit_gconst(c, self)
1276     }
1277     fn recurse<'node>(
1278         &'node self,
1279         c: &mut P::Context,
1280         v: &mut dyn Visitor<'node, P = P>,
1281     ) -> Result<(), P::Error> {
1282         v.visit_en(c, &self.annotation)?;
1283         self.mode.accept(c, v)?;
1284         self.name.accept(c, v)?;
1285         self.type_.accept(c, v)?;
1286         self.value.accept(c, v)?;
1287         self.namespace.accept(c, v)?;
1288         self.span.accept(c, v)?;
1289         self.emit_id.accept(c, v)?;
1290         Ok(())
1291     }
1293 impl<P: Params> Node<P> for HfParamInfo {
1294     fn accept<'node>(
1295         &'node self,
1296         c: &mut P::Context,
1297         v: &mut dyn Visitor<'node, P = P>,
1298     ) -> Result<(), P::Error> {
1299         v.visit_hf_param_info(c, self)
1300     }
1301     fn recurse<'node>(
1302         &'node self,
1303         c: &mut P::Context,
1304         v: &mut dyn Visitor<'node, P = P>,
1305     ) -> Result<(), P::Error> {
1306         self.kind.accept(c, v)?;
1307         self.readonlyness.accept(c, v)?;
1308         Ok(())
1309     }
1311 impl<P: Params> Node<P> for Hint {
1312     fn accept<'node>(
1313         &'node self,
1314         c: &mut P::Context,
1315         v: &mut dyn Visitor<'node, P = P>,
1316     ) -> Result<(), P::Error> {
1317         v.visit_hint(c, self)
1318     }
1319     fn recurse<'node>(
1320         &'node self,
1321         c: &mut P::Context,
1322         v: &mut dyn Visitor<'node, P = P>,
1323     ) -> Result<(), P::Error> {
1324         self.0.accept(c, v)?;
1325         self.1.accept(c, v)?;
1326         Ok(())
1327     }
1329 impl<P: Params> Node<P> for HintFun {
1330     fn accept<'node>(
1331         &'node self,
1332         c: &mut P::Context,
1333         v: &mut dyn Visitor<'node, P = P>,
1334     ) -> Result<(), P::Error> {
1335         v.visit_hint_fun(c, self)
1336     }
1337     fn recurse<'node>(
1338         &'node self,
1339         c: &mut P::Context,
1340         v: &mut dyn Visitor<'node, P = P>,
1341     ) -> Result<(), P::Error> {
1342         self.is_readonly.accept(c, v)?;
1343         self.param_tys.accept(c, v)?;
1344         self.param_info.accept(c, v)?;
1345         self.variadic_ty.accept(c, v)?;
1346         self.ctxs.accept(c, v)?;
1347         self.return_ty.accept(c, v)?;
1348         self.is_readonly_return.accept(c, v)?;
1349         Ok(())
1350     }
1352 impl<P: Params> Node<P> for Hint_ {
1353     fn accept<'node>(
1354         &'node self,
1355         c: &mut P::Context,
1356         v: &mut dyn Visitor<'node, P = P>,
1357     ) -> Result<(), P::Error> {
1358         v.visit_hint_(c, self)
1359     }
1360     fn recurse<'node>(
1361         &'node self,
1362         c: &mut P::Context,
1363         v: &mut dyn Visitor<'node, P = P>,
1364     ) -> Result<(), P::Error> {
1365         match self {
1366             Hint_::Hoption(a0) => {
1367                 a0.accept(c, v)?;
1368                 Ok(())
1369             }
1370             Hint_::Hlike(a0) => {
1371                 a0.accept(c, v)?;
1372                 Ok(())
1373             }
1374             Hint_::Hfun(a0) => {
1375                 a0.accept(c, v)?;
1376                 Ok(())
1377             }
1378             Hint_::Htuple(a0) => {
1379                 a0.accept(c, v)?;
1380                 Ok(())
1381             }
1382             Hint_::Happly(a0, a1) => {
1383                 a0.accept(c, v)?;
1384                 a1.accept(c, v)?;
1385                 Ok(())
1386             }
1387             Hint_::Hshape(a0) => {
1388                 a0.accept(c, v)?;
1389                 Ok(())
1390             }
1391             Hint_::Haccess(a0, a1) => {
1392                 a0.accept(c, v)?;
1393                 a1.accept(c, v)?;
1394                 Ok(())
1395             }
1396             Hint_::Hsoft(a0) => {
1397                 a0.accept(c, v)?;
1398                 Ok(())
1399             }
1400             Hint_::Hany => Ok(()),
1401             Hint_::Herr => Ok(()),
1402             Hint_::Hmixed => Ok(()),
1403             Hint_::Hnonnull => Ok(()),
1404             Hint_::Habstr(a0, a1) => {
1405                 a0.accept(c, v)?;
1406                 a1.accept(c, v)?;
1407                 Ok(())
1408             }
1409             Hint_::HvecOrDict(a0, a1) => {
1410                 a0.accept(c, v)?;
1411                 a1.accept(c, v)?;
1412                 Ok(())
1413             }
1414             Hint_::Hprim(a0) => {
1415                 a0.accept(c, v)?;
1416                 Ok(())
1417             }
1418             Hint_::Hthis => Ok(()),
1419             Hint_::Hdynamic => Ok(()),
1420             Hint_::Hnothing => Ok(()),
1421             Hint_::Hunion(a0) => {
1422                 a0.accept(c, v)?;
1423                 Ok(())
1424             }
1425             Hint_::Hintersection(a0) => {
1426                 a0.accept(c, v)?;
1427                 Ok(())
1428             }
1429             Hint_::HfunContext(a0) => {
1430                 a0.accept(c, v)?;
1431                 Ok(())
1432             }
1433             Hint_::Hvar(a0) => {
1434                 a0.accept(c, v)?;
1435                 Ok(())
1436             }
1437         }
1438     }
1440 impl<P: Params> Node<P> for HoleSource {
1441     fn accept<'node>(
1442         &'node self,
1443         c: &mut P::Context,
1444         v: &mut dyn Visitor<'node, P = P>,
1445     ) -> Result<(), P::Error> {
1446         v.visit_hole_source(c, self)
1447     }
1448     fn recurse<'node>(
1449         &'node self,
1450         c: &mut P::Context,
1451         v: &mut dyn Visitor<'node, P = P>,
1452     ) -> Result<(), P::Error> {
1453         match self {
1454             HoleSource::Typing => Ok(()),
1455             HoleSource::UnsafeCast(a0) => {
1456                 a0.accept(c, v)?;
1457                 Ok(())
1458             }
1459             HoleSource::EnforcedCast(a0) => {
1460                 a0.accept(c, v)?;
1461                 Ok(())
1462             }
1463         }
1464     }
1466 impl<P: Params> Node<P> for Id {
1467     fn accept<'node>(
1468         &'node self,
1469         c: &mut P::Context,
1470         v: &mut dyn Visitor<'node, P = P>,
1471     ) -> Result<(), P::Error> {
1472         v.visit_id(c, self)
1473     }
1474     fn recurse<'node>(
1475         &'node self,
1476         c: &mut P::Context,
1477         v: &mut dyn Visitor<'node, P = P>,
1478     ) -> Result<(), P::Error> {
1479         self.0.accept(c, v)?;
1480         self.1.accept(c, v)?;
1481         Ok(())
1482     }
1484 impl<P: Params> Node<P> for ImportFlavor {
1485     fn accept<'node>(
1486         &'node self,
1487         c: &mut P::Context,
1488         v: &mut dyn Visitor<'node, P = P>,
1489     ) -> Result<(), P::Error> {
1490         v.visit_import_flavor(c, self)
1491     }
1492     fn recurse<'node>(
1493         &'node self,
1494         c: &mut P::Context,
1495         v: &mut dyn Visitor<'node, P = P>,
1496     ) -> Result<(), P::Error> {
1497         match self {
1498             ImportFlavor::Include => Ok(()),
1499             ImportFlavor::Require => Ok(()),
1500             ImportFlavor::IncludeOnce => Ok(()),
1501             ImportFlavor::RequireOnce => Ok(()),
1502         }
1503     }
1505 impl<P: Params> Node<P> for InsteadofAlias {
1506     fn accept<'node>(
1507         &'node self,
1508         c: &mut P::Context,
1509         v: &mut dyn Visitor<'node, P = P>,
1510     ) -> Result<(), P::Error> {
1511         v.visit_insteadof_alias(c, self)
1512     }
1513     fn recurse<'node>(
1514         &'node self,
1515         c: &mut P::Context,
1516         v: &mut dyn Visitor<'node, P = P>,
1517     ) -> Result<(), P::Error> {
1518         self.0.accept(c, v)?;
1519         self.1.accept(c, v)?;
1520         self.2.accept(c, v)?;
1521         Ok(())
1522     }
1524 impl<P: Params> Node<P> for KvcKind {
1525     fn accept<'node>(
1526         &'node self,
1527         c: &mut P::Context,
1528         v: &mut dyn Visitor<'node, P = P>,
1529     ) -> Result<(), P::Error> {
1530         v.visit_kvc_kind(c, self)
1531     }
1532     fn recurse<'node>(
1533         &'node self,
1534         c: &mut P::Context,
1535         v: &mut dyn Visitor<'node, P = P>,
1536     ) -> Result<(), P::Error> {
1537         match self {
1538             KvcKind::Map => Ok(()),
1539             KvcKind::ImmMap => Ok(()),
1540             KvcKind::Dict => Ok(()),
1541         }
1542     }
1544 impl<P: Params> Node<P> for Lid {
1545     fn accept<'node>(
1546         &'node self,
1547         c: &mut P::Context,
1548         v: &mut dyn Visitor<'node, P = P>,
1549     ) -> Result<(), P::Error> {
1550         v.visit_lid(c, self)
1551     }
1552     fn recurse<'node>(
1553         &'node self,
1554         c: &mut P::Context,
1555         v: &mut dyn Visitor<'node, P = P>,
1556     ) -> Result<(), P::Error> {
1557         self.0.accept(c, v)?;
1558         self.1.accept(c, v)?;
1559         Ok(())
1560     }
1562 impl<P: Params> Node<P> for Method_<P::Ex, P::En> {
1563     fn accept<'node>(
1564         &'node self,
1565         c: &mut P::Context,
1566         v: &mut dyn Visitor<'node, P = P>,
1567     ) -> Result<(), P::Error> {
1568         v.visit_method_(c, self)
1569     }
1570     fn recurse<'node>(
1571         &'node self,
1572         c: &mut P::Context,
1573         v: &mut dyn Visitor<'node, P = P>,
1574     ) -> Result<(), P::Error> {
1575         self.span.accept(c, v)?;
1576         v.visit_en(c, &self.annotation)?;
1577         self.final_.accept(c, v)?;
1578         self.abstract_.accept(c, v)?;
1579         self.static_.accept(c, v)?;
1580         self.readonly_this.accept(c, v)?;
1581         self.visibility.accept(c, v)?;
1582         self.name.accept(c, v)?;
1583         self.tparams.accept(c, v)?;
1584         self.where_constraints.accept(c, v)?;
1585         self.variadic.accept(c, v)?;
1586         self.params.accept(c, v)?;
1587         self.ctxs.accept(c, v)?;
1588         self.unsafe_ctxs.accept(c, v)?;
1589         self.body.accept(c, v)?;
1590         self.fun_kind.accept(c, v)?;
1591         self.user_attributes.accept(c, v)?;
1592         self.readonly_ret.accept(c, v)?;
1593         self.ret.accept(c, v)?;
1594         self.external.accept(c, v)?;
1595         self.doc_comment.accept(c, v)?;
1596         Ok(())
1597     }
1599 impl<P: Params> Node<P> for NastShapeInfo {
1600     fn accept<'node>(
1601         &'node self,
1602         c: &mut P::Context,
1603         v: &mut dyn Visitor<'node, P = P>,
1604     ) -> Result<(), P::Error> {
1605         v.visit_nast_shape_info(c, self)
1606     }
1607     fn recurse<'node>(
1608         &'node self,
1609         c: &mut P::Context,
1610         v: &mut dyn Visitor<'node, P = P>,
1611     ) -> Result<(), P::Error> {
1612         self.allows_unknown_fields.accept(c, v)?;
1613         self.field_map.accept(c, v)?;
1614         Ok(())
1615     }
1617 impl<P: Params> Node<P> for NsKind {
1618     fn accept<'node>(
1619         &'node self,
1620         c: &mut P::Context,
1621         v: &mut dyn Visitor<'node, P = P>,
1622     ) -> Result<(), P::Error> {
1623         v.visit_ns_kind(c, self)
1624     }
1625     fn recurse<'node>(
1626         &'node self,
1627         c: &mut P::Context,
1628         v: &mut dyn Visitor<'node, P = P>,
1629     ) -> Result<(), P::Error> {
1630         match self {
1631             NsKind::NSNamespace => Ok(()),
1632             NsKind::NSClass => Ok(()),
1633             NsKind::NSClassAndNamespace => Ok(()),
1634             NsKind::NSFun => Ok(()),
1635             NsKind::NSConst => Ok(()),
1636         }
1637     }
1639 impl<P: Params> Node<P> for OgNullFlavor {
1640     fn accept<'node>(
1641         &'node self,
1642         c: &mut P::Context,
1643         v: &mut dyn Visitor<'node, P = P>,
1644     ) -> Result<(), P::Error> {
1645         v.visit_og_null_flavor(c, self)
1646     }
1647     fn recurse<'node>(
1648         &'node self,
1649         c: &mut P::Context,
1650         v: &mut dyn Visitor<'node, P = P>,
1651     ) -> Result<(), P::Error> {
1652         match self {
1653             OgNullFlavor::OGNullthrows => Ok(()),
1654             OgNullFlavor::OGNullsafe => Ok(()),
1655         }
1656     }
1658 impl<P: Params> Node<P> for ParamKind {
1659     fn accept<'node>(
1660         &'node self,
1661         c: &mut P::Context,
1662         v: &mut dyn Visitor<'node, P = P>,
1663     ) -> Result<(), P::Error> {
1664         v.visit_param_kind(c, self)
1665     }
1666     fn recurse<'node>(
1667         &'node self,
1668         c: &mut P::Context,
1669         v: &mut dyn Visitor<'node, P = P>,
1670     ) -> Result<(), P::Error> {
1671         match self {
1672             ParamKind::Pinout(a0) => {
1673                 a0.accept(c, v)?;
1674                 Ok(())
1675             }
1676             ParamKind::Pnormal => Ok(()),
1677         }
1678     }
1680 impl<P: Params> Node<P> for PropOrMethod {
1681     fn accept<'node>(
1682         &'node self,
1683         c: &mut P::Context,
1684         v: &mut dyn Visitor<'node, P = P>,
1685     ) -> Result<(), P::Error> {
1686         v.visit_prop_or_method(c, self)
1687     }
1688     fn recurse<'node>(
1689         &'node self,
1690         c: &mut P::Context,
1691         v: &mut dyn Visitor<'node, P = P>,
1692     ) -> Result<(), P::Error> {
1693         match self {
1694             PropOrMethod::IsProp => Ok(()),
1695             PropOrMethod::IsMethod => Ok(()),
1696         }
1697     }
1699 impl<P: Params> Node<P> for ReadonlyKind {
1700     fn accept<'node>(
1701         &'node self,
1702         c: &mut P::Context,
1703         v: &mut dyn Visitor<'node, P = P>,
1704     ) -> Result<(), P::Error> {
1705         v.visit_readonly_kind(c, self)
1706     }
1707     fn recurse<'node>(
1708         &'node self,
1709         c: &mut P::Context,
1710         v: &mut dyn Visitor<'node, P = P>,
1711     ) -> Result<(), P::Error> {
1712         match self {
1713             ReadonlyKind::Readonly => Ok(()),
1714         }
1715     }
1717 impl<P: Params> Node<P> for ReifyKind {
1718     fn accept<'node>(
1719         &'node self,
1720         c: &mut P::Context,
1721         v: &mut dyn Visitor<'node, P = P>,
1722     ) -> Result<(), P::Error> {
1723         v.visit_reify_kind(c, self)
1724     }
1725     fn recurse<'node>(
1726         &'node self,
1727         c: &mut P::Context,
1728         v: &mut dyn Visitor<'node, P = P>,
1729     ) -> Result<(), P::Error> {
1730         match self {
1731             ReifyKind::Erased => Ok(()),
1732             ReifyKind::SoftReified => Ok(()),
1733             ReifyKind::Reified => Ok(()),
1734         }
1735     }
1737 impl<P: Params> Node<P> for ShapeFieldInfo {
1738     fn accept<'node>(
1739         &'node self,
1740         c: &mut P::Context,
1741         v: &mut dyn Visitor<'node, P = P>,
1742     ) -> Result<(), P::Error> {
1743         v.visit_shape_field_info(c, self)
1744     }
1745     fn recurse<'node>(
1746         &'node self,
1747         c: &mut P::Context,
1748         v: &mut dyn Visitor<'node, P = P>,
1749     ) -> Result<(), P::Error> {
1750         self.optional.accept(c, v)?;
1751         self.hint.accept(c, v)?;
1752         self.name.accept(c, v)?;
1753         Ok(())
1754     }
1756 impl<P: Params> Node<P> for ShapeFieldName {
1757     fn accept<'node>(
1758         &'node self,
1759         c: &mut P::Context,
1760         v: &mut dyn Visitor<'node, P = P>,
1761     ) -> Result<(), P::Error> {
1762         v.visit_shape_field_name(c, self)
1763     }
1764     fn recurse<'node>(
1765         &'node self,
1766         c: &mut P::Context,
1767         v: &mut dyn Visitor<'node, P = P>,
1768     ) -> Result<(), P::Error> {
1769         match self {
1770             ShapeFieldName::SFlitInt(a0) => {
1771                 a0.accept(c, v)?;
1772                 Ok(())
1773             }
1774             ShapeFieldName::SFlitStr(a0) => {
1775                 a0.accept(c, v)?;
1776                 Ok(())
1777             }
1778             ShapeFieldName::SFclassConst(a0, a1) => {
1779                 a0.accept(c, v)?;
1780                 a1.accept(c, v)?;
1781                 Ok(())
1782             }
1783         }
1784     }
1786 impl<P: Params> Node<P> for Stmt<P::Ex, P::En> {
1787     fn accept<'node>(
1788         &'node self,
1789         c: &mut P::Context,
1790         v: &mut dyn Visitor<'node, P = P>,
1791     ) -> Result<(), P::Error> {
1792         v.visit_stmt(c, self)
1793     }
1794     fn recurse<'node>(
1795         &'node self,
1796         c: &mut P::Context,
1797         v: &mut dyn Visitor<'node, P = P>,
1798     ) -> Result<(), P::Error> {
1799         self.0.accept(c, v)?;
1800         self.1.accept(c, v)?;
1801         Ok(())
1802     }
1804 impl<P: Params> Node<P> for Stmt_<P::Ex, P::En> {
1805     fn accept<'node>(
1806         &'node self,
1807         c: &mut P::Context,
1808         v: &mut dyn Visitor<'node, P = P>,
1809     ) -> Result<(), P::Error> {
1810         v.visit_stmt_(c, self)
1811     }
1812     fn recurse<'node>(
1813         &'node self,
1814         c: &mut P::Context,
1815         v: &mut dyn Visitor<'node, P = P>,
1816     ) -> Result<(), P::Error> {
1817         match self {
1818             Stmt_::Fallthrough => Ok(()),
1819             Stmt_::Expr(a0) => {
1820                 a0.accept(c, v)?;
1821                 Ok(())
1822             }
1823             Stmt_::Break => Ok(()),
1824             Stmt_::Continue => Ok(()),
1825             Stmt_::Throw(a0) => {
1826                 a0.accept(c, v)?;
1827                 Ok(())
1828             }
1829             Stmt_::Return(a0) => {
1830                 a0.accept(c, v)?;
1831                 Ok(())
1832             }
1833             Stmt_::YieldBreak => Ok(()),
1834             Stmt_::Awaitall(a) => {
1835                 a.0.accept(c, v)?;
1836                 a.1.accept(c, v)?;
1837                 Ok(())
1838             }
1839             Stmt_::If(a) => {
1840                 a.0.accept(c, v)?;
1841                 a.1.accept(c, v)?;
1842                 a.2.accept(c, v)?;
1843                 Ok(())
1844             }
1845             Stmt_::Do(a) => {
1846                 a.0.accept(c, v)?;
1847                 a.1.accept(c, v)?;
1848                 Ok(())
1849             }
1850             Stmt_::While(a) => {
1851                 a.0.accept(c, v)?;
1852                 a.1.accept(c, v)?;
1853                 Ok(())
1854             }
1855             Stmt_::Using(a0) => {
1856                 a0.accept(c, v)?;
1857                 Ok(())
1858             }
1859             Stmt_::For(a) => {
1860                 a.0.accept(c, v)?;
1861                 a.1.accept(c, v)?;
1862                 a.2.accept(c, v)?;
1863                 a.3.accept(c, v)?;
1864                 Ok(())
1865             }
1866             Stmt_::Switch(a) => {
1867                 a.0.accept(c, v)?;
1868                 a.1.accept(c, v)?;
1869                 Ok(())
1870             }
1871             Stmt_::Foreach(a) => {
1872                 a.0.accept(c, v)?;
1873                 a.1.accept(c, v)?;
1874                 a.2.accept(c, v)?;
1875                 Ok(())
1876             }
1877             Stmt_::Try(a) => {
1878                 a.0.accept(c, v)?;
1879                 a.1.accept(c, v)?;
1880                 a.2.accept(c, v)?;
1881                 Ok(())
1882             }
1883             Stmt_::Noop => Ok(()),
1884             Stmt_::Block(a0) => {
1885                 a0.accept(c, v)?;
1886                 Ok(())
1887             }
1888             Stmt_::Markup(a0) => {
1889                 a0.accept(c, v)?;
1890                 Ok(())
1891             }
1892             Stmt_::AssertEnv(a) => {
1893                 a.0.accept(c, v)?;
1894                 a.1.accept(c, v)?;
1895                 Ok(())
1896             }
1897         }
1898     }
1900 impl<P: Params> Node<P> for Targ<P::Ex> {
1901     fn accept<'node>(
1902         &'node self,
1903         c: &mut P::Context,
1904         v: &mut dyn Visitor<'node, P = P>,
1905     ) -> Result<(), P::Error> {
1906         v.visit_targ(c, self)
1907     }
1908     fn recurse<'node>(
1909         &'node self,
1910         c: &mut P::Context,
1911         v: &mut dyn Visitor<'node, P = P>,
1912     ) -> Result<(), P::Error> {
1913         v.visit_ex(c, &self.0)?;
1914         self.1.accept(c, v)?;
1915         Ok(())
1916     }
1918 impl<P: Params> Node<P> for Tparam<P::Ex, P::En> {
1919     fn accept<'node>(
1920         &'node self,
1921         c: &mut P::Context,
1922         v: &mut dyn Visitor<'node, P = P>,
1923     ) -> Result<(), P::Error> {
1924         v.visit_tparam(c, self)
1925     }
1926     fn recurse<'node>(
1927         &'node self,
1928         c: &mut P::Context,
1929         v: &mut dyn Visitor<'node, P = P>,
1930     ) -> Result<(), P::Error> {
1931         self.variance.accept(c, v)?;
1932         self.name.accept(c, v)?;
1933         self.parameters.accept(c, v)?;
1934         self.constraints.accept(c, v)?;
1935         self.reified.accept(c, v)?;
1936         self.user_attributes.accept(c, v)?;
1937         Ok(())
1938     }
1940 impl<P: Params> Node<P> for Tprim {
1941     fn accept<'node>(
1942         &'node self,
1943         c: &mut P::Context,
1944         v: &mut dyn Visitor<'node, P = P>,
1945     ) -> Result<(), P::Error> {
1946         v.visit_tprim(c, self)
1947     }
1948     fn recurse<'node>(
1949         &'node self,
1950         c: &mut P::Context,
1951         v: &mut dyn Visitor<'node, P = P>,
1952     ) -> Result<(), P::Error> {
1953         match self {
1954             Tprim::Tnull => Ok(()),
1955             Tprim::Tvoid => Ok(()),
1956             Tprim::Tint => Ok(()),
1957             Tprim::Tbool => Ok(()),
1958             Tprim::Tfloat => Ok(()),
1959             Tprim::Tstring => Ok(()),
1960             Tprim::Tresource => Ok(()),
1961             Tprim::Tnum => Ok(()),
1962             Tprim::Tarraykey => Ok(()),
1963             Tprim::Tnoreturn => Ok(()),
1964         }
1965     }
1967 impl<P: Params> Node<P> for TypeHint<P::Ex> {
1968     fn accept<'node>(
1969         &'node self,
1970         c: &mut P::Context,
1971         v: &mut dyn Visitor<'node, P = P>,
1972     ) -> Result<(), P::Error> {
1973         v.visit_type_hint(c, self)
1974     }
1975     fn recurse<'node>(
1976         &'node self,
1977         c: &mut P::Context,
1978         v: &mut dyn Visitor<'node, P = P>,
1979     ) -> Result<(), P::Error> {
1980         v.visit_ex(c, &self.0)?;
1981         self.1.accept(c, v)?;
1982         Ok(())
1983     }
1985 impl<P: Params> Node<P> for Typedef<P::Ex, P::En> {
1986     fn accept<'node>(
1987         &'node self,
1988         c: &mut P::Context,
1989         v: &mut dyn Visitor<'node, P = P>,
1990     ) -> Result<(), P::Error> {
1991         v.visit_typedef(c, self)
1992     }
1993     fn recurse<'node>(
1994         &'node self,
1995         c: &mut P::Context,
1996         v: &mut dyn Visitor<'node, P = P>,
1997     ) -> Result<(), P::Error> {
1998         v.visit_en(c, &self.annotation)?;
1999         self.name.accept(c, v)?;
2000         self.tparams.accept(c, v)?;
2001         self.constraint.accept(c, v)?;
2002         self.kind.accept(c, v)?;
2003         self.user_attributes.accept(c, v)?;
2004         self.file_attributes.accept(c, v)?;
2005         self.mode.accept(c, v)?;
2006         self.vis.accept(c, v)?;
2007         self.namespace.accept(c, v)?;
2008         self.span.accept(c, v)?;
2009         self.emit_id.accept(c, v)?;
2010         self.is_ctx.accept(c, v)?;
2011         Ok(())
2012     }
2014 impl<P: Params> Node<P> for TypedefVisibility {
2015     fn accept<'node>(
2016         &'node self,
2017         c: &mut P::Context,
2018         v: &mut dyn Visitor<'node, P = P>,
2019     ) -> Result<(), P::Error> {
2020         v.visit_typedef_visibility(c, self)
2021     }
2022     fn recurse<'node>(
2023         &'node self,
2024         c: &mut P::Context,
2025         v: &mut dyn Visitor<'node, P = P>,
2026     ) -> Result<(), P::Error> {
2027         match self {
2028             TypedefVisibility::Transparent => Ok(()),
2029             TypedefVisibility::Opaque => Ok(()),
2030             TypedefVisibility::Tinternal => Ok(()),
2031         }
2032     }
2034 impl<P: Params> Node<P> for Uop {
2035     fn accept<'node>(
2036         &'node self,
2037         c: &mut P::Context,
2038         v: &mut dyn Visitor<'node, P = P>,
2039     ) -> Result<(), P::Error> {
2040         v.visit_uop(c, self)
2041     }
2042     fn recurse<'node>(
2043         &'node self,
2044         c: &mut P::Context,
2045         v: &mut dyn Visitor<'node, P = P>,
2046     ) -> Result<(), P::Error> {
2047         match self {
2048             Uop::Utild => Ok(()),
2049             Uop::Unot => Ok(()),
2050             Uop::Uplus => Ok(()),
2051             Uop::Uminus => Ok(()),
2052             Uop::Uincr => Ok(()),
2053             Uop::Udecr => Ok(()),
2054             Uop::Upincr => Ok(()),
2055             Uop::Updecr => Ok(()),
2056             Uop::Usilence => Ok(()),
2057         }
2058     }
2060 impl<P: Params> Node<P> for UseAsAlias {
2061     fn accept<'node>(
2062         &'node self,
2063         c: &mut P::Context,
2064         v: &mut dyn Visitor<'node, P = P>,
2065     ) -> Result<(), P::Error> {
2066         v.visit_use_as_alias(c, self)
2067     }
2068     fn recurse<'node>(
2069         &'node self,
2070         c: &mut P::Context,
2071         v: &mut dyn Visitor<'node, P = P>,
2072     ) -> Result<(), P::Error> {
2073         self.0.accept(c, v)?;
2074         self.1.accept(c, v)?;
2075         self.2.accept(c, v)?;
2076         self.3.accept(c, v)?;
2077         Ok(())
2078     }
2080 impl<P: Params> Node<P> for UseAsVisibility {
2081     fn accept<'node>(
2082         &'node self,
2083         c: &mut P::Context,
2084         v: &mut dyn Visitor<'node, P = P>,
2085     ) -> Result<(), P::Error> {
2086         v.visit_use_as_visibility(c, self)
2087     }
2088     fn recurse<'node>(
2089         &'node self,
2090         c: &mut P::Context,
2091         v: &mut dyn Visitor<'node, P = P>,
2092     ) -> Result<(), P::Error> {
2093         match self {
2094             UseAsVisibility::UseAsPublic => Ok(()),
2095             UseAsVisibility::UseAsPrivate => Ok(()),
2096             UseAsVisibility::UseAsProtected => Ok(()),
2097             UseAsVisibility::UseAsFinal => Ok(()),
2098         }
2099     }
2101 impl<P: Params> Node<P> for UserAttribute<P::Ex, P::En> {
2102     fn accept<'node>(
2103         &'node self,
2104         c: &mut P::Context,
2105         v: &mut dyn Visitor<'node, P = P>,
2106     ) -> Result<(), P::Error> {
2107         v.visit_user_attribute(c, self)
2108     }
2109     fn recurse<'node>(
2110         &'node self,
2111         c: &mut P::Context,
2112         v: &mut dyn Visitor<'node, P = P>,
2113     ) -> Result<(), P::Error> {
2114         self.name.accept(c, v)?;
2115         self.params.accept(c, v)?;
2116         Ok(())
2117     }
2119 impl<P: Params> Node<P> for UsingStmt<P::Ex, P::En> {
2120     fn accept<'node>(
2121         &'node self,
2122         c: &mut P::Context,
2123         v: &mut dyn Visitor<'node, P = P>,
2124     ) -> Result<(), P::Error> {
2125         v.visit_using_stmt(c, self)
2126     }
2127     fn recurse<'node>(
2128         &'node self,
2129         c: &mut P::Context,
2130         v: &mut dyn Visitor<'node, P = P>,
2131     ) -> Result<(), P::Error> {
2132         self.is_block_scoped.accept(c, v)?;
2133         self.has_await.accept(c, v)?;
2134         self.exprs.accept(c, v)?;
2135         self.block.accept(c, v)?;
2136         Ok(())
2137     }
2139 impl<P: Params> Node<P> for Variance {
2140     fn accept<'node>(
2141         &'node self,
2142         c: &mut P::Context,
2143         v: &mut dyn Visitor<'node, P = P>,
2144     ) -> Result<(), P::Error> {
2145         v.visit_variance(c, self)
2146     }
2147     fn recurse<'node>(
2148         &'node self,
2149         c: &mut P::Context,
2150         v: &mut dyn Visitor<'node, P = P>,
2151     ) -> Result<(), P::Error> {
2152         match self {
2153             Variance::Covariant => Ok(()),
2154             Variance::Contravariant => Ok(()),
2155             Variance::Invariant => Ok(()),
2156         }
2157     }
2159 impl<P: Params> Node<P> for VcKind {
2160     fn accept<'node>(
2161         &'node self,
2162         c: &mut P::Context,
2163         v: &mut dyn Visitor<'node, P = P>,
2164     ) -> Result<(), P::Error> {
2165         v.visit_vc_kind(c, self)
2166     }
2167     fn recurse<'node>(
2168         &'node self,
2169         c: &mut P::Context,
2170         v: &mut dyn Visitor<'node, P = P>,
2171     ) -> Result<(), P::Error> {
2172         match self {
2173             VcKind::Vector => Ok(()),
2174             VcKind::ImmVector => Ok(()),
2175             VcKind::Vec => Ok(()),
2176             VcKind::Set => Ok(()),
2177             VcKind::ImmSet => Ok(()),
2178             VcKind::Keyset => Ok(()),
2179         }
2180     }
2182 impl<P: Params> Node<P> for Visibility {
2183     fn accept<'node>(
2184         &'node self,
2185         c: &mut P::Context,
2186         v: &mut dyn Visitor<'node, P = P>,
2187     ) -> Result<(), P::Error> {
2188         v.visit_visibility(c, self)
2189     }
2190     fn recurse<'node>(
2191         &'node self,
2192         c: &mut P::Context,
2193         v: &mut dyn Visitor<'node, P = P>,
2194     ) -> Result<(), P::Error> {
2195         match self {
2196             Visibility::Private => Ok(()),
2197             Visibility::Public => Ok(()),
2198             Visibility::Protected => Ok(()),
2199             Visibility::Internal => Ok(()),
2200         }
2201     }
2203 impl<P: Params> Node<P> for WhereConstraintHint {
2204     fn accept<'node>(
2205         &'node self,
2206         c: &mut P::Context,
2207         v: &mut dyn Visitor<'node, P = P>,
2208     ) -> Result<(), P::Error> {
2209         v.visit_where_constraint_hint(c, self)
2210     }
2211     fn recurse<'node>(
2212         &'node self,
2213         c: &mut P::Context,
2214         v: &mut dyn Visitor<'node, P = P>,
2215     ) -> Result<(), P::Error> {
2216         self.0.accept(c, v)?;
2217         self.1.accept(c, v)?;
2218         self.2.accept(c, v)?;
2219         Ok(())
2220     }
2222 impl<P: Params> Node<P> for XhpAttr<P::Ex, P::En> {
2223     fn accept<'node>(
2224         &'node self,
2225         c: &mut P::Context,
2226         v: &mut dyn Visitor<'node, P = P>,
2227     ) -> Result<(), P::Error> {
2228         v.visit_xhp_attr(c, self)
2229     }
2230     fn recurse<'node>(
2231         &'node self,
2232         c: &mut P::Context,
2233         v: &mut dyn Visitor<'node, P = P>,
2234     ) -> Result<(), P::Error> {
2235         self.0.accept(c, v)?;
2236         self.1.accept(c, v)?;
2237         self.2.accept(c, v)?;
2238         self.3.accept(c, v)?;
2239         Ok(())
2240     }
2242 impl<P: Params> Node<P> for XhpAttrInfo {
2243     fn accept<'node>(
2244         &'node self,
2245         c: &mut P::Context,
2246         v: &mut dyn Visitor<'node, P = P>,
2247     ) -> Result<(), P::Error> {
2248         v.visit_xhp_attr_info(c, self)
2249     }
2250     fn recurse<'node>(
2251         &'node self,
2252         c: &mut P::Context,
2253         v: &mut dyn Visitor<'node, P = P>,
2254     ) -> Result<(), P::Error> {
2255         self.like.accept(c, v)?;
2256         self.tag.accept(c, v)?;
2257         self.enum_values.accept(c, v)?;
2258         Ok(())
2259     }
2261 impl<P: Params> Node<P> for XhpAttrTag {
2262     fn accept<'node>(
2263         &'node self,
2264         c: &mut P::Context,
2265         v: &mut dyn Visitor<'node, P = P>,
2266     ) -> Result<(), P::Error> {
2267         v.visit_xhp_attr_tag(c, self)
2268     }
2269     fn recurse<'node>(
2270         &'node self,
2271         c: &mut P::Context,
2272         v: &mut dyn Visitor<'node, P = P>,
2273     ) -> Result<(), P::Error> {
2274         match self {
2275             XhpAttrTag::Required => Ok(()),
2276             XhpAttrTag::LateInit => Ok(()),
2277         }
2278     }
2280 impl<P: Params> Node<P> for XhpAttribute<P::Ex, P::En> {
2281     fn accept<'node>(
2282         &'node self,
2283         c: &mut P::Context,
2284         v: &mut dyn Visitor<'node, P = P>,
2285     ) -> Result<(), P::Error> {
2286         v.visit_xhp_attribute(c, self)
2287     }
2288     fn recurse<'node>(
2289         &'node self,
2290         c: &mut P::Context,
2291         v: &mut dyn Visitor<'node, P = P>,
2292     ) -> Result<(), P::Error> {
2293         match self {
2294             XhpAttribute::XhpSimple(a0) => {
2295                 a0.accept(c, v)?;
2296                 Ok(())
2297             }
2298             XhpAttribute::XhpSpread(a0) => {
2299                 a0.accept(c, v)?;
2300                 Ok(())
2301             }
2302         }
2303     }
2305 impl<P: Params> Node<P> for XhpChild {
2306     fn accept<'node>(
2307         &'node self,
2308         c: &mut P::Context,
2309         v: &mut dyn Visitor<'node, P = P>,
2310     ) -> Result<(), P::Error> {
2311         v.visit_xhp_child(c, self)
2312     }
2313     fn recurse<'node>(
2314         &'node self,
2315         c: &mut P::Context,
2316         v: &mut dyn Visitor<'node, P = P>,
2317     ) -> Result<(), P::Error> {
2318         match self {
2319             XhpChild::ChildName(a0) => {
2320                 a0.accept(c, v)?;
2321                 Ok(())
2322             }
2323             XhpChild::ChildList(a0) => {
2324                 a0.accept(c, v)?;
2325                 Ok(())
2326             }
2327             XhpChild::ChildUnary(a0, a1) => {
2328                 a0.accept(c, v)?;
2329                 a1.accept(c, v)?;
2330                 Ok(())
2331             }
2332             XhpChild::ChildBinary(a0, a1) => {
2333                 a0.accept(c, v)?;
2334                 a1.accept(c, v)?;
2335                 Ok(())
2336             }
2337         }
2338     }
2340 impl<P: Params> Node<P> for XhpChildOp {
2341     fn accept<'node>(
2342         &'node self,
2343         c: &mut P::Context,
2344         v: &mut dyn Visitor<'node, P = P>,
2345     ) -> Result<(), P::Error> {
2346         v.visit_xhp_child_op(c, self)
2347     }
2348     fn recurse<'node>(
2349         &'node self,
2350         c: &mut P::Context,
2351         v: &mut dyn Visitor<'node, P = P>,
2352     ) -> Result<(), P::Error> {
2353         match self {
2354             XhpChildOp::ChildStar => Ok(()),
2355             XhpChildOp::ChildPlus => Ok(()),
2356             XhpChildOp::ChildQuestion => Ok(()),
2357         }
2358     }
2360 impl<P: Params> Node<P> for XhpEnumValue {
2361     fn accept<'node>(
2362         &'node self,
2363         c: &mut P::Context,
2364         v: &mut dyn Visitor<'node, P = P>,
2365     ) -> Result<(), P::Error> {
2366         v.visit_xhp_enum_value(c, self)
2367     }
2368     fn recurse<'node>(
2369         &'node self,
2370         c: &mut P::Context,
2371         v: &mut dyn Visitor<'node, P = P>,
2372     ) -> Result<(), P::Error> {
2373         match self {
2374             XhpEnumValue::XEVInt(a0) => {
2375                 a0.accept(c, v)?;
2376                 Ok(())
2377             }
2378             XhpEnumValue::XEVString(a0) => {
2379                 a0.accept(c, v)?;
2380                 Ok(())
2381             }
2382         }
2383     }
2385 impl<P: Params> Node<P> for XhpSimple<P::Ex, P::En> {
2386     fn accept<'node>(
2387         &'node self,
2388         c: &mut P::Context,
2389         v: &mut dyn Visitor<'node, P = P>,
2390     ) -> Result<(), P::Error> {
2391         v.visit_xhp_simple(c, self)
2392     }
2393     fn recurse<'node>(
2394         &'node self,
2395         c: &mut P::Context,
2396         v: &mut dyn Visitor<'node, P = P>,
2397     ) -> Result<(), P::Error> {
2398         self.name.accept(c, v)?;
2399         v.visit_ex(c, &self.type_)?;
2400         self.expr.accept(c, v)?;
2401         Ok(())
2402     }