-
-
Notifications
You must be signed in to change notification settings - Fork 117
/
Copy pathconfig.rei
217 lines (126 loc) · 5.17 KB
/
config.rei
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
type profile =
| Release;
type compilation_mode =
| Normal /* Standard compilation with regular bells and whistles */
| Runtime /* GC doesn't exist yet, allocations happen in runtime heap */;
type ignore_warning =
| IgnoreAll
| LetRecNonFunction
| AmbiguousName
| StatementType
| NonreturningStatement
| AllClausesGuarded
| PartialMatch
| UnusedMatch
| UnusedPat
| NonClosedRecordPattern
| UnreachableCase
| ShadowConstructor
| NoCmiFile
| FuncWasmUnsafe
| FromNumberLiteral
| UselessRecordSpread
| PrintUnsafe
| ToStringUnsafe
| ArrayIndexNonInteger;
/** The Grain stdlib directory, based on the current configuration */
let stdlib_directory: unit => option(string);
/** The WASI polyfill path, based on the current configuration */
let wasi_polyfill_path: unit => option(string);
/** The list of directories to search for modules in, based on the current configuration */
let module_search_path: unit => list(string);
/** Whether verbose output should be written */
let verbose: ref(bool);
/** Whether locations should be shown in s-expression-converted trees
(primarily useful with --verbose). */
let sexp_locs_enabled: ref(bool);
/** Whether or not to automatically import Pervasives */
let no_pervasives: ref(bool);
/** Whether to enable garbage collection */
let no_gc: ref(bool);
/** Whether to enable bulk memory operations */
let bulk_memory: ref(bool);
/** Custom WASI implementation */
let wasi_polyfill: ref(option(string));
/** Whether to replace the _start export with a start section during linking */
let use_start_section: ref(bool);
/** Compilation profile, e.g. release for production builds */
let profile: ref(option(profile));
// [NOTE] This default is here because it is used in multiple locations,
// and it doesn't make sense for it to be "owned" by any of them.
/** The default value for `memory_base` */
let default_memory_base: int;
/** Start address of Grain runtime heap */
let memory_base: ref(option(int));
/** The path to find modules on */
let include_dirs: ref(list(string));
/** The location of the pervasives module. */
let stdlib_dir: ref(option(string));
/** Whether color output should be enabled */
let color_enabled: ref(bool);
/** Initial number of WebAssembly memory pages */
let initial_memory_pages: ref(int);
/** Maximum number of WebAssembly memory pages */
let maximum_memory_pages: ref(option(int));
/** Import the memory from `env.memory` */
let import_memory: ref(bool);
/** Compiler warnings to ignore */
let ignore_warnings: ref(list(ignore_warning));
/** Whether this module should be compiled in runtime mode */
let compilation_mode: ref(compilation_mode);
/** Statically link modules after compilation */
let statically_link: ref(bool);
/** Disables tail-call optimizations */
let no_tail_call: ref(bool);
/** Whether non-terminal block expressions should be forced to return void */
let strict_sequence: ref(bool);
/** Whether debugging information should be included in the compiled output. */
let debug: ref(bool);
/** Also produce a WebAssembly Text (.wat) file. */
let wat: ref(bool);
/** Whether or not to include runtime type information used by toString/print */
let elide_type_info: ref(bool);
/** Whether or not to generate source maps. */
let source_map: ref(bool);
/*** Internal options (no command line flags) */
/** Whether to use safe string representations (always true for now) */
let safe_string: ref(bool);
/** Internal option to disable printing of warnings. */
let print_warnings: ref(bool);
/*** Configuration Saving/Restoring */
/** Type representing a saved set of configuration options */
type config;
/** An empty config */
let empty: config;
/** The current configuration for all programs */
let root_config: ref(config);
/** Set the configuration for all programs */
let set_root_config: unit => unit;
/** Gets a digest of the root configuration */
let get_root_config_digest: unit => string;
/** Saves the current configuration */
let save_config: unit => config;
/** Restores the configuration settings to the given configuration */
let restore_config: config => unit;
/** Reset all configuration items */
let reset_config: unit => unit;
/** Runs the given thunk with the given configuration */
let with_config: (config, unit => 'a) => 'a;
/** Runs the given thunk, making sure that any changes to the configuration
are contained to its execution. */
let preserve_config: (unit => 'a) => 'a;
/** Runs the given thunk with the given root configuration */
let with_root_config: (config, unit => 'a) => 'a;
/** Runs the given thunk, making sure that any changes to the configuration
and root configuration are contained to its execution. */
let preserve_all_configs: (unit => 'a) => 'a;
/** Wraps the given thunk with extractors for compiler command-line options */
let with_cli_options: 'a => Cmdliner.Term.t('a);
/** Applies compile flags provided as module attributes */
let apply_attribute_flags: (~no_pervasives: bool, ~runtime_mode: bool) => unit;
let with_attribute_flags:
(~no_pervasives: bool, ~runtime_mode: bool, unit => 'a) => 'a;
type implicit_opens =
| Pervasives_mod
| Gc_mod;
let get_implicit_opens: unit => list(implicit_opens);