1 // Copyright (c) Facebook, Inc. and its affiliates.
3 // This source code is licensed under the MIT license found in the
4 // LICENSE file in the "hack" directory of this source tree.
6 // @generated SignedSource<<4ec9c84faa72364739b6d84c4b2549e8>>
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 {
20 v: &mut dyn Visitor<'node, P = P>,
21 ) -> Result<(), P::Error> {
22 v.visit_abstraction(c, self)
27 v: &mut dyn Visitor<'node, P = P>,
28 ) -> Result<(), P::Error> {
30 Abstraction::Concrete => Ok(()),
31 Abstraction::Abstract => Ok(()),
35 impl<P: Params> Node<P> for Afield<P::Ex, P::En> {
39 v: &mut dyn Visitor<'node, P = P>,
40 ) -> Result<(), P::Error> {
41 v.visit_afield(c, self)
46 v: &mut dyn Visitor<'node, P = P>,
47 ) -> Result<(), P::Error> {
49 Afield::AFvalue(a0) => {
53 Afield::AFkvalue(a0, a1) => {
61 impl<P: Params> Node<P> for AsExpr<P::Ex, P::En> {
65 v: &mut dyn Visitor<'node, P = P>,
66 ) -> Result<(), P::Error> {
67 v.visit_as_expr(c, self)
72 v: &mut dyn Visitor<'node, P = P>,
73 ) -> Result<(), P::Error> {
79 AsExpr::AsKv(a0, a1) => {
84 AsExpr::AwaitAsV(a0, a1) => {
89 AsExpr::AwaitAsKv(a0, a1, a2) => {
98 impl<P: Params> Node<P> for Bop {
102 v: &mut dyn Visitor<'node, P = P>,
103 ) -> Result<(), P::Error> {
109 v: &mut dyn Visitor<'node, P = P>,
110 ) -> Result<(), P::Error> {
113 Bop::Minus => Ok(()),
115 Bop::Slash => Ok(()),
117 Bop::Eqeqeq => Ok(()),
118 Bop::Starstar => Ok(()),
120 Bop::Diff2 => Ok(()),
121 Bop::Ampamp => Ok(()),
122 Bop::Barbar => Ok(()),
132 Bop::Percent => Ok(()),
135 Bop::QuestionQuestion => Ok(()),
143 impl<P: Params> Node<P> for CaField<P::Ex, P::En> {
147 v: &mut dyn Visitor<'node, P = P>,
148 ) -> Result<(), P::Error> {
149 v.visit_ca_field(c, self)
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)?;
163 impl<P: Params> Node<P> for CaType {
167 v: &mut dyn Visitor<'node, P = P>,
168 ) -> Result<(), P::Error> {
169 v.visit_ca_type(c, self)
174 v: &mut dyn Visitor<'node, P = P>,
175 ) -> Result<(), P::Error> {
177 CaType::CAHint(a0) => {
181 CaType::CAEnum(a0) => {
188 impl<P: Params> Node<P> for Case<P::Ex, P::En> {
192 v: &mut dyn Visitor<'node, P = P>,
193 ) -> Result<(), P::Error> {
194 v.visit_case(c, self)
199 v: &mut dyn Visitor<'node, P = P>,
200 ) -> Result<(), P::Error> {
202 Case::Default(a0, a1) => {
207 Case::Case(a0, a1) => {
215 impl<P: Params> Node<P> for Catch<P::Ex, P::En> {
219 v: &mut dyn Visitor<'node, P = P>,
220 ) -> Result<(), P::Error> {
221 v.visit_catch(c, self)
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)?;
234 impl<P: Params> Node<P> for ClassAbstractTypeconst {
238 v: &mut dyn Visitor<'node, P = P>,
239 ) -> Result<(), P::Error> {
240 v.visit_class_abstract_typeconst(c, self)
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)?;
253 impl<P: Params> Node<P> for ClassAttr<P::Ex, P::En> {
257 v: &mut dyn Visitor<'node, P = P>,
258 ) -> Result<(), P::Error> {
259 v.visit_class_attr(c, self)
264 v: &mut dyn Visitor<'node, P = P>,
265 ) -> Result<(), P::Error> {
267 ClassAttr::CAName(a0) => {
271 ClassAttr::CAField(a0) => {
278 impl<P: Params> Node<P> for ClassConcreteTypeconst {
282 v: &mut dyn Visitor<'node, P = P>,
283 ) -> Result<(), P::Error> {
284 v.visit_class_concrete_typeconst(c, self)
289 v: &mut dyn Visitor<'node, P = P>,
290 ) -> Result<(), P::Error> {
291 self.c_tc_type.accept(c, v)?;
295 impl<P: Params> Node<P> for ClassConst<P::Ex, P::En> {
299 v: &mut dyn Visitor<'node, P = P>,
300 ) -> Result<(), P::Error> {
301 v.visit_class_const(c, self)
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)?;
316 impl<P: Params> Node<P> for ClassConstKind<P::Ex, P::En> {
320 v: &mut dyn Visitor<'node, P = P>,
321 ) -> Result<(), P::Error> {
322 v.visit_class_const_kind(c, self)
327 v: &mut dyn Visitor<'node, P = P>,
328 ) -> Result<(), P::Error> {
330 ClassConstKind::CCAbstract(a0) => {
334 ClassConstKind::CCConcrete(a0) => {
341 impl<P: Params> Node<P> for ClassGetExpr<P::Ex, P::En> {
345 v: &mut dyn Visitor<'node, P = P>,
346 ) -> Result<(), P::Error> {
347 v.visit_class_get_expr(c, self)
352 v: &mut dyn Visitor<'node, P = P>,
353 ) -> Result<(), P::Error> {
355 ClassGetExpr::CGstring(a0) => {
359 ClassGetExpr::CGexpr(a0) => {
366 impl<P: Params> Node<P> for ClassId<P::Ex, P::En> {
370 v: &mut dyn Visitor<'node, P = P>,
371 ) -> Result<(), P::Error> {
372 v.visit_class_id(c, self)
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)?;
385 impl<P: Params> Node<P> for ClassId_<P::Ex, P::En> {
389 v: &mut dyn Visitor<'node, P = P>,
390 ) -> Result<(), P::Error> {
391 v.visit_class_id_(c, self)
396 v: &mut dyn Visitor<'node, P = P>,
397 ) -> Result<(), P::Error> {
399 ClassId_::CIparent => Ok(()),
400 ClassId_::CIself => Ok(()),
401 ClassId_::CIstatic => Ok(()),
402 ClassId_::CIexpr(a0) => {
406 ClassId_::CI(a0) => {
413 impl<P: Params> Node<P> for ClassTypeconst {
417 v: &mut dyn Visitor<'node, P = P>,
418 ) -> Result<(), P::Error> {
419 v.visit_class_typeconst(c, self)
424 v: &mut dyn Visitor<'node, P = P>,
425 ) -> Result<(), P::Error> {
427 ClassTypeconst::TCAbstract(a0) => {
431 ClassTypeconst::TCConcrete(a0) => {
438 impl<P: Params> Node<P> for ClassTypeconstDef<P::Ex, P::En> {
442 v: &mut dyn Visitor<'node, P = P>,
443 ) -> Result<(), P::Error> {
444 v.visit_class_typeconst_def(c, self)
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)?;
460 impl<P: Params> Node<P> for ClassVar<P::Ex, P::En> {
464 v: &mut dyn Visitor<'node, P = P>,
465 ) -> Result<(), P::Error> {
466 v.visit_class_var(c, self)
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)?;
489 impl<P: Params> Node<P> for Class_<P::Ex, P::En> {
493 v: &mut dyn Visitor<'node, P = P>,
494 ) -> Result<(), P::Error> {
495 v.visit_class_(c, self)
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)?;
536 impl<P: Params> Node<P> for ClassishKind {
540 v: &mut dyn Visitor<'node, P = P>,
541 ) -> Result<(), P::Error> {
542 v.visit_classish_kind(c, self)
547 v: &mut dyn Visitor<'node, P = P>,
548 ) -> Result<(), P::Error> {
550 ClassishKind::Cclass(a0) => {
554 ClassishKind::Cinterface => Ok(()),
555 ClassishKind::Ctrait => Ok(()),
556 ClassishKind::Cenum => Ok(()),
557 ClassishKind::CenumClass(a0) => {
564 impl<P: Params> Node<P> for CollectionTarg<P::Ex> {
568 v: &mut dyn Visitor<'node, P = P>,
569 ) -> Result<(), P::Error> {
570 v.visit_collection_targ(c, self)
575 v: &mut dyn Visitor<'node, P = P>,
576 ) -> Result<(), P::Error> {
578 CollectionTarg::CollectionTV(a0) => {
582 CollectionTarg::CollectionTKV(a0, a1) => {
590 impl<P: Params> Node<P> for ConstraintKind {
594 v: &mut dyn Visitor<'node, P = P>,
595 ) -> Result<(), P::Error> {
596 v.visit_constraint_kind(c, self)
601 v: &mut dyn Visitor<'node, P = P>,
602 ) -> Result<(), P::Error> {
604 ConstraintKind::ConstraintAs => Ok(()),
605 ConstraintKind::ConstraintEq => Ok(()),
606 ConstraintKind::ConstraintSuper => Ok(()),
610 impl<P: Params> Node<P> for Contexts {
614 v: &mut dyn Visitor<'node, P = P>,
615 ) -> Result<(), P::Error> {
616 v.visit_contexts(c, self)
621 v: &mut dyn Visitor<'node, P = P>,
622 ) -> Result<(), P::Error> {
623 self.0.accept(c, v)?;
624 self.1.accept(c, v)?;
628 impl<P: Params> Node<P> for Def<P::Ex, P::En> {
632 v: &mut dyn Visitor<'node, P = P>,
633 ) -> Result<(), P::Error> {
639 v: &mut dyn Visitor<'node, P = P>,
640 ) -> Result<(), P::Error> {
654 Def::Typedef(a0) => {
658 Def::Constant(a0) => {
662 Def::Namespace(a) => {
667 Def::NamespaceUse(a0) => {
671 Def::SetNamespaceEnv(a0) => {
675 Def::FileAttributes(a0) => {
682 impl<P: Params> Node<P> for DocComment {
686 v: &mut dyn Visitor<'node, P = P>,
687 ) -> Result<(), P::Error> {
688 v.visit_doc_comment(c, self)
693 v: &mut dyn Visitor<'node, P = P>,
694 ) -> Result<(), P::Error> {
695 self.0.accept(c, v)?;
699 impl<P: Params> Node<P> for EmitId {
703 v: &mut dyn Visitor<'node, P = P>,
704 ) -> Result<(), P::Error> {
705 v.visit_emit_id(c, self)
710 v: &mut dyn Visitor<'node, P = P>,
711 ) -> Result<(), P::Error> {
713 EmitId::EmitId(a0) => {
717 EmitId::Anonymous => Ok(()),
721 impl<P: Params> Node<P> for Enum_ {
725 v: &mut dyn Visitor<'node, P = P>,
726 ) -> Result<(), P::Error> {
727 v.visit_enum_(c, self)
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)?;
740 impl<P: Params> Node<P> for EnvAnnot {
744 v: &mut dyn Visitor<'node, P = P>,
745 ) -> Result<(), P::Error> {
746 v.visit_env_annot(c, self)
751 v: &mut dyn Visitor<'node, P = P>,
752 ) -> Result<(), P::Error> {
754 EnvAnnot::Join => Ok(()),
755 EnvAnnot::Refinement => Ok(()),
759 impl<P: Params> Node<P> for Expr<P::Ex, P::En> {
763 v: &mut dyn Visitor<'node, P = P>,
764 ) -> Result<(), P::Error> {
765 v.visit_expr(c, self)
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)?;
778 impl<P: Params> Node<P> for Expr_<P::Ex, P::En> {
782 v: &mut dyn Visitor<'node, P = P>,
783 ) -> Result<(), P::Error> {
784 v.visit_expr_(c, self)
789 v: &mut dyn Visitor<'node, P = P>,
790 ) -> Result<(), P::Error> {
792 Expr_::Darray(a) => {
797 Expr_::Varray(a) => {
802 Expr_::Shape(a0) => {
806 Expr_::ValCollection(a) => {
812 Expr_::KeyValCollection(a) => {
818 Expr_::Null => Ok(()),
819 Expr_::This => Ok(()),
820 Expr_::True => Ok(()),
821 Expr_::False => Ok(()),
822 Expr_::Omitted => Ok(()),
831 Expr_::Dollardollar(a0) => {
835 Expr_::Clone(a0) => {
839 Expr_::ArrayGet(a) => {
844 Expr_::ObjGet(a) => {
851 Expr_::ClassGet(a) => {
857 Expr_::ClassConst(a) => {
869 Expr_::FunctionPointer(a) => {
878 Expr_::Float(a0) => {
882 Expr_::String(a0) => {
886 Expr_::String2(a0) => {
890 Expr_::PrefixedString(a) => {
895 Expr_::Yield(a0) => {
899 Expr_::Await(a0) => {
903 Expr_::ReadonlyExpr(a0) => {
907 Expr_::Tuple(a0) => {
954 Expr_::Upcast(a) => {
964 v.visit_ex(c, &a.4)?;
983 Expr_::Import(a) => {
988 Expr_::Collection(a) => {
994 Expr_::ExpressionTree(a0) => {
998 Expr_::Lplaceholder(a0) => {
1002 Expr_::FunId(a0) => {
1006 Expr_::MethodId(a) => {
1011 Expr_::MethodCaller(a) => {
1016 Expr_::SmethodId(a) => {
1027 Expr_::ETSplice(a0) => {
1031 Expr_::EnumClassLabel(a) => {
1038 v.visit_ex(c, &a.1)?;
1039 v.visit_ex(c, &a.2)?;
1046 impl<P: Params> Node<P> for ExpressionTree<P::Ex, P::En> {
1050 v: &mut dyn Visitor<'node, P = P>,
1051 ) -> Result<(), P::Error> {
1052 v.visit_expression_tree(c, self)
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)?;
1068 impl<P: Params> Node<P> for Field<P::Ex, P::En> {
1072 v: &mut dyn Visitor<'node, P = P>,
1073 ) -> Result<(), P::Error> {
1074 v.visit_field(c, self)
1079 v: &mut dyn Visitor<'node, P = P>,
1080 ) -> Result<(), P::Error> {
1081 self.0.accept(c, v)?;
1082 self.1.accept(c, v)?;
1086 impl<P: Params> Node<P> for FileAttribute<P::Ex, P::En> {
1090 v: &mut dyn Visitor<'node, P = P>,
1091 ) -> Result<(), P::Error> {
1092 v.visit_file_attribute(c, self)
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)?;
1104 impl<P: Params> Node<P> for FunDef<P::Ex, P::En> {
1108 v: &mut dyn Visitor<'node, P = P>,
1109 ) -> Result<(), P::Error> {
1110 v.visit_fun_def(c, self)
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)?;
1124 impl<P: Params> Node<P> for FunKind {
1128 v: &mut dyn Visitor<'node, P = P>,
1129 ) -> Result<(), P::Error> {
1130 v.visit_fun_kind(c, self)
1135 v: &mut dyn Visitor<'node, P = P>,
1136 ) -> Result<(), P::Error> {
1138 FunKind::FSync => Ok(()),
1139 FunKind::FAsync => Ok(()),
1140 FunKind::FGenerator => Ok(()),
1141 FunKind::FAsyncGenerator => Ok(()),
1145 impl<P: Params> Node<P> for FunParam<P::Ex, P::En> {
1149 v: &mut dyn Visitor<'node, P = P>,
1150 ) -> Result<(), P::Error> {
1151 v.visit_fun_param(c, self)
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)?;
1171 impl<P: Params> Node<P> for FunVariadicity<P::Ex, P::En> {
1175 v: &mut dyn Visitor<'node, P = P>,
1176 ) -> Result<(), P::Error> {
1177 v.visit_fun_variadicity(c, self)
1182 v: &mut dyn Visitor<'node, P = P>,
1183 ) -> Result<(), P::Error> {
1185 FunVariadicity::FVvariadicArg(a0) => {
1189 FunVariadicity::FVnonVariadic => Ok(()),
1193 impl<P: Params> Node<P> for Fun_<P::Ex, P::En> {
1197 v: &mut dyn Visitor<'node, P = P>,
1198 ) -> Result<(), P::Error> {
1199 v.visit_fun_(c, self)
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)?;
1226 impl<P: Params> Node<P> for FuncBody<P::Ex, P::En> {
1230 v: &mut dyn Visitor<'node, P = P>,
1231 ) -> Result<(), P::Error> {
1232 v.visit_func_body(c, self)
1237 v: &mut dyn Visitor<'node, P = P>,
1238 ) -> Result<(), P::Error> {
1239 self.fb_ast.accept(c, v)?;
1243 impl<P: Params> Node<P> for FunctionPtrId<P::Ex, P::En> {
1247 v: &mut dyn Visitor<'node, P = P>,
1248 ) -> Result<(), P::Error> {
1249 v.visit_function_ptr_id(c, self)
1254 v: &mut dyn Visitor<'node, P = P>,
1255 ) -> Result<(), P::Error> {
1257 FunctionPtrId::FPId(a0) => {
1261 FunctionPtrId::FPClassConst(a0, a1) => {
1269 impl<P: Params> Node<P> for Gconst<P::Ex, P::En> {
1273 v: &mut dyn Visitor<'node, P = P>,
1274 ) -> Result<(), P::Error> {
1275 v.visit_gconst(c, self)
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)?;
1293 impl<P: Params> Node<P> for HfParamInfo {
1297 v: &mut dyn Visitor<'node, P = P>,
1298 ) -> Result<(), P::Error> {
1299 v.visit_hf_param_info(c, self)
1304 v: &mut dyn Visitor<'node, P = P>,
1305 ) -> Result<(), P::Error> {
1306 self.kind.accept(c, v)?;
1307 self.readonlyness.accept(c, v)?;
1311 impl<P: Params> Node<P> for Hint {
1315 v: &mut dyn Visitor<'node, P = P>,
1316 ) -> Result<(), P::Error> {
1317 v.visit_hint(c, self)
1322 v: &mut dyn Visitor<'node, P = P>,
1323 ) -> Result<(), P::Error> {
1324 self.0.accept(c, v)?;
1325 self.1.accept(c, v)?;
1329 impl<P: Params> Node<P> for HintFun {
1333 v: &mut dyn Visitor<'node, P = P>,
1334 ) -> Result<(), P::Error> {
1335 v.visit_hint_fun(c, self)
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)?;
1352 impl<P: Params> Node<P> for Hint_ {
1356 v: &mut dyn Visitor<'node, P = P>,
1357 ) -> Result<(), P::Error> {
1358 v.visit_hint_(c, self)
1363 v: &mut dyn Visitor<'node, P = P>,
1364 ) -> Result<(), P::Error> {
1366 Hint_::Hoption(a0) => {
1370 Hint_::Hlike(a0) => {
1374 Hint_::Hfun(a0) => {
1378 Hint_::Htuple(a0) => {
1382 Hint_::Happly(a0, a1) => {
1387 Hint_::Hshape(a0) => {
1391 Hint_::Haccess(a0, a1) => {
1396 Hint_::Hsoft(a0) => {
1400 Hint_::Hany => Ok(()),
1401 Hint_::Herr => Ok(()),
1402 Hint_::Hmixed => Ok(()),
1403 Hint_::Hnonnull => Ok(()),
1404 Hint_::Habstr(a0, a1) => {
1409 Hint_::HvecOrDict(a0, a1) => {
1414 Hint_::Hprim(a0) => {
1418 Hint_::Hthis => Ok(()),
1419 Hint_::Hdynamic => Ok(()),
1420 Hint_::Hnothing => Ok(()),
1421 Hint_::Hunion(a0) => {
1425 Hint_::Hintersection(a0) => {
1429 Hint_::HfunContext(a0) => {
1433 Hint_::Hvar(a0) => {
1440 impl<P: Params> Node<P> for HoleSource {
1444 v: &mut dyn Visitor<'node, P = P>,
1445 ) -> Result<(), P::Error> {
1446 v.visit_hole_source(c, self)
1451 v: &mut dyn Visitor<'node, P = P>,
1452 ) -> Result<(), P::Error> {
1454 HoleSource::Typing => Ok(()),
1455 HoleSource::UnsafeCast(a0) => {
1459 HoleSource::EnforcedCast(a0) => {
1466 impl<P: Params> Node<P> for Id {
1470 v: &mut dyn Visitor<'node, P = P>,
1471 ) -> Result<(), P::Error> {
1477 v: &mut dyn Visitor<'node, P = P>,
1478 ) -> Result<(), P::Error> {
1479 self.0.accept(c, v)?;
1480 self.1.accept(c, v)?;
1484 impl<P: Params> Node<P> for ImportFlavor {
1488 v: &mut dyn Visitor<'node, P = P>,
1489 ) -> Result<(), P::Error> {
1490 v.visit_import_flavor(c, self)
1495 v: &mut dyn Visitor<'node, P = P>,
1496 ) -> Result<(), P::Error> {
1498 ImportFlavor::Include => Ok(()),
1499 ImportFlavor::Require => Ok(()),
1500 ImportFlavor::IncludeOnce => Ok(()),
1501 ImportFlavor::RequireOnce => Ok(()),
1505 impl<P: Params> Node<P> for InsteadofAlias {
1509 v: &mut dyn Visitor<'node, P = P>,
1510 ) -> Result<(), P::Error> {
1511 v.visit_insteadof_alias(c, self)
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)?;
1524 impl<P: Params> Node<P> for KvcKind {
1528 v: &mut dyn Visitor<'node, P = P>,
1529 ) -> Result<(), P::Error> {
1530 v.visit_kvc_kind(c, self)
1535 v: &mut dyn Visitor<'node, P = P>,
1536 ) -> Result<(), P::Error> {
1538 KvcKind::Map => Ok(()),
1539 KvcKind::ImmMap => Ok(()),
1540 KvcKind::Dict => Ok(()),
1544 impl<P: Params> Node<P> for Lid {
1548 v: &mut dyn Visitor<'node, P = P>,
1549 ) -> Result<(), P::Error> {
1550 v.visit_lid(c, self)
1555 v: &mut dyn Visitor<'node, P = P>,
1556 ) -> Result<(), P::Error> {
1557 self.0.accept(c, v)?;
1558 self.1.accept(c, v)?;
1562 impl<P: Params> Node<P> for Method_<P::Ex, P::En> {
1566 v: &mut dyn Visitor<'node, P = P>,
1567 ) -> Result<(), P::Error> {
1568 v.visit_method_(c, self)
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)?;
1599 impl<P: Params> Node<P> for NastShapeInfo {
1603 v: &mut dyn Visitor<'node, P = P>,
1604 ) -> Result<(), P::Error> {
1605 v.visit_nast_shape_info(c, self)
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)?;
1617 impl<P: Params> Node<P> for NsKind {
1621 v: &mut dyn Visitor<'node, P = P>,
1622 ) -> Result<(), P::Error> {
1623 v.visit_ns_kind(c, self)
1628 v: &mut dyn Visitor<'node, P = P>,
1629 ) -> Result<(), P::Error> {
1631 NsKind::NSNamespace => Ok(()),
1632 NsKind::NSClass => Ok(()),
1633 NsKind::NSClassAndNamespace => Ok(()),
1634 NsKind::NSFun => Ok(()),
1635 NsKind::NSConst => Ok(()),
1639 impl<P: Params> Node<P> for OgNullFlavor {
1643 v: &mut dyn Visitor<'node, P = P>,
1644 ) -> Result<(), P::Error> {
1645 v.visit_og_null_flavor(c, self)
1650 v: &mut dyn Visitor<'node, P = P>,
1651 ) -> Result<(), P::Error> {
1653 OgNullFlavor::OGNullthrows => Ok(()),
1654 OgNullFlavor::OGNullsafe => Ok(()),
1658 impl<P: Params> Node<P> for ParamKind {
1662 v: &mut dyn Visitor<'node, P = P>,
1663 ) -> Result<(), P::Error> {
1664 v.visit_param_kind(c, self)
1669 v: &mut dyn Visitor<'node, P = P>,
1670 ) -> Result<(), P::Error> {
1672 ParamKind::Pinout(a0) => {
1676 ParamKind::Pnormal => Ok(()),
1680 impl<P: Params> Node<P> for PropOrMethod {
1684 v: &mut dyn Visitor<'node, P = P>,
1685 ) -> Result<(), P::Error> {
1686 v.visit_prop_or_method(c, self)
1691 v: &mut dyn Visitor<'node, P = P>,
1692 ) -> Result<(), P::Error> {
1694 PropOrMethod::IsProp => Ok(()),
1695 PropOrMethod::IsMethod => Ok(()),
1699 impl<P: Params> Node<P> for ReadonlyKind {
1703 v: &mut dyn Visitor<'node, P = P>,
1704 ) -> Result<(), P::Error> {
1705 v.visit_readonly_kind(c, self)
1710 v: &mut dyn Visitor<'node, P = P>,
1711 ) -> Result<(), P::Error> {
1713 ReadonlyKind::Readonly => Ok(()),
1717 impl<P: Params> Node<P> for ReifyKind {
1721 v: &mut dyn Visitor<'node, P = P>,
1722 ) -> Result<(), P::Error> {
1723 v.visit_reify_kind(c, self)
1728 v: &mut dyn Visitor<'node, P = P>,
1729 ) -> Result<(), P::Error> {
1731 ReifyKind::Erased => Ok(()),
1732 ReifyKind::SoftReified => Ok(()),
1733 ReifyKind::Reified => Ok(()),
1737 impl<P: Params> Node<P> for ShapeFieldInfo {
1741 v: &mut dyn Visitor<'node, P = P>,
1742 ) -> Result<(), P::Error> {
1743 v.visit_shape_field_info(c, self)
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)?;
1756 impl<P: Params> Node<P> for ShapeFieldName {
1760 v: &mut dyn Visitor<'node, P = P>,
1761 ) -> Result<(), P::Error> {
1762 v.visit_shape_field_name(c, self)
1767 v: &mut dyn Visitor<'node, P = P>,
1768 ) -> Result<(), P::Error> {
1770 ShapeFieldName::SFlitInt(a0) => {
1774 ShapeFieldName::SFlitStr(a0) => {
1778 ShapeFieldName::SFclassConst(a0, a1) => {
1786 impl<P: Params> Node<P> for Stmt<P::Ex, P::En> {
1790 v: &mut dyn Visitor<'node, P = P>,
1791 ) -> Result<(), P::Error> {
1792 v.visit_stmt(c, self)
1797 v: &mut dyn Visitor<'node, P = P>,
1798 ) -> Result<(), P::Error> {
1799 self.0.accept(c, v)?;
1800 self.1.accept(c, v)?;
1804 impl<P: Params> Node<P> for Stmt_<P::Ex, P::En> {
1808 v: &mut dyn Visitor<'node, P = P>,
1809 ) -> Result<(), P::Error> {
1810 v.visit_stmt_(c, self)
1815 v: &mut dyn Visitor<'node, P = P>,
1816 ) -> Result<(), P::Error> {
1818 Stmt_::Fallthrough => Ok(()),
1819 Stmt_::Expr(a0) => {
1823 Stmt_::Break => Ok(()),
1824 Stmt_::Continue => Ok(()),
1825 Stmt_::Throw(a0) => {
1829 Stmt_::Return(a0) => {
1833 Stmt_::YieldBreak => Ok(()),
1834 Stmt_::Awaitall(a) => {
1850 Stmt_::While(a) => {
1855 Stmt_::Using(a0) => {
1866 Stmt_::Switch(a) => {
1871 Stmt_::Foreach(a) => {
1883 Stmt_::Noop => Ok(()),
1884 Stmt_::Block(a0) => {
1888 Stmt_::Markup(a0) => {
1892 Stmt_::AssertEnv(a) => {
1900 impl<P: Params> Node<P> for Targ<P::Ex> {
1904 v: &mut dyn Visitor<'node, P = P>,
1905 ) -> Result<(), P::Error> {
1906 v.visit_targ(c, self)
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)?;
1918 impl<P: Params> Node<P> for Tparam<P::Ex, P::En> {
1922 v: &mut dyn Visitor<'node, P = P>,
1923 ) -> Result<(), P::Error> {
1924 v.visit_tparam(c, self)
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)?;
1940 impl<P: Params> Node<P> for Tprim {
1944 v: &mut dyn Visitor<'node, P = P>,
1945 ) -> Result<(), P::Error> {
1946 v.visit_tprim(c, self)
1951 v: &mut dyn Visitor<'node, P = P>,
1952 ) -> Result<(), P::Error> {
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(()),
1967 impl<P: Params> Node<P> for TypeHint<P::Ex> {
1971 v: &mut dyn Visitor<'node, P = P>,
1972 ) -> Result<(), P::Error> {
1973 v.visit_type_hint(c, self)
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)?;
1985 impl<P: Params> Node<P> for Typedef<P::Ex, P::En> {
1989 v: &mut dyn Visitor<'node, P = P>,
1990 ) -> Result<(), P::Error> {
1991 v.visit_typedef(c, self)
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)?;
2014 impl<P: Params> Node<P> for TypedefVisibility {
2018 v: &mut dyn Visitor<'node, P = P>,
2019 ) -> Result<(), P::Error> {
2020 v.visit_typedef_visibility(c, self)
2025 v: &mut dyn Visitor<'node, P = P>,
2026 ) -> Result<(), P::Error> {
2028 TypedefVisibility::Transparent => Ok(()),
2029 TypedefVisibility::Opaque => Ok(()),
2030 TypedefVisibility::Tinternal => Ok(()),
2034 impl<P: Params> Node<P> for Uop {
2038 v: &mut dyn Visitor<'node, P = P>,
2039 ) -> Result<(), P::Error> {
2040 v.visit_uop(c, self)
2045 v: &mut dyn Visitor<'node, P = P>,
2046 ) -> Result<(), P::Error> {
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(()),
2060 impl<P: Params> Node<P> for UseAsAlias {
2064 v: &mut dyn Visitor<'node, P = P>,
2065 ) -> Result<(), P::Error> {
2066 v.visit_use_as_alias(c, self)
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)?;
2080 impl<P: Params> Node<P> for UseAsVisibility {
2084 v: &mut dyn Visitor<'node, P = P>,
2085 ) -> Result<(), P::Error> {
2086 v.visit_use_as_visibility(c, self)
2091 v: &mut dyn Visitor<'node, P = P>,
2092 ) -> Result<(), P::Error> {
2094 UseAsVisibility::UseAsPublic => Ok(()),
2095 UseAsVisibility::UseAsPrivate => Ok(()),
2096 UseAsVisibility::UseAsProtected => Ok(()),
2097 UseAsVisibility::UseAsFinal => Ok(()),
2101 impl<P: Params> Node<P> for UserAttribute<P::Ex, P::En> {
2105 v: &mut dyn Visitor<'node, P = P>,
2106 ) -> Result<(), P::Error> {
2107 v.visit_user_attribute(c, self)
2112 v: &mut dyn Visitor<'node, P = P>,
2113 ) -> Result<(), P::Error> {
2114 self.name.accept(c, v)?;
2115 self.params.accept(c, v)?;
2119 impl<P: Params> Node<P> for UsingStmt<P::Ex, P::En> {
2123 v: &mut dyn Visitor<'node, P = P>,
2124 ) -> Result<(), P::Error> {
2125 v.visit_using_stmt(c, self)
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)?;
2139 impl<P: Params> Node<P> for Variance {
2143 v: &mut dyn Visitor<'node, P = P>,
2144 ) -> Result<(), P::Error> {
2145 v.visit_variance(c, self)
2150 v: &mut dyn Visitor<'node, P = P>,
2151 ) -> Result<(), P::Error> {
2153 Variance::Covariant => Ok(()),
2154 Variance::Contravariant => Ok(()),
2155 Variance::Invariant => Ok(()),
2159 impl<P: Params> Node<P> for VcKind {
2163 v: &mut dyn Visitor<'node, P = P>,
2164 ) -> Result<(), P::Error> {
2165 v.visit_vc_kind(c, self)
2170 v: &mut dyn Visitor<'node, P = P>,
2171 ) -> Result<(), P::Error> {
2173 VcKind::Vector => Ok(()),
2174 VcKind::ImmVector => Ok(()),
2175 VcKind::Vec => Ok(()),
2176 VcKind::Set => Ok(()),
2177 VcKind::ImmSet => Ok(()),
2178 VcKind::Keyset => Ok(()),
2182 impl<P: Params> Node<P> for Visibility {
2186 v: &mut dyn Visitor<'node, P = P>,
2187 ) -> Result<(), P::Error> {
2188 v.visit_visibility(c, self)
2193 v: &mut dyn Visitor<'node, P = P>,
2194 ) -> Result<(), P::Error> {
2196 Visibility::Private => Ok(()),
2197 Visibility::Public => Ok(()),
2198 Visibility::Protected => Ok(()),
2199 Visibility::Internal => Ok(()),
2203 impl<P: Params> Node<P> for WhereConstraintHint {
2207 v: &mut dyn Visitor<'node, P = P>,
2208 ) -> Result<(), P::Error> {
2209 v.visit_where_constraint_hint(c, self)
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)?;
2222 impl<P: Params> Node<P> for XhpAttr<P::Ex, P::En> {
2226 v: &mut dyn Visitor<'node, P = P>,
2227 ) -> Result<(), P::Error> {
2228 v.visit_xhp_attr(c, self)
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)?;
2242 impl<P: Params> Node<P> for XhpAttrInfo {
2246 v: &mut dyn Visitor<'node, P = P>,
2247 ) -> Result<(), P::Error> {
2248 v.visit_xhp_attr_info(c, self)
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)?;
2261 impl<P: Params> Node<P> for XhpAttrTag {
2265 v: &mut dyn Visitor<'node, P = P>,
2266 ) -> Result<(), P::Error> {
2267 v.visit_xhp_attr_tag(c, self)
2272 v: &mut dyn Visitor<'node, P = P>,
2273 ) -> Result<(), P::Error> {
2275 XhpAttrTag::Required => Ok(()),
2276 XhpAttrTag::LateInit => Ok(()),
2280 impl<P: Params> Node<P> for XhpAttribute<P::Ex, P::En> {
2284 v: &mut dyn Visitor<'node, P = P>,
2285 ) -> Result<(), P::Error> {
2286 v.visit_xhp_attribute(c, self)
2291 v: &mut dyn Visitor<'node, P = P>,
2292 ) -> Result<(), P::Error> {
2294 XhpAttribute::XhpSimple(a0) => {
2298 XhpAttribute::XhpSpread(a0) => {
2305 impl<P: Params> Node<P> for XhpChild {
2309 v: &mut dyn Visitor<'node, P = P>,
2310 ) -> Result<(), P::Error> {
2311 v.visit_xhp_child(c, self)
2316 v: &mut dyn Visitor<'node, P = P>,
2317 ) -> Result<(), P::Error> {
2319 XhpChild::ChildName(a0) => {
2323 XhpChild::ChildList(a0) => {
2327 XhpChild::ChildUnary(a0, a1) => {
2332 XhpChild::ChildBinary(a0, a1) => {
2340 impl<P: Params> Node<P> for XhpChildOp {
2344 v: &mut dyn Visitor<'node, P = P>,
2345 ) -> Result<(), P::Error> {
2346 v.visit_xhp_child_op(c, self)
2351 v: &mut dyn Visitor<'node, P = P>,
2352 ) -> Result<(), P::Error> {
2354 XhpChildOp::ChildStar => Ok(()),
2355 XhpChildOp::ChildPlus => Ok(()),
2356 XhpChildOp::ChildQuestion => Ok(()),
2360 impl<P: Params> Node<P> for XhpEnumValue {
2364 v: &mut dyn Visitor<'node, P = P>,
2365 ) -> Result<(), P::Error> {
2366 v.visit_xhp_enum_value(c, self)
2371 v: &mut dyn Visitor<'node, P = P>,
2372 ) -> Result<(), P::Error> {
2374 XhpEnumValue::XEVInt(a0) => {
2378 XhpEnumValue::XEVString(a0) => {
2385 impl<P: Params> Node<P> for XhpSimple<P::Ex, P::En> {
2389 v: &mut dyn Visitor<'node, P = P>,
2390 ) -> Result<(), P::Error> {
2391 v.visit_xhp_simple(c, self)
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)?;