renaming Ast_defs `class_kind` into `classish_kind`
[hiphop-php.git] / hphp / hack / src / oxidized_by_ref / gen / shallow_decl_defs.rs
blobdc525f217e9cc2f5cc8f2c64770ed34a418bcec6
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<<8f67542ddec83f89584214e6318115e9>>
7 //
8 // To regenerate this file, run:
9 //   hphp/hack/src/oxidized_regen.sh
11 use arena_trait::TrivialDrop;
12 use eq_modulo_pos::EqModuloPos;
13 use no_pos_hash::NoPosHash;
14 use ocamlrep_derive::FromOcamlRepIn;
15 use ocamlrep_derive::ToOcamlRep;
16 use serde::Deserialize;
17 use serde::Serialize;
19 #[allow(unused_imports)]
20 use crate::*;
22 pub use typing_defs::*;
24 pub use typing_defs::ConstDecl;
26 #[derive(
27     Clone,
28     Debug,
29     Deserialize,
30     Eq,
31     EqModuloPos,
32     FromOcamlRepIn,
33     Hash,
34     NoPosHash,
35     Ord,
36     PartialEq,
37     PartialOrd,
38     Serialize,
39     ToOcamlRep
41 pub struct ShallowClassConst<'a> {
42     pub abstract_: typing_defs::ClassConstKind,
43     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
44     pub name: typing_defs::PosId<'a>,
45     /// This field is used for two different meanings in two different places...
46     /// enum class A:arraykey {int X="a";} -- here X.scc_type=\HH\MemberOf<A,int>
47     /// enum B:int as arraykey {X="a"; Y=1; Z=B::X;} -- here X.scc_type=string, Y.scc_type=int, Z.scc_type=TAny
48     /// In the later case, the scc_type is just a simple syntactic attempt to retrieve the type from the initializer.
49     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
50     pub type_: &'a Ty<'a>,
51     /// This is a list of all scope-resolution operators "A::B" that are mentioned in the const initializer,
52     /// for members of regular-enums and enum-class-enums to detect circularity of initializers.
53     /// We don't yet have a similar mechanism for top-level const initializers.
54     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
55     pub refs: &'a [typing_defs::ClassConstRef<'a>],
57 impl<'a> TrivialDrop for ShallowClassConst<'a> {}
58 arena_deserializer::impl_deserialize_in_arena!(ShallowClassConst<'arena>);
60 #[derive(
61     Clone,
62     Debug,
63     Deserialize,
64     Eq,
65     EqModuloPos,
66     FromOcamlRepIn,
67     Hash,
68     NoPosHash,
69     Ord,
70     PartialEq,
71     PartialOrd,
72     Serialize,
73     ToOcamlRep
75 pub struct ShallowTypeconst<'a> {
76     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
77     pub name: typing_defs::PosId<'a>,
78     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
79     pub kind: typing_defs::Typeconst<'a>,
80     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
81     pub enforceable: (&'a pos_or_decl::PosOrDecl<'a>, bool),
82     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
83     pub reifiable: Option<&'a pos_or_decl::PosOrDecl<'a>>,
84     pub is_ctx: bool,
86 impl<'a> TrivialDrop for ShallowTypeconst<'a> {}
87 arena_deserializer::impl_deserialize_in_arena!(ShallowTypeconst<'arena>);
89 #[derive(
90     Clone,
91     Debug,
92     Deserialize,
93     Eq,
94     EqModuloPos,
95     FromOcamlRepIn,
96     Hash,
97     NoPosHash,
98     Ord,
99     PartialEq,
100     PartialOrd,
101     Serialize,
102     ToOcamlRep
104 pub struct ShallowProp<'a> {
105     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
106     pub name: typing_defs::PosId<'a>,
107     pub xhp_attr: Option<XhpAttr>,
108     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
109     pub type_: Option<&'a Ty<'a>>,
110     pub visibility: oxidized::ast_defs::Visibility,
111     pub flags: prop_flags::PropFlags,
113 impl<'a> TrivialDrop for ShallowProp<'a> {}
114 arena_deserializer::impl_deserialize_in_arena!(ShallowProp<'arena>);
116 #[derive(
117     Clone,
118     Debug,
119     Deserialize,
120     Eq,
121     EqModuloPos,
122     FromOcamlRepIn,
123     Hash,
124     NoPosHash,
125     Ord,
126     PartialEq,
127     PartialOrd,
128     Serialize,
129     ToOcamlRep
131 pub struct ShallowMethod<'a> {
132     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
133     pub name: typing_defs::PosId<'a>,
134     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
135     pub type_: &'a Ty<'a>,
136     pub visibility: oxidized::ast_defs::Visibility,
137     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
138     pub deprecated: Option<&'a str>,
139     pub flags: method_flags::MethodFlags,
141 impl<'a> TrivialDrop for ShallowMethod<'a> {}
142 arena_deserializer::impl_deserialize_in_arena!(ShallowMethod<'arena>);
144 #[derive(
145     Clone,
146     Debug,
147     Deserialize,
148     Eq,
149     EqModuloPos,
150     FromOcamlRepIn,
151     Hash,
152     NoPosHash,
153     Ord,
154     PartialEq,
155     PartialOrd,
156     Serialize,
157     ToOcamlRep
159 pub struct ShallowClass<'a> {
160     pub mode: oxidized::file_info::Mode,
161     pub final_: bool,
162     pub is_xhp: bool,
163     pub has_xhp_keyword: bool,
164     pub kind: oxidized::ast_defs::ClassishKind,
165     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
166     pub module: Option<&'a str>,
167     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
168     pub name: typing_defs::PosId<'a>,
169     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
170     pub tparams: &'a [&'a Tparam<'a>],
171     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
172     pub where_constraints: &'a [&'a WhereConstraint<'a>],
173     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
174     pub extends: &'a [&'a Ty<'a>],
175     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
176     pub uses: &'a [&'a Ty<'a>],
177     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
178     pub xhp_attr_uses: &'a [&'a Ty<'a>],
179     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
180     pub xhp_enum_values: s_map::SMap<'a, &'a [ast_defs::XhpEnumValue<'a>]>,
181     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
182     pub req_extends: &'a [&'a Ty<'a>],
183     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
184     pub req_implements: &'a [&'a Ty<'a>],
185     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
186     pub implements: &'a [&'a Ty<'a>],
187     pub support_dynamic_type: bool,
188     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
189     pub consts: &'a [&'a ShallowClassConst<'a>],
190     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
191     pub typeconsts: &'a [&'a ShallowTypeconst<'a>],
192     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
193     pub props: &'a [&'a ShallowProp<'a>],
194     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
195     pub sprops: &'a [&'a ShallowProp<'a>],
196     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
197     pub constructor: Option<&'a ShallowMethod<'a>>,
198     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
199     pub static_methods: &'a [&'a ShallowMethod<'a>],
200     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
201     pub methods: &'a [&'a ShallowMethod<'a>],
202     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
203     pub user_attributes: &'a [&'a UserAttribute<'a>],
204     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
205     pub enum_type: Option<&'a EnumType<'a>>,
207 impl<'a> TrivialDrop for ShallowClass<'a> {}
208 arena_deserializer::impl_deserialize_in_arena!(ShallowClass<'arena>);
210 pub type FunDecl<'a> = FunElt<'a>;
212 pub type ClassDecl<'a> = ShallowClass<'a>;
214 pub type RecordDecl<'a> = RecordDefType<'a>;
216 pub type TypedefDecl<'a> = TypedefType<'a>;
218 #[derive(
219     Clone,
220     Copy,
221     Debug,
222     Deserialize,
223     Eq,
224     EqModuloPos,
225     FromOcamlRepIn,
226     Hash,
227     NoPosHash,
228     Ord,
229     PartialEq,
230     PartialOrd,
231     Serialize,
232     ToOcamlRep
234 pub enum Decl<'a> {
235     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
236     Class(&'a ClassDecl<'a>),
237     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
238     Fun(&'a FunDecl<'a>),
239     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
240     Record(&'a RecordDecl<'a>),
241     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
242     Typedef(&'a TypedefDecl<'a>),
243     #[serde(deserialize_with = "arena_deserializer::arena", borrow)]
244     Const(&'a ConstDecl<'a>),
246 impl<'a> TrivialDrop for Decl<'a> {}
247 arena_deserializer::impl_deserialize_in_arena!(Decl<'arena>);