Rip out legacy reactivity from the typechecker and HackC
[hiphop-php.git] / hphp / hack / src / oxidized / gen / aast_defs.rs
blob751776f652153d8a246b17c2786f8fee6208dd34
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<<bee21cce8483ea56139c1101188f16fb>>
7 //
8 // To regenerate this file, run:
9 //   hphp/hack/src/oxidized_regen.sh
11 use arena_trait::TrivialDrop;
12 use no_pos_hash::NoPosHash;
13 use ocamlrep_derive::FromOcamlRep;
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 crate::ast_defs::shape_map;
24 pub use ast_defs::OgNullFlavor;
25 pub use ast_defs::Pos;
26 pub use ast_defs::PositionedByteString;
27 pub use ast_defs::Pstring;
28 pub use ast_defs::Visibility;
29 pub use local_id::LocalId;
30 pub use shape_map::ShapeMap;
32 #[derive(
33     Clone,
34     Debug,
35     Deserialize,
36     Eq,
37     FromOcamlRep,
38     Hash,
39     NoPosHash,
40     Ord,
41     PartialEq,
42     PartialOrd,
43     Serialize,
44     ToOcamlRep
46 pub struct Lid(pub Pos, pub LocalId);
48 pub type Sid = ast_defs::Id;
50 pub type IsReified = bool;
52 #[derive(
53     Clone,
54     Copy,
55     Debug,
56     Deserialize,
57     Eq,
58     FromOcamlRep,
59     FromOcamlRepIn,
60     Hash,
61     NoPosHash,
62     Ord,
63     PartialEq,
64     PartialOrd,
65     Serialize,
66     ToOcamlRep
68 pub enum ImportFlavor {
69     Include,
70     Require,
71     IncludeOnce,
72     RequireOnce,
74 impl TrivialDrop for ImportFlavor {}
76 #[derive(
77     Clone,
78     Debug,
79     Deserialize,
80     Eq,
81     FromOcamlRep,
82     Hash,
83     NoPosHash,
84     Ord,
85     PartialEq,
86     PartialOrd,
87     Serialize,
88     ToOcamlRep
90 pub enum XhpChild {
91     ChildName(Sid),
92     ChildList(Vec<XhpChild>),
93     ChildUnary(Box<XhpChild>, XhpChildOp),
94     ChildBinary(Box<XhpChild>, Box<XhpChild>),
97 #[derive(
98     Clone,
99     Copy,
100     Debug,
101     Deserialize,
102     Eq,
103     FromOcamlRep,
104     FromOcamlRepIn,
105     Hash,
106     NoPosHash,
107     Ord,
108     PartialEq,
109     PartialOrd,
110     Serialize,
111     ToOcamlRep
113 pub enum XhpChildOp {
114     ChildStar,
115     ChildPlus,
116     ChildQuestion,
118 impl TrivialDrop for XhpChildOp {}
120 #[derive(
121     Clone,
122     Debug,
123     Deserialize,
124     Eq,
125     FromOcamlRep,
126     Hash,
127     NoPosHash,
128     Ord,
129     PartialEq,
130     PartialOrd,
131     Serialize,
132     ToOcamlRep
134 pub struct Hint(pub Pos, pub Box<Hint_>);
136 pub type VariadicHint = Option<Hint>;
138 #[derive(
139     Clone,
140     Debug,
141     Deserialize,
142     Eq,
143     FromOcamlRep,
144     Hash,
145     NoPosHash,
146     Ord,
147     PartialEq,
148     PartialOrd,
149     Serialize,
150     ToOcamlRep
152 pub struct Contexts(pub Pos, pub Vec<Hint>);
154 #[derive(
155     Clone,
156     Debug,
157     Deserialize,
158     Eq,
159     FromOcamlRep,
160     Hash,
161     NoPosHash,
162     Ord,
163     PartialEq,
164     PartialOrd,
165     Serialize,
166     ToOcamlRep
168 pub struct HfParamInfo {
169     pub kind: Option<ast_defs::ParamKind>,
170     pub readonlyness: Option<ast_defs::ReadonlyKind>,
173 #[derive(
174     Clone,
175     Debug,
176     Deserialize,
177     Eq,
178     FromOcamlRep,
179     Hash,
180     NoPosHash,
181     Ord,
182     PartialEq,
183     PartialOrd,
184     Serialize,
185     ToOcamlRep
187 pub struct HintFun {
188     pub param_tys: Vec<Hint>,
189     pub param_info: Vec<Option<HfParamInfo>>,
190     pub variadic_ty: VariadicHint,
191     pub ctxs: Option<Contexts>,
192     pub return_ty: Hint,
193     pub is_readonly_return: Option<ast_defs::ReadonlyKind>,
196 #[derive(
197     Clone,
198     Debug,
199     Deserialize,
200     Eq,
201     FromOcamlRep,
202     Hash,
203     NoPosHash,
204     Ord,
205     PartialEq,
206     PartialOrd,
207     Serialize,
208     ToOcamlRep
210 pub enum Hint_ {
211     Hoption(Hint),
212     Hlike(Hint),
213     Hfun(HintFun),
214     Htuple(Vec<Hint>),
215     Happly(Sid, Vec<Hint>),
216     Hshape(NastShapeInfo),
217     /// This represents the use of a type const. Type consts are accessed like
218     /// regular consts in Hack, i.e.
219     ///
220     /// [$x | self | static | Class]::TypeConst
221     ///
222     /// Class  => Happly "Class"
223     /// self   => Happly of the class of definition
224     /// static => Habstr ("static",
225     ///           Habstr ("this", (Constraint_as, Happly of class of definition)))
226     /// $x     => Hvar "$x"
227     ///
228     /// Type const access can be chained such as
229     ///
230     /// Class::TC1::TC2::TC3
231     ///
232     /// We resolve the root of the type access chain as a type as follows.
233     ///
234     /// This will result in the following representation
235     ///
236     /// Haccess (Happly "Class", ["TC1", "TC2", "TC3"])
237     Haccess(Hint, Vec<Sid>),
238     Hsoft(Hint),
239     Hany,
240     Herr,
241     Hmixed,
242     Hnonnull,
243     Habstr(String, Vec<Hint>),
244     Hdarray(Hint, Hint),
245     Hvarray(Hint),
246     HvarrayOrDarray(Option<Hint>, Hint),
247     HvecOrDict(Option<Hint>, Hint),
248     Hprim(Tprim),
249     Hthis,
250     Hdynamic,
251     Hnothing,
252     Hunion(Vec<Hint>),
253     Hintersection(Vec<Hint>),
254     HfunContext(String),
255     Hvar(String),
258 /// AST types such as Happly("int", []) are resolved to Hprim values
259 #[derive(
260     Clone,
261     Copy,
262     Debug,
263     Deserialize,
264     Eq,
265     FromOcamlRep,
266     FromOcamlRepIn,
267     Hash,
268     NoPosHash,
269     Ord,
270     PartialEq,
271     PartialOrd,
272     Serialize,
273     ToOcamlRep
275 pub enum Tprim {
276     Tnull,
277     Tvoid,
278     Tint,
279     Tbool,
280     Tfloat,
281     Tstring,
282     Tresource,
283     Tnum,
284     Tarraykey,
285     Tnoreturn,
287 impl TrivialDrop for Tprim {}
289 #[derive(
290     Clone,
291     Debug,
292     Deserialize,
293     Eq,
294     FromOcamlRep,
295     Hash,
296     NoPosHash,
297     Ord,
298     PartialEq,
299     PartialOrd,
300     Serialize,
301     ToOcamlRep
303 pub struct ShapeFieldInfo {
304     pub optional: bool,
305     pub hint: Hint,
306     pub name: ast_defs::ShapeFieldName,
309 #[derive(
310     Clone,
311     Debug,
312     Deserialize,
313     Eq,
314     FromOcamlRep,
315     Hash,
316     NoPosHash,
317     Ord,
318     PartialEq,
319     PartialOrd,
320     Serialize,
321     ToOcamlRep
323 pub struct NastShapeInfo {
324     pub allows_unknown_fields: bool,
325     pub field_map: Vec<ShapeFieldInfo>,
328 #[derive(
329     Clone,
330     Copy,
331     Debug,
332     Deserialize,
333     Eq,
334     FromOcamlRep,
335     FromOcamlRepIn,
336     Hash,
337     NoPosHash,
338     Ord,
339     PartialEq,
340     PartialOrd,
341     Serialize,
342     ToOcamlRep
344 pub enum KvcKind {
345     Map,
346     ImmMap,
347     Dict,
349 impl TrivialDrop for KvcKind {}
351 #[derive(
352     Clone,
353     Copy,
354     Debug,
355     Deserialize,
356     Eq,
357     FromOcamlRep,
358     FromOcamlRepIn,
359     Hash,
360     NoPosHash,
361     Ord,
362     PartialEq,
363     PartialOrd,
364     Serialize,
365     ToOcamlRep
367 pub enum VcKind {
368     Vector,
369     ImmVector,
370     Vec,
371     Set,
372     ImmSet,
373     Keyset,
375 impl TrivialDrop for VcKind {}
377 #[derive(
378     Clone,
379     Copy,
380     Debug,
381     Deserialize,
382     Eq,
383     FromOcamlRep,
384     FromOcamlRepIn,
385     Hash,
386     NoPosHash,
387     Ord,
388     PartialEq,
389     PartialOrd,
390     Serialize,
391     ToOcamlRep
393 pub enum UseAsVisibility {
394     UseAsPublic,
395     UseAsPrivate,
396     UseAsProtected,
397     UseAsFinal,
399 impl TrivialDrop for UseAsVisibility {}
401 #[derive(
402     Clone,
403     Copy,
404     Debug,
405     Deserialize,
406     Eq,
407     FromOcamlRep,
408     FromOcamlRepIn,
409     Hash,
410     NoPosHash,
411     Ord,
412     PartialEq,
413     PartialOrd,
414     Serialize,
415     ToOcamlRep
417 pub enum TypedefVisibility {
418     Transparent,
419     Opaque,
421 impl TrivialDrop for TypedefVisibility {}
423 #[derive(
424     Clone,
425     Debug,
426     Deserialize,
427     Eq,
428     FromOcamlRep,
429     Hash,
430     NoPosHash,
431     Ord,
432     PartialEq,
433     PartialOrd,
434     Serialize,
435     ToOcamlRep
437 pub struct Enum_ {
438     pub base: Hint,
439     pub constraint: Option<Hint>,
440     pub includes: Vec<Hint>,
441     pub enum_class: bool,
444 #[derive(
445     Clone,
446     Debug,
447     Deserialize,
448     Eq,
449     FromOcamlRep,
450     Hash,
451     NoPosHash,
452     Ord,
453     PartialEq,
454     PartialOrd,
455     Serialize,
456     ToOcamlRep
458 pub struct WhereConstraintHint(pub Hint, pub ast_defs::ConstraintKind, pub Hint);
460 #[derive(
461     Clone,
462     Copy,
463     Debug,
464     Deserialize,
465     Eq,
466     FromOcamlRep,
467     FromOcamlRepIn,
468     Hash,
469     NoPosHash,
470     Ord,
471     PartialEq,
472     PartialOrd,
473     Serialize,
474     ToOcamlRep
476 pub enum ReifyKind {
477     Erased,
478     SoftReified,
479     Reified,
481 impl TrivialDrop for ReifyKind {}