2 * Copyright (c) 2018, Facebook, Inc.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
12 module PropFlags
: sig
13 type t
[@@deriving eq
, show
]
17 val get_abstract
: t
-> bool
18 val get_const
: t
-> bool
19 val get_lateinit
: t
-> bool
20 val get_lsb
: t
-> bool
21 val get_needs_init
: t
-> bool
22 val get_php_std_lib
: t
-> bool
23 val get_readonly
: t
-> bool
25 val set_abstract
: bool -> t
-> t
26 val set_const
: bool -> t
-> t
27 val set_lateinit
: bool -> t
-> t
28 val set_lsb
: bool -> t
-> t
29 val set_needs_init
: bool -> t
-> t
30 val set_php_std_lib
: bool -> t
-> t
31 val set_readonly
: bool -> t
-> t
43 [@@ocamlformat
"disable"]
45 module MethodFlags
: sig
46 type t
[@@deriving eq
, show
]
50 val get_abstract
: t
-> bool
51 val get_final
: t
-> bool
52 val get_override
: t
-> bool
53 val get_dynamicallycallable
: t
-> bool
54 val get_php_std_lib
: t
-> bool
56 val set_abstract
: bool -> t
-> t
57 val set_final
: bool -> t
-> t
58 val set_override
: bool -> t
-> t
59 val set_dynamicallycallable
: bool -> t
-> t
60 val set_php_std_lib
: bool -> t
-> t
66 dynamicallycallable
:bool ->
70 [@@ocamlformat
"disable"]
72 type shallow_class_const
= {
74 scc_name
: Ast_defs.id
;
79 type shallow_typeconst
= {
80 stc_abstract
: typeconst_abstract_kind
;
81 stc_as_constraint
: decl_ty
option;
82 stc_name
: Ast_defs.id
;
83 stc_type
: decl_ty
option;
84 stc_enforceable
: Pos.t
* bool;
85 stc_reifiable
: Pos.t
option;
91 sp_xhp_attr
: xhp_attr
option;
92 sp_type
: decl_ty
option;
93 sp_visibility
: Ast_defs.visibility
;
94 sp_flags
: PropFlags.t
;
98 type shallow_method
= {
100 sm_reactivity
: Decl_defs.method_reactivity
option;
102 sm_visibility
: Ast_defs.visibility
;
103 sm_deprecated
: string option;
104 sm_flags
: MethodFlags.t
;
106 [@@deriving eq
, show
]
108 type shallow_class
= {
109 sc_mode
: FileInfo.mode
;
112 sc_has_xhp_keyword
: bool;
113 sc_kind
: Ast_defs.class_kind
;
114 sc_name
: Ast_defs.id
;
115 sc_tparams
: decl_tparam list
;
116 sc_where_constraints
: decl_where_constraint list
;
117 sc_extends
: decl_ty list
;
118 sc_uses
: decl_ty list
;
119 sc_xhp_attr_uses
: decl_ty list
;
120 sc_req_extends
: decl_ty list
;
121 sc_req_implements
: decl_ty list
;
122 sc_implements
: decl_ty list
;
123 sc_implements_dynamic
: bool;
124 sc_consts
: shallow_class_const list
;
125 sc_typeconsts
: shallow_typeconst list
;
126 sc_props
: shallow_prop list
;
127 sc_sprops
: shallow_prop list
;
128 sc_constructor
: shallow_method
option;
129 sc_static_methods
: shallow_method list
;
130 sc_methods
: shallow_method list
;
131 sc_user_attributes
: user_attribute list
;
132 sc_enum_type
: enum_type
option;
134 [@@deriving eq
, show
]
136 val sp_abstract
: shallow_prop
-> bool
138 val sp_const
: shallow_prop
-> bool
140 val sp_lateinit
: shallow_prop
-> bool
142 val sp_lsb
: shallow_prop
-> bool
144 val sp_needs_init
: shallow_prop
-> bool
146 val sp_php_std_lib
: shallow_prop
-> bool
148 val sp_readonly
: shallow_prop
-> bool
150 val sm_abstract
: shallow_method
-> bool
152 val sm_final
: shallow_method
-> bool
154 val sm_override
: shallow_method
-> bool
156 val sm_dynamicallycallable
: shallow_method
-> bool
158 val sm_php_std_lib
: shallow_method
-> bool
160 type fun_decl
= fun_elt
[@@deriving show
]
162 type class_decl
= shallow_class
[@@deriving show
]
164 type record_decl
= record_def_type
[@@deriving show
]
166 type typedef_decl
= typedef_type
[@@deriving show
]
168 type const_decl
= Typing_defs.const_decl
[@@deriving show
]
171 | Class
of class_decl
173 | Record
of record_decl
174 | Typedef
of typedef_decl
175 | Const
of const_decl