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<<bee21cce8483ea56139c1101188f16fb>>
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;
19 #[allow(unused_imports)]
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;
46 pub struct Lid(pub Pos, pub LocalId);
48 pub type Sid = ast_defs::Id;
50 pub type IsReified = bool;
68 pub enum ImportFlavor {
74 impl TrivialDrop for ImportFlavor {}
92 ChildList(Vec<XhpChild>),
93 ChildUnary(Box<XhpChild>, XhpChildOp),
94 ChildBinary(Box<XhpChild>, Box<XhpChild>),
113 pub enum XhpChildOp {
118 impl TrivialDrop for XhpChildOp {}
134 pub struct Hint(pub Pos, pub Box<Hint_>);
136 pub type VariadicHint = Option<Hint>;
152 pub struct Contexts(pub Pos, pub Vec<Hint>);
168 pub struct HfParamInfo {
169 pub kind: Option<ast_defs::ParamKind>,
170 pub readonlyness: Option<ast_defs::ReadonlyKind>,
188 pub param_tys: Vec<Hint>,
189 pub param_info: Vec<Option<HfParamInfo>>,
190 pub variadic_ty: VariadicHint,
191 pub ctxs: Option<Contexts>,
193 pub is_readonly_return: Option<ast_defs::ReadonlyKind>,
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.
220 /// [$x | self | static | Class]::TypeConst
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)))
228 /// Type const access can be chained such as
230 /// Class::TC1::TC2::TC3
232 /// We resolve the root of the type access chain as a type as follows.
234 /// This will result in the following representation
236 /// Haccess (Happly "Class", ["TC1", "TC2", "TC3"])
237 Haccess(Hint, Vec<Sid>),
243 Habstr(String, Vec<Hint>),
246 HvarrayOrDarray(Option<Hint>, Hint),
247 HvecOrDict(Option<Hint>, Hint),
253 Hintersection(Vec<Hint>),
258 /// AST types such as Happly("int", []) are resolved to Hprim values
287 impl TrivialDrop for Tprim {}
303 pub struct ShapeFieldInfo {
306 pub name: ast_defs::ShapeFieldName,
323 pub struct NastShapeInfo {
324 pub allows_unknown_fields: bool,
325 pub field_map: Vec<ShapeFieldInfo>,
349 impl TrivialDrop for KvcKind {}
375 impl TrivialDrop for VcKind {}
393 pub enum UseAsVisibility {
399 impl TrivialDrop for UseAsVisibility {}
417 pub enum TypedefVisibility {
421 impl TrivialDrop for TypedefVisibility {}
439 pub constraint: Option<Hint>,
440 pub includes: Vec<Hint>,
441 pub enum_class: bool,
458 pub struct WhereConstraintHint(pub Hint, pub ast_defs::ConstraintKind, pub Hint);
481 impl TrivialDrop for ReifyKind {}