firefly-compiler 0.4.5 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/.hintrc +4 -4
  2. package/README.md +1 -1
  3. package/core/HttpClient.ff +1 -1
  4. package/lsp/LanguageServer.ff +32 -7
  5. package/lsp/stderr.txt +1 -0
  6. package/lsp/stdin.txt +11 -0
  7. package/lsp/stdout.txt +41 -0
  8. package/lux/Main.ff +56 -2
  9. package/meetup/AutoCompletion.ff +6 -0
  10. package/output/js/ff/compiler/Builder.mjs +444 -444
  11. package/output/js/ff/compiler/Compiler.mjs +416 -416
  12. package/output/js/ff/compiler/Dependencies.mjs +389 -389
  13. package/output/js/ff/compiler/Deriver.mjs +1170 -1170
  14. package/output/js/ff/compiler/Dictionaries.mjs +1309 -1309
  15. package/output/js/ff/compiler/Environment.mjs +1015 -1015
  16. package/output/js/ff/compiler/Inference.mjs +4268 -4268
  17. package/output/js/ff/compiler/JsEmitter.mjs +5391 -5391
  18. package/output/js/ff/compiler/JsImporter.mjs +266 -266
  19. package/output/js/ff/compiler/LspHook.mjs +793 -793
  20. package/output/js/ff/compiler/Main.mjs +1675 -1675
  21. package/output/js/ff/compiler/Parser.mjs +4008 -4008
  22. package/output/js/ff/compiler/Patterns.mjs +927 -927
  23. package/output/js/ff/compiler/Resolver.mjs +2307 -2307
  24. package/output/js/ff/compiler/Substitution.mjs +1150 -1150
  25. package/output/js/ff/compiler/Syntax.mjs +12434 -12434
  26. package/output/js/ff/compiler/Token.mjs +3096 -3096
  27. package/output/js/ff/compiler/Tokenizer.mjs +593 -593
  28. package/output/js/ff/compiler/Unification.mjs +1752 -1752
  29. package/output/js/ff/compiler/Wildcards.mjs +608 -608
  30. package/output/js/ff/compiler/Workspace.mjs +687 -687
  31. package/output/js/ff/core/Any.mjs +143 -143
  32. package/output/js/ff/core/Array.mjs +547 -547
  33. package/output/js/ff/core/AssetSystem.mjs +274 -274
  34. package/output/js/ff/core/Atomic.mjs +154 -154
  35. package/output/js/ff/core/Bool.mjs +152 -152
  36. package/output/js/ff/core/Box.mjs +112 -112
  37. package/output/js/ff/core/BrowserSystem.mjs +126 -126
  38. package/output/js/ff/core/Buffer.mjs +395 -395
  39. package/output/js/ff/core/BuildSystem.mjs +296 -296
  40. package/output/js/ff/core/Channel.mjs +189 -189
  41. package/output/js/ff/core/Char.mjs +149 -149
  42. package/output/js/ff/core/Core.mjs +300 -300
  43. package/output/js/ff/core/Duration.mjs +116 -116
  44. package/output/js/ff/core/Equal.mjs +179 -179
  45. package/output/js/ff/core/Error.mjs +142 -142
  46. package/output/js/ff/core/FileHandle.mjs +150 -150
  47. package/output/js/ff/core/Float.mjs +225 -225
  48. package/output/js/ff/core/HttpClient.mjs +190 -190
  49. package/output/js/ff/core/Instant.mjs +109 -109
  50. package/output/js/ff/core/Int.mjs +265 -265
  51. package/output/js/ff/core/IntMap.mjs +280 -280
  52. package/output/js/ff/core/JsSystem.mjs +238 -238
  53. package/output/js/ff/core/JsValue.mjs +708 -708
  54. package/output/js/ff/core/List.mjs +2334 -2334
  55. package/output/js/ff/core/Lock.mjs +229 -229
  56. package/output/js/ff/core/Log.mjs +163 -163
  57. package/output/js/ff/core/Map.mjs +362 -362
  58. package/output/js/ff/core/NodeSystem.mjs +294 -294
  59. package/output/js/ff/core/Nothing.mjs +104 -104
  60. package/output/js/ff/core/Option.mjs +1015 -1015
  61. package/output/js/ff/core/Ordering.mjs +730 -730
  62. package/output/js/ff/core/Pair.mjs +331 -331
  63. package/output/js/ff/core/Path.mjs +545 -545
  64. package/output/js/ff/core/RbMap.mjs +1940 -1940
  65. package/output/js/ff/core/Serializable.mjs +428 -428
  66. package/output/js/ff/core/Set.mjs +254 -254
  67. package/output/js/ff/core/Show.mjs +205 -205
  68. package/output/js/ff/core/SourceLocation.mjs +229 -229
  69. package/output/js/ff/core/Stack.mjs +529 -529
  70. package/output/js/ff/core/Stream.mjs +1304 -1304
  71. package/output/js/ff/core/String.mjs +365 -365
  72. package/output/js/ff/core/StringMap.mjs +280 -280
  73. package/output/js/ff/core/Task.mjs +320 -320
  74. package/output/js/ff/core/Try.mjs +507 -507
  75. package/output/js/ff/core/Unit.mjs +151 -151
  76. package/package.json +29 -29
  77. package/vscode/package-lock.json +5 -5
  78. package/vscode/package.json +1 -1
@@ -1,687 +1,687 @@
1
-
2
-
3
- import * as ff_compiler_Workspace from "../../ff/compiler/Workspace.mjs"
4
-
5
- import * as ff_compiler_Syntax from "../../ff/compiler/Syntax.mjs"
6
-
7
- import * as ff_core_Any from "../../ff/core/Any.mjs"
8
-
9
- import * as ff_core_Array from "../../ff/core/Array.mjs"
10
-
11
- import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
12
-
13
- import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
14
-
15
- import * as ff_core_Bool from "../../ff/core/Bool.mjs"
16
-
17
- import * as ff_core_Box from "../../ff/core/Box.mjs"
18
-
19
- import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
20
-
21
- import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
22
-
23
- import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
24
-
25
- import * as ff_core_Channel from "../../ff/core/Channel.mjs"
26
-
27
- import * as ff_core_Char from "../../ff/core/Char.mjs"
28
-
29
- import * as ff_core_Core from "../../ff/core/Core.mjs"
30
-
31
- import * as ff_core_Duration from "../../ff/core/Duration.mjs"
32
-
33
- import * as ff_core_Equal from "../../ff/core/Equal.mjs"
34
-
35
- import * as ff_core_Error from "../../ff/core/Error.mjs"
36
-
37
- import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
38
-
39
- import * as ff_core_Float from "../../ff/core/Float.mjs"
40
-
41
- import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
42
-
43
- import * as ff_core_Instant from "../../ff/core/Instant.mjs"
44
-
45
- import * as ff_core_Int from "../../ff/core/Int.mjs"
46
-
47
- import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
48
-
49
- import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
50
-
51
- import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
52
-
53
- import * as ff_core_List from "../../ff/core/List.mjs"
54
-
55
- import * as ff_core_Lock from "../../ff/core/Lock.mjs"
56
-
57
- import * as ff_core_Log from "../../ff/core/Log.mjs"
58
-
59
- import * as ff_core_Map from "../../ff/core/Map.mjs"
60
-
61
- import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
62
-
63
- import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
64
-
65
- import * as ff_core_Option from "../../ff/core/Option.mjs"
66
-
67
- import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
68
-
69
- import * as ff_core_Pair from "../../ff/core/Pair.mjs"
70
-
71
- import * as ff_core_Path from "../../ff/core/Path.mjs"
72
-
73
- import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
74
-
75
- import * as ff_core_Set from "../../ff/core/Set.mjs"
76
-
77
- import * as ff_core_Show from "../../ff/core/Show.mjs"
78
-
79
- import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
80
-
81
- import * as ff_core_Stack from "../../ff/core/Stack.mjs"
82
-
83
- import * as ff_core_Stream from "../../ff/core/Stream.mjs"
84
-
85
- import * as ff_core_String from "../../ff/core/String.mjs"
86
-
87
- import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
88
-
89
- import * as ff_core_Task from "../../ff/core/Task.mjs"
90
-
91
- import * as ff_core_Try from "../../ff/core/Try.mjs"
92
-
93
- import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
-
95
- // type Workspace
96
- export function Workspace(rules_, defaultLocation_, packageDirectory_) {
97
- return {rules_, defaultLocation_, packageDirectory_};
98
- }
99
-
100
- // type WorkspaceRule
101
- export function WorkspaceRule(packageGroup_, packageName_, location_) {
102
- return {packageGroup_, packageName_, location_};
103
- }
104
-
105
- export const centralLocation_ = "https://www.firefly-lang.org/packages/";
106
-
107
- export function loadWorkspace_(path_) {
108
- const packageDirectory_ = ((ff_core_Path.Path_extension(path_) === ".ff")
109
- ? ff_core_Option.Option_grab(ff_core_Path.Path_parent(path_))
110
- : path_);
111
- const workspaceFile_ = ff_core_Path.Path_slash(packageDirectory_, ".firefly-workspace");
112
- if(ff_core_Path.Path_exists(workspaceFile_, false, false, false)) {
113
- return ff_compiler_Workspace.parseWorkspaceFile_(workspaceFile_, packageDirectory_)
114
- } else if((!ff_core_Option.Option_isEmpty(ff_core_Path.Path_parent(packageDirectory_)))) {
115
- return ff_compiler_Workspace.loadWorkspace_(ff_core_Option.Option_grab(ff_core_Path.Path_parent(packageDirectory_)))
116
- } else {
117
- return ff_compiler_Workspace.Workspace(ff_core_List.Empty(), ff_compiler_Workspace.centralLocation_, ".")
118
- }
119
- }
120
-
121
- export function parseWorkspaceFile_(path_, packageDirectory_) {
122
- const text_ = ff_core_Path.Path_readText(path_);
123
- let defaultLocation_ = ff_core_Option.None();
124
- const lines_ = ff_core_List.List_filter(ff_core_List.List_map(ff_core_Array.Array_toList(ff_core_String.String_split(text_, 10)), ((_w1) => {
125
- return ff_core_String.String_takeWhile(ff_core_String.String_replace(_w1, "\r", ""), ((_w1) => {
126
- return (_w1 !== 35)
127
- }))
128
- })), ((_w1) => {
129
- return (ff_core_String.String_size(_w1) !== 0)
130
- }));
131
- const rules_ = ff_core_List.List_collect(lines_, ((line_) => {
132
- const columns_ = ff_core_List.List_filter(ff_core_Array.Array_toList(ff_core_String.String_split(ff_core_String.String_replace(line_, "\t", " "), 32)), ((_w1) => {
133
- return (ff_core_String.String_size(_w1) !== 0)
134
- }));
135
- ff_core_Option.Option_each(defaultLocation_, ((_) => {
136
- ff_core_Core.panic_(("Unexpected rule after the * rule: " + line_))
137
- }));
138
- if((ff_core_List.List_size(columns_) !== 2)) {
139
- ff_core_Core.panic_(("Could not parse workspace rule: " + line_))
140
- };
141
- const package_ = ff_core_List.List_grab(columns_, 0);
142
- const location_ = ff_core_List.List_grab(columns_, 1);
143
- const fixedLocation_ = (ff_core_String.String_endsWith(location_, "/")
144
- ? location_
145
- : (location_ + "/"));
146
- if((package_ === "*")) {
147
- defaultLocation_ = ff_core_Option.Some(fixedLocation_);
148
- return ff_core_Option.None()
149
- } else {
150
- const packageParts_ = ff_core_String.String_split(package_, 58);
151
- if((ff_core_Array.Array_size(packageParts_) !== 2)) {
152
- ff_core_Core.panic_(("Could not parse workspace package: " + package_))
153
- };
154
- if((ff_core_Array.Array_grab(packageParts_, 0) === "*")) {
155
- ff_core_Core.panic_(("Unexpected wildcard: " + package_))
156
- };
157
- return ff_core_Option.Some(ff_compiler_Workspace.WorkspaceRule(ff_core_Array.Array_grab(packageParts_, 0), ((ff_core_Array.Array_grab(packageParts_, 1) !== "*")
158
- ? ff_core_Option.Some(ff_core_Array.Array_grab(packageParts_, 1))
159
- : ff_core_Option.None()), fixedLocation_))
160
- }
161
- }));
162
- return ff_compiler_Workspace.Workspace(rules_, ff_core_Option.Option_else(defaultLocation_, (() => {
163
- return ff_compiler_Workspace.centralLocation_
164
- })), ff_core_Path.Path_absolute(packageDirectory_))
165
- }
166
-
167
- export function tarGzName_(packagePair_, version_) {
168
- return (((((((((packagePair_.group_ + "_") + packagePair_.name_) + "_") + version_.major_) + "_") + version_.minor_) + "_") + version_.patch_) + ".tar.gz")
169
- }
170
-
171
- export async function loadWorkspace_$(path_, $task) {
172
- const packageDirectory_ = (((await ff_core_Path.Path_extension$(path_, $task)) === ".ff")
173
- ? ff_core_Option.Option_grab((await ff_core_Path.Path_parent$(path_, $task)))
174
- : path_);
175
- const workspaceFile_ = (await ff_core_Path.Path_slash$(packageDirectory_, ".firefly-workspace", $task));
176
- if((await ff_core_Path.Path_exists$(workspaceFile_, false, false, false, $task))) {
177
- return (await ff_compiler_Workspace.parseWorkspaceFile_$(workspaceFile_, packageDirectory_, $task))
178
- } else if((!ff_core_Option.Option_isEmpty((await ff_core_Path.Path_parent$(packageDirectory_, $task))))) {
179
- return (await ff_compiler_Workspace.loadWorkspace_$(ff_core_Option.Option_grab((await ff_core_Path.Path_parent$(packageDirectory_, $task))), $task))
180
- } else {
181
- return ff_compiler_Workspace.Workspace(ff_core_List.Empty(), ff_compiler_Workspace.centralLocation_, ".")
182
- }
183
- }
184
-
185
- export async function parseWorkspaceFile_$(path_, packageDirectory_, $task) {
186
- const text_ = (await ff_core_Path.Path_readText$(path_, $task));
187
- let defaultLocation_ = ff_core_Option.None();
188
- const lines_ = ff_core_List.List_filter(ff_core_List.List_map(ff_core_Array.Array_toList(ff_core_String.String_split(text_, 10)), ((_w1) => {
189
- return ff_core_String.String_takeWhile(ff_core_String.String_replace(_w1, "\r", ""), ((_w1) => {
190
- return (_w1 !== 35)
191
- }))
192
- })), ((_w1) => {
193
- return (ff_core_String.String_size(_w1) !== 0)
194
- }));
195
- const rules_ = ff_core_List.List_collect(lines_, ((line_) => {
196
- const columns_ = ff_core_List.List_filter(ff_core_Array.Array_toList(ff_core_String.String_split(ff_core_String.String_replace(line_, "\t", " "), 32)), ((_w1) => {
197
- return (ff_core_String.String_size(_w1) !== 0)
198
- }));
199
- ff_core_Option.Option_each(defaultLocation_, ((_) => {
200
- ff_core_Core.panic_(("Unexpected rule after the * rule: " + line_))
201
- }));
202
- if((ff_core_List.List_size(columns_) !== 2)) {
203
- ff_core_Core.panic_(("Could not parse workspace rule: " + line_))
204
- };
205
- const package_ = ff_core_List.List_grab(columns_, 0);
206
- const location_ = ff_core_List.List_grab(columns_, 1);
207
- const fixedLocation_ = (ff_core_String.String_endsWith(location_, "/")
208
- ? location_
209
- : (location_ + "/"));
210
- if((package_ === "*")) {
211
- defaultLocation_ = ff_core_Option.Some(fixedLocation_);
212
- return ff_core_Option.None()
213
- } else {
214
- const packageParts_ = ff_core_String.String_split(package_, 58);
215
- if((ff_core_Array.Array_size(packageParts_) !== 2)) {
216
- ff_core_Core.panic_(("Could not parse workspace package: " + package_))
217
- };
218
- if((ff_core_Array.Array_grab(packageParts_, 0) === "*")) {
219
- ff_core_Core.panic_(("Unexpected wildcard: " + package_))
220
- };
221
- return ff_core_Option.Some(ff_compiler_Workspace.WorkspaceRule(ff_core_Array.Array_grab(packageParts_, 0), ((ff_core_Array.Array_grab(packageParts_, 1) !== "*")
222
- ? ff_core_Option.Some(ff_core_Array.Array_grab(packageParts_, 1))
223
- : ff_core_Option.None()), fixedLocation_))
224
- }
225
- }));
226
- return ff_compiler_Workspace.Workspace(rules_, ff_core_Option.Option_else(defaultLocation_, (() => {
227
- return ff_compiler_Workspace.centralLocation_
228
- })), (await ff_core_Path.Path_absolute$(packageDirectory_, $task)))
229
- }
230
-
231
- export async function tarGzName_$(packagePair_, version_, $task) {
232
- return (((((((((packagePair_.group_ + "_") + packagePair_.name_) + "_") + version_.major_) + "_") + version_.minor_) + "_") + version_.patch_) + ".tar.gz")
233
- }
234
-
235
- export function Workspace_findPackageLocation(self_, packagePair_, version_) {
236
- return ff_core_Option.Option_else(ff_core_Option.Option_map(ff_core_List.List_find(self_.rules_, ((rule_) => {
237
- return ((rule_.packageGroup_ === packagePair_.group_) && ff_core_Option.Option_all(rule_.packageName_, ((_w1) => {
238
- return (_w1 === packagePair_.name_)
239
- })))
240
- })), ((rule_) => {
241
- const prefix_ = (ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(rule_.packageName_, ff_core_Option.None())
242
- ? (packagePair_.name_ + "/")
243
- : "");
244
- if(ff_core_String.String_contains(rule_.location_, ":")) {
245
- return ((rule_.location_ + prefix_) + ff_compiler_Workspace.tarGzName_(packagePair_, version_))
246
- } else {
247
- return (((self_.packageDirectory_ + "/") + rule_.location_) + prefix_)
248
- }
249
- })), (() => {
250
- return (((((self_.defaultLocation_ + packagePair_.group_) + "/") + packagePair_.name_) + "/") + ff_compiler_Workspace.tarGzName_(packagePair_, version_))
251
- }))
252
- }
253
-
254
- export async function Workspace_findPackageLocation$(self_, packagePair_, version_, $task) {
255
- return ff_core_Option.Option_else(ff_core_Option.Option_map(ff_core_List.List_find(self_.rules_, ((rule_) => {
256
- return ((rule_.packageGroup_ === packagePair_.group_) && ff_core_Option.Option_all(rule_.packageName_, ((_w1) => {
257
- return (_w1 === packagePair_.name_)
258
- })))
259
- })), ((rule_) => {
260
- const prefix_ = (ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(rule_.packageName_, ff_core_Option.None())
261
- ? (packagePair_.name_ + "/")
262
- : "");
263
- if(ff_core_String.String_contains(rule_.location_, ":")) {
264
- return ((rule_.location_ + prefix_) + ff_compiler_Workspace.tarGzName_(packagePair_, version_))
265
- } else {
266
- return (((self_.packageDirectory_ + "/") + rule_.location_) + prefix_)
267
- }
268
- })), (() => {
269
- return (((((self_.defaultLocation_ + packagePair_.group_) + "/") + packagePair_.name_) + "/") + ff_compiler_Workspace.tarGzName_(packagePair_, version_))
270
- }))
271
- }
272
-
273
- export const ff_core_Any_HasAnyTag$ff_compiler_Workspace_Workspace = {
274
- anyTag_() {
275
- return ff_core_Any.internalAnyTag_((("ff:compiler/Workspace.Workspace" + "[") + "]"))
276
- },
277
- async anyTag_$($task) {
278
- return ff_core_Any.internalAnyTag_((("ff:compiler/Workspace.Workspace" + "[") + "]"))
279
- }
280
- };
281
-
282
- export const ff_core_Any_HasAnyTag$ff_compiler_Workspace_WorkspaceRule = {
283
- anyTag_() {
284
- return ff_core_Any.internalAnyTag_((("ff:compiler/Workspace.WorkspaceRule" + "[") + "]"))
285
- },
286
- async anyTag_$($task) {
287
- return ff_core_Any.internalAnyTag_((("ff:compiler/Workspace.WorkspaceRule" + "[") + "]"))
288
- }
289
- };
290
-
291
- export const ff_core_Show_Show$ff_compiler_Workspace_Workspace = {
292
- show_(value_) {
293
- {
294
- const value_a = value_;
295
- {
296
- const z_ = value_a;
297
- return ((((((("Workspace" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_compiler_Workspace.ff_core_Show_Show$ff_compiler_Workspace_WorkspaceRule).show_(z_.rules_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.defaultLocation_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.packageDirectory_)) + ")")
298
- return
299
- }
300
- }
301
- },
302
- async show_$(value_, $task) {
303
- {
304
- const value_a = value_;
305
- {
306
- const z_ = value_a;
307
- return ((((((("Workspace" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_compiler_Workspace.ff_core_Show_Show$ff_compiler_Workspace_WorkspaceRule).show_(z_.rules_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.defaultLocation_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.packageDirectory_)) + ")")
308
- return
309
- }
310
- }
311
- }
312
- };
313
-
314
- export const ff_core_Show_Show$ff_compiler_Workspace_WorkspaceRule = {
315
- show_(value_) {
316
- {
317
- const value_a = value_;
318
- {
319
- const z_ = value_a;
320
- return ((((((("WorkspaceRule" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.packageGroup_)) + ", ") + ff_core_Option.ff_core_Show_Show$ff_core_Option_Option(ff_core_Show.ff_core_Show_Show$ff_core_String_String).show_(z_.packageName_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.location_)) + ")")
321
- return
322
- }
323
- }
324
- },
325
- async show_$(value_, $task) {
326
- {
327
- const value_a = value_;
328
- {
329
- const z_ = value_a;
330
- return ((((((("WorkspaceRule" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.packageGroup_)) + ", ") + ff_core_Option.ff_core_Show_Show$ff_core_Option_Option(ff_core_Show.ff_core_Show_Show$ff_core_String_String).show_(z_.packageName_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.location_)) + ")")
331
- return
332
- }
333
- }
334
- }
335
- };
336
-
337
- export const ff_core_Equal_Equal$ff_compiler_Workspace_Workspace = {
338
- equals_(x_, y_) {
339
- {
340
- const x_a = x_;
341
- const y_a = y_;
342
- {
343
- const _guard1 = (x_ === y_);
344
- if(_guard1) {
345
- return true
346
- return
347
- }
348
- }
349
- {
350
- return (ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_compiler_Workspace.ff_core_Equal_Equal$ff_compiler_Workspace_WorkspaceRule).equals_(x_.rules_, y_.rules_) && ((x_.defaultLocation_ === y_.defaultLocation_) && (x_.packageDirectory_ === y_.packageDirectory_)))
351
- return
352
- }
353
- }
354
- },
355
- async equals_$(x_, y_, $task) {
356
- {
357
- const x_a = x_;
358
- const y_a = y_;
359
- {
360
- const _guard1 = (x_ === y_);
361
- if(_guard1) {
362
- return true
363
- return
364
- }
365
- }
366
- {
367
- return (ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_compiler_Workspace.ff_core_Equal_Equal$ff_compiler_Workspace_WorkspaceRule).equals_(x_.rules_, y_.rules_) && ((x_.defaultLocation_ === y_.defaultLocation_) && (x_.packageDirectory_ === y_.packageDirectory_)))
368
- return
369
- }
370
- }
371
- }
372
- };
373
-
374
- export const ff_core_Equal_Equal$ff_compiler_Workspace_WorkspaceRule = {
375
- equals_(x_, y_) {
376
- {
377
- const x_a = x_;
378
- const y_a = y_;
379
- {
380
- const _guard1 = (x_ === y_);
381
- if(_guard1) {
382
- return true
383
- return
384
- }
385
- }
386
- {
387
- return ((x_.packageGroup_ === y_.packageGroup_) && (ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(x_.packageName_, y_.packageName_) && (x_.location_ === y_.location_)))
388
- return
389
- }
390
- }
391
- },
392
- async equals_$(x_, y_, $task) {
393
- {
394
- const x_a = x_;
395
- const y_a = y_;
396
- {
397
- const _guard1 = (x_ === y_);
398
- if(_guard1) {
399
- return true
400
- return
401
- }
402
- }
403
- {
404
- return ((x_.packageGroup_ === y_.packageGroup_) && (ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(x_.packageName_, y_.packageName_) && (x_.location_ === y_.location_)))
405
- return
406
- }
407
- }
408
- }
409
- };
410
-
411
- export const ff_core_Ordering_Order$ff_compiler_Workspace_Workspace = {
412
- compare_(x_, y_) {
413
- {
414
- const x_a = x_;
415
- const y_a = y_;
416
- {
417
- const _guard1 = (x_ === y_);
418
- if(_guard1) {
419
- return ff_core_Ordering.OrderingSame()
420
- return
421
- }
422
- }
423
- {
424
- const rulesOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_compiler_Workspace.ff_core_Ordering_Order$ff_compiler_Workspace_WorkspaceRule).compare_(x_.rules_, y_.rules_);
425
- if((rulesOrdering_ !== ff_core_Ordering.OrderingSame())) {
426
- return rulesOrdering_
427
- } else {
428
- const defaultLocationOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.defaultLocation_, y_.defaultLocation_);
429
- if((defaultLocationOrdering_ !== ff_core_Ordering.OrderingSame())) {
430
- return defaultLocationOrdering_
431
- } else {
432
- const packageDirectoryOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.packageDirectory_, y_.packageDirectory_);
433
- if((packageDirectoryOrdering_ !== ff_core_Ordering.OrderingSame())) {
434
- return packageDirectoryOrdering_
435
- } else {
436
- return ff_core_Ordering.OrderingSame()
437
- }
438
- }
439
- }
440
- return
441
- }
442
- }
443
- },
444
- async compare_$(x_, y_, $task) {
445
- {
446
- const x_a = x_;
447
- const y_a = y_;
448
- {
449
- const _guard1 = (x_ === y_);
450
- if(_guard1) {
451
- return ff_core_Ordering.OrderingSame()
452
- return
453
- }
454
- }
455
- {
456
- const rulesOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_compiler_Workspace.ff_core_Ordering_Order$ff_compiler_Workspace_WorkspaceRule).compare_(x_.rules_, y_.rules_);
457
- if((rulesOrdering_ !== ff_core_Ordering.OrderingSame())) {
458
- return rulesOrdering_
459
- } else {
460
- const defaultLocationOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.defaultLocation_, y_.defaultLocation_);
461
- if((defaultLocationOrdering_ !== ff_core_Ordering.OrderingSame())) {
462
- return defaultLocationOrdering_
463
- } else {
464
- const packageDirectoryOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.packageDirectory_, y_.packageDirectory_);
465
- if((packageDirectoryOrdering_ !== ff_core_Ordering.OrderingSame())) {
466
- return packageDirectoryOrdering_
467
- } else {
468
- return ff_core_Ordering.OrderingSame()
469
- }
470
- }
471
- }
472
- return
473
- }
474
- }
475
- }
476
- };
477
-
478
- export const ff_core_Ordering_Order$ff_compiler_Workspace_WorkspaceRule = {
479
- compare_(x_, y_) {
480
- {
481
- const x_a = x_;
482
- const y_a = y_;
483
- {
484
- const _guard1 = (x_ === y_);
485
- if(_guard1) {
486
- return ff_core_Ordering.OrderingSame()
487
- return
488
- }
489
- }
490
- {
491
- const packageGroupOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.packageGroup_, y_.packageGroup_);
492
- if((packageGroupOrdering_ !== ff_core_Ordering.OrderingSame())) {
493
- return packageGroupOrdering_
494
- } else {
495
- const packageNameOrdering_ = ff_core_Option.ff_core_Ordering_Order$ff_core_Option_Option(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String).compare_(x_.packageName_, y_.packageName_);
496
- if((packageNameOrdering_ !== ff_core_Ordering.OrderingSame())) {
497
- return packageNameOrdering_
498
- } else {
499
- const locationOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.location_, y_.location_);
500
- if((locationOrdering_ !== ff_core_Ordering.OrderingSame())) {
501
- return locationOrdering_
502
- } else {
503
- return ff_core_Ordering.OrderingSame()
504
- }
505
- }
506
- }
507
- return
508
- }
509
- }
510
- },
511
- async compare_$(x_, y_, $task) {
512
- {
513
- const x_a = x_;
514
- const y_a = y_;
515
- {
516
- const _guard1 = (x_ === y_);
517
- if(_guard1) {
518
- return ff_core_Ordering.OrderingSame()
519
- return
520
- }
521
- }
522
- {
523
- const packageGroupOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.packageGroup_, y_.packageGroup_);
524
- if((packageGroupOrdering_ !== ff_core_Ordering.OrderingSame())) {
525
- return packageGroupOrdering_
526
- } else {
527
- const packageNameOrdering_ = ff_core_Option.ff_core_Ordering_Order$ff_core_Option_Option(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String).compare_(x_.packageName_, y_.packageName_);
528
- if((packageNameOrdering_ !== ff_core_Ordering.OrderingSame())) {
529
- return packageNameOrdering_
530
- } else {
531
- const locationOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.location_, y_.location_);
532
- if((locationOrdering_ !== ff_core_Ordering.OrderingSame())) {
533
- return locationOrdering_
534
- } else {
535
- return ff_core_Ordering.OrderingSame()
536
- }
537
- }
538
- }
539
- return
540
- }
541
- }
542
- }
543
- };
544
-
545
- export const ff_core_Serializable_Serializable$ff_compiler_Workspace_Workspace = {
546
- serializeUsing_(serialization_, value_) {
547
- {
548
- const serialization_a = serialization_;
549
- const value_a = value_;
550
- {
551
- const v_ = value_a;
552
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
553
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
554
- serialization_.offset_ += 1;
555
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_compiler_Workspace.ff_core_Serializable_Serializable$ff_compiler_Workspace_WorkspaceRule).serializeUsing_(serialization_, v_.rules_);
556
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.defaultLocation_);
557
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.packageDirectory_)
558
- return
559
- }
560
- }
561
- },
562
- deserializeUsing_(serialization_) {
563
- const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
564
- serialization_.offset_ += 1;
565
- {
566
- const _1 = variantIndex_;
567
- {
568
- if(_1 == 0) {
569
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
570
- return ff_compiler_Workspace.Workspace(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_compiler_Workspace.ff_core_Serializable_Serializable$ff_compiler_Workspace_WorkspaceRule).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
571
- return
572
- }
573
- }
574
- {
575
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
576
- return
577
- }
578
- }
579
- },
580
- async serializeUsing_$(serialization_, value_, $task) {
581
- {
582
- const serialization_a = serialization_;
583
- const value_a = value_;
584
- {
585
- const v_ = value_a;
586
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
587
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
588
- serialization_.offset_ += 1;
589
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_compiler_Workspace.ff_core_Serializable_Serializable$ff_compiler_Workspace_WorkspaceRule).serializeUsing_(serialization_, v_.rules_);
590
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.defaultLocation_);
591
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.packageDirectory_)
592
- return
593
- }
594
- }
595
- },
596
- async deserializeUsing_$(serialization_, $task) {
597
- const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
598
- serialization_.offset_ += 1;
599
- {
600
- const _1 = variantIndex_;
601
- {
602
- if(_1 == 0) {
603
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
604
- return ff_compiler_Workspace.Workspace(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_compiler_Workspace.ff_core_Serializable_Serializable$ff_compiler_Workspace_WorkspaceRule).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
605
- return
606
- }
607
- }
608
- {
609
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
610
- return
611
- }
612
- }
613
- }
614
- };
615
-
616
- export const ff_core_Serializable_Serializable$ff_compiler_Workspace_WorkspaceRule = {
617
- serializeUsing_(serialization_, value_) {
618
- {
619
- const serialization_a = serialization_;
620
- const value_a = value_;
621
- {
622
- const v_ = value_a;
623
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
624
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
625
- serialization_.offset_ += 1;
626
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.packageGroup_);
627
- ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).serializeUsing_(serialization_, v_.packageName_);
628
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.location_)
629
- return
630
- }
631
- }
632
- },
633
- deserializeUsing_(serialization_) {
634
- const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
635
- serialization_.offset_ += 1;
636
- {
637
- const _1 = variantIndex_;
638
- {
639
- if(_1 == 0) {
640
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
641
- return ff_compiler_Workspace.WorkspaceRule(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
642
- return
643
- }
644
- }
645
- {
646
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
647
- return
648
- }
649
- }
650
- },
651
- async serializeUsing_$(serialization_, value_, $task) {
652
- {
653
- const serialization_a = serialization_;
654
- const value_a = value_;
655
- {
656
- const v_ = value_a;
657
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
658
- ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
659
- serialization_.offset_ += 1;
660
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.packageGroup_);
661
- ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).serializeUsing_(serialization_, v_.packageName_);
662
- ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.location_)
663
- return
664
- }
665
- }
666
- },
667
- async deserializeUsing_$(serialization_, $task) {
668
- const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
669
- serialization_.offset_ += 1;
670
- {
671
- const _1 = variantIndex_;
672
- {
673
- if(_1 == 0) {
674
- serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
675
- return ff_compiler_Workspace.WorkspaceRule(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
676
- return
677
- }
678
- }
679
- {
680
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
681
- return
682
- }
683
- }
684
- }
685
- };
686
-
687
-
1
+
2
+
3
+ import * as ff_compiler_Workspace from "../../ff/compiler/Workspace.mjs"
4
+
5
+ import * as ff_compiler_Syntax from "../../ff/compiler/Syntax.mjs"
6
+
7
+ import * as ff_core_Any from "../../ff/core/Any.mjs"
8
+
9
+ import * as ff_core_Array from "../../ff/core/Array.mjs"
10
+
11
+ import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
12
+
13
+ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
14
+
15
+ import * as ff_core_Bool from "../../ff/core/Bool.mjs"
16
+
17
+ import * as ff_core_Box from "../../ff/core/Box.mjs"
18
+
19
+ import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
20
+
21
+ import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
22
+
23
+ import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
24
+
25
+ import * as ff_core_Channel from "../../ff/core/Channel.mjs"
26
+
27
+ import * as ff_core_Char from "../../ff/core/Char.mjs"
28
+
29
+ import * as ff_core_Core from "../../ff/core/Core.mjs"
30
+
31
+ import * as ff_core_Duration from "../../ff/core/Duration.mjs"
32
+
33
+ import * as ff_core_Equal from "../../ff/core/Equal.mjs"
34
+
35
+ import * as ff_core_Error from "../../ff/core/Error.mjs"
36
+
37
+ import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
38
+
39
+ import * as ff_core_Float from "../../ff/core/Float.mjs"
40
+
41
+ import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
42
+
43
+ import * as ff_core_Instant from "../../ff/core/Instant.mjs"
44
+
45
+ import * as ff_core_Int from "../../ff/core/Int.mjs"
46
+
47
+ import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
48
+
49
+ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
50
+
51
+ import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
52
+
53
+ import * as ff_core_List from "../../ff/core/List.mjs"
54
+
55
+ import * as ff_core_Lock from "../../ff/core/Lock.mjs"
56
+
57
+ import * as ff_core_Log from "../../ff/core/Log.mjs"
58
+
59
+ import * as ff_core_Map from "../../ff/core/Map.mjs"
60
+
61
+ import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
62
+
63
+ import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
64
+
65
+ import * as ff_core_Option from "../../ff/core/Option.mjs"
66
+
67
+ import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
68
+
69
+ import * as ff_core_Pair from "../../ff/core/Pair.mjs"
70
+
71
+ import * as ff_core_Path from "../../ff/core/Path.mjs"
72
+
73
+ import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
74
+
75
+ import * as ff_core_Set from "../../ff/core/Set.mjs"
76
+
77
+ import * as ff_core_Show from "../../ff/core/Show.mjs"
78
+
79
+ import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
80
+
81
+ import * as ff_core_Stack from "../../ff/core/Stack.mjs"
82
+
83
+ import * as ff_core_Stream from "../../ff/core/Stream.mjs"
84
+
85
+ import * as ff_core_String from "../../ff/core/String.mjs"
86
+
87
+ import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
88
+
89
+ import * as ff_core_Task from "../../ff/core/Task.mjs"
90
+
91
+ import * as ff_core_Try from "../../ff/core/Try.mjs"
92
+
93
+ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
94
+
95
+ // type Workspace
96
+ export function Workspace(rules_, defaultLocation_, packageDirectory_) {
97
+ return {rules_, defaultLocation_, packageDirectory_};
98
+ }
99
+
100
+ // type WorkspaceRule
101
+ export function WorkspaceRule(packageGroup_, packageName_, location_) {
102
+ return {packageGroup_, packageName_, location_};
103
+ }
104
+
105
+ export const centralLocation_ = "https://www.firefly-lang.org/packages/";
106
+
107
+ export function loadWorkspace_(path_) {
108
+ const packageDirectory_ = ((ff_core_Path.Path_extension(path_) === ".ff")
109
+ ? ff_core_Option.Option_grab(ff_core_Path.Path_parent(path_))
110
+ : path_);
111
+ const workspaceFile_ = ff_core_Path.Path_slash(packageDirectory_, ".firefly-workspace");
112
+ if(ff_core_Path.Path_exists(workspaceFile_, false, false, false)) {
113
+ return ff_compiler_Workspace.parseWorkspaceFile_(workspaceFile_, packageDirectory_)
114
+ } else if((!ff_core_Option.Option_isEmpty(ff_core_Path.Path_parent(packageDirectory_)))) {
115
+ return ff_compiler_Workspace.loadWorkspace_(ff_core_Option.Option_grab(ff_core_Path.Path_parent(packageDirectory_)))
116
+ } else {
117
+ return ff_compiler_Workspace.Workspace(ff_core_List.Empty(), ff_compiler_Workspace.centralLocation_, ".")
118
+ }
119
+ }
120
+
121
+ export function parseWorkspaceFile_(path_, packageDirectory_) {
122
+ const text_ = ff_core_Path.Path_readText(path_);
123
+ let defaultLocation_ = ff_core_Option.None();
124
+ const lines_ = ff_core_List.List_filter(ff_core_List.List_map(ff_core_Array.Array_toList(ff_core_String.String_split(text_, 10)), ((_w1) => {
125
+ return ff_core_String.String_takeWhile(ff_core_String.String_replace(_w1, "\r", ""), ((_w1) => {
126
+ return (_w1 !== 35)
127
+ }))
128
+ })), ((_w1) => {
129
+ return (ff_core_String.String_size(_w1) !== 0)
130
+ }));
131
+ const rules_ = ff_core_List.List_collect(lines_, ((line_) => {
132
+ const columns_ = ff_core_List.List_filter(ff_core_Array.Array_toList(ff_core_String.String_split(ff_core_String.String_replace(line_, "\t", " "), 32)), ((_w1) => {
133
+ return (ff_core_String.String_size(_w1) !== 0)
134
+ }));
135
+ ff_core_Option.Option_each(defaultLocation_, ((_) => {
136
+ ff_core_Core.panic_(("Unexpected rule after the * rule: " + line_))
137
+ }));
138
+ if((ff_core_List.List_size(columns_) !== 2)) {
139
+ ff_core_Core.panic_(("Could not parse workspace rule: " + line_))
140
+ };
141
+ const package_ = ff_core_List.List_grab(columns_, 0);
142
+ const location_ = ff_core_List.List_grab(columns_, 1);
143
+ const fixedLocation_ = (ff_core_String.String_endsWith(location_, "/")
144
+ ? location_
145
+ : (location_ + "/"));
146
+ if((package_ === "*")) {
147
+ defaultLocation_ = ff_core_Option.Some(fixedLocation_);
148
+ return ff_core_Option.None()
149
+ } else {
150
+ const packageParts_ = ff_core_String.String_split(package_, 58);
151
+ if((ff_core_Array.Array_size(packageParts_) !== 2)) {
152
+ ff_core_Core.panic_(("Could not parse workspace package: " + package_))
153
+ };
154
+ if((ff_core_Array.Array_grab(packageParts_, 0) === "*")) {
155
+ ff_core_Core.panic_(("Unexpected wildcard: " + package_))
156
+ };
157
+ return ff_core_Option.Some(ff_compiler_Workspace.WorkspaceRule(ff_core_Array.Array_grab(packageParts_, 0), ((ff_core_Array.Array_grab(packageParts_, 1) !== "*")
158
+ ? ff_core_Option.Some(ff_core_Array.Array_grab(packageParts_, 1))
159
+ : ff_core_Option.None()), fixedLocation_))
160
+ }
161
+ }));
162
+ return ff_compiler_Workspace.Workspace(rules_, ff_core_Option.Option_else(defaultLocation_, (() => {
163
+ return ff_compiler_Workspace.centralLocation_
164
+ })), ff_core_Path.Path_absolute(packageDirectory_))
165
+ }
166
+
167
+ export function tarGzName_(packagePair_, version_) {
168
+ return (((((((((packagePair_.group_ + "_") + packagePair_.name_) + "_") + version_.major_) + "_") + version_.minor_) + "_") + version_.patch_) + ".tar.gz")
169
+ }
170
+
171
+ export async function loadWorkspace_$(path_, $task) {
172
+ const packageDirectory_ = (((await ff_core_Path.Path_extension$(path_, $task)) === ".ff")
173
+ ? ff_core_Option.Option_grab((await ff_core_Path.Path_parent$(path_, $task)))
174
+ : path_);
175
+ const workspaceFile_ = (await ff_core_Path.Path_slash$(packageDirectory_, ".firefly-workspace", $task));
176
+ if((await ff_core_Path.Path_exists$(workspaceFile_, false, false, false, $task))) {
177
+ return (await ff_compiler_Workspace.parseWorkspaceFile_$(workspaceFile_, packageDirectory_, $task))
178
+ } else if((!ff_core_Option.Option_isEmpty((await ff_core_Path.Path_parent$(packageDirectory_, $task))))) {
179
+ return (await ff_compiler_Workspace.loadWorkspace_$(ff_core_Option.Option_grab((await ff_core_Path.Path_parent$(packageDirectory_, $task))), $task))
180
+ } else {
181
+ return ff_compiler_Workspace.Workspace(ff_core_List.Empty(), ff_compiler_Workspace.centralLocation_, ".")
182
+ }
183
+ }
184
+
185
+ export async function parseWorkspaceFile_$(path_, packageDirectory_, $task) {
186
+ const text_ = (await ff_core_Path.Path_readText$(path_, $task));
187
+ let defaultLocation_ = ff_core_Option.None();
188
+ const lines_ = ff_core_List.List_filter(ff_core_List.List_map(ff_core_Array.Array_toList(ff_core_String.String_split(text_, 10)), ((_w1) => {
189
+ return ff_core_String.String_takeWhile(ff_core_String.String_replace(_w1, "\r", ""), ((_w1) => {
190
+ return (_w1 !== 35)
191
+ }))
192
+ })), ((_w1) => {
193
+ return (ff_core_String.String_size(_w1) !== 0)
194
+ }));
195
+ const rules_ = ff_core_List.List_collect(lines_, ((line_) => {
196
+ const columns_ = ff_core_List.List_filter(ff_core_Array.Array_toList(ff_core_String.String_split(ff_core_String.String_replace(line_, "\t", " "), 32)), ((_w1) => {
197
+ return (ff_core_String.String_size(_w1) !== 0)
198
+ }));
199
+ ff_core_Option.Option_each(defaultLocation_, ((_) => {
200
+ ff_core_Core.panic_(("Unexpected rule after the * rule: " + line_))
201
+ }));
202
+ if((ff_core_List.List_size(columns_) !== 2)) {
203
+ ff_core_Core.panic_(("Could not parse workspace rule: " + line_))
204
+ };
205
+ const package_ = ff_core_List.List_grab(columns_, 0);
206
+ const location_ = ff_core_List.List_grab(columns_, 1);
207
+ const fixedLocation_ = (ff_core_String.String_endsWith(location_, "/")
208
+ ? location_
209
+ : (location_ + "/"));
210
+ if((package_ === "*")) {
211
+ defaultLocation_ = ff_core_Option.Some(fixedLocation_);
212
+ return ff_core_Option.None()
213
+ } else {
214
+ const packageParts_ = ff_core_String.String_split(package_, 58);
215
+ if((ff_core_Array.Array_size(packageParts_) !== 2)) {
216
+ ff_core_Core.panic_(("Could not parse workspace package: " + package_))
217
+ };
218
+ if((ff_core_Array.Array_grab(packageParts_, 0) === "*")) {
219
+ ff_core_Core.panic_(("Unexpected wildcard: " + package_))
220
+ };
221
+ return ff_core_Option.Some(ff_compiler_Workspace.WorkspaceRule(ff_core_Array.Array_grab(packageParts_, 0), ((ff_core_Array.Array_grab(packageParts_, 1) !== "*")
222
+ ? ff_core_Option.Some(ff_core_Array.Array_grab(packageParts_, 1))
223
+ : ff_core_Option.None()), fixedLocation_))
224
+ }
225
+ }));
226
+ return ff_compiler_Workspace.Workspace(rules_, ff_core_Option.Option_else(defaultLocation_, (() => {
227
+ return ff_compiler_Workspace.centralLocation_
228
+ })), (await ff_core_Path.Path_absolute$(packageDirectory_, $task)))
229
+ }
230
+
231
+ export async function tarGzName_$(packagePair_, version_, $task) {
232
+ return (((((((((packagePair_.group_ + "_") + packagePair_.name_) + "_") + version_.major_) + "_") + version_.minor_) + "_") + version_.patch_) + ".tar.gz")
233
+ }
234
+
235
+ export function Workspace_findPackageLocation(self_, packagePair_, version_) {
236
+ return ff_core_Option.Option_else(ff_core_Option.Option_map(ff_core_List.List_find(self_.rules_, ((rule_) => {
237
+ return ((rule_.packageGroup_ === packagePair_.group_) && ff_core_Option.Option_all(rule_.packageName_, ((_w1) => {
238
+ return (_w1 === packagePair_.name_)
239
+ })))
240
+ })), ((rule_) => {
241
+ const prefix_ = (ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(rule_.packageName_, ff_core_Option.None())
242
+ ? (packagePair_.name_ + "/")
243
+ : "");
244
+ if(ff_core_String.String_contains(rule_.location_, ":")) {
245
+ return ((rule_.location_ + prefix_) + ff_compiler_Workspace.tarGzName_(packagePair_, version_))
246
+ } else {
247
+ return (((self_.packageDirectory_ + "/") + rule_.location_) + prefix_)
248
+ }
249
+ })), (() => {
250
+ return (((((self_.defaultLocation_ + packagePair_.group_) + "/") + packagePair_.name_) + "/") + ff_compiler_Workspace.tarGzName_(packagePair_, version_))
251
+ }))
252
+ }
253
+
254
+ export async function Workspace_findPackageLocation$(self_, packagePair_, version_, $task) {
255
+ return ff_core_Option.Option_else(ff_core_Option.Option_map(ff_core_List.List_find(self_.rules_, ((rule_) => {
256
+ return ((rule_.packageGroup_ === packagePair_.group_) && ff_core_Option.Option_all(rule_.packageName_, ((_w1) => {
257
+ return (_w1 === packagePair_.name_)
258
+ })))
259
+ })), ((rule_) => {
260
+ const prefix_ = (ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(rule_.packageName_, ff_core_Option.None())
261
+ ? (packagePair_.name_ + "/")
262
+ : "");
263
+ if(ff_core_String.String_contains(rule_.location_, ":")) {
264
+ return ((rule_.location_ + prefix_) + ff_compiler_Workspace.tarGzName_(packagePair_, version_))
265
+ } else {
266
+ return (((self_.packageDirectory_ + "/") + rule_.location_) + prefix_)
267
+ }
268
+ })), (() => {
269
+ return (((((self_.defaultLocation_ + packagePair_.group_) + "/") + packagePair_.name_) + "/") + ff_compiler_Workspace.tarGzName_(packagePair_, version_))
270
+ }))
271
+ }
272
+
273
+ export const ff_core_Any_HasAnyTag$ff_compiler_Workspace_Workspace = {
274
+ anyTag_() {
275
+ return ff_core_Any.internalAnyTag_((("ff:compiler/Workspace.Workspace" + "[") + "]"))
276
+ },
277
+ async anyTag_$($task) {
278
+ return ff_core_Any.internalAnyTag_((("ff:compiler/Workspace.Workspace" + "[") + "]"))
279
+ }
280
+ };
281
+
282
+ export const ff_core_Any_HasAnyTag$ff_compiler_Workspace_WorkspaceRule = {
283
+ anyTag_() {
284
+ return ff_core_Any.internalAnyTag_((("ff:compiler/Workspace.WorkspaceRule" + "[") + "]"))
285
+ },
286
+ async anyTag_$($task) {
287
+ return ff_core_Any.internalAnyTag_((("ff:compiler/Workspace.WorkspaceRule" + "[") + "]"))
288
+ }
289
+ };
290
+
291
+ export const ff_core_Show_Show$ff_compiler_Workspace_Workspace = {
292
+ show_(value_) {
293
+ {
294
+ const value_a = value_;
295
+ {
296
+ const z_ = value_a;
297
+ return ((((((("Workspace" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_compiler_Workspace.ff_core_Show_Show$ff_compiler_Workspace_WorkspaceRule).show_(z_.rules_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.defaultLocation_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.packageDirectory_)) + ")")
298
+ return
299
+ }
300
+ }
301
+ },
302
+ async show_$(value_, $task) {
303
+ {
304
+ const value_a = value_;
305
+ {
306
+ const z_ = value_a;
307
+ return ((((((("Workspace" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_List_List(ff_compiler_Workspace.ff_core_Show_Show$ff_compiler_Workspace_WorkspaceRule).show_(z_.rules_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.defaultLocation_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.packageDirectory_)) + ")")
308
+ return
309
+ }
310
+ }
311
+ }
312
+ };
313
+
314
+ export const ff_core_Show_Show$ff_compiler_Workspace_WorkspaceRule = {
315
+ show_(value_) {
316
+ {
317
+ const value_a = value_;
318
+ {
319
+ const z_ = value_a;
320
+ return ((((((("WorkspaceRule" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.packageGroup_)) + ", ") + ff_core_Option.ff_core_Show_Show$ff_core_Option_Option(ff_core_Show.ff_core_Show_Show$ff_core_String_String).show_(z_.packageName_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.location_)) + ")")
321
+ return
322
+ }
323
+ }
324
+ },
325
+ async show_$(value_, $task) {
326
+ {
327
+ const value_a = value_;
328
+ {
329
+ const z_ = value_a;
330
+ return ((((((("WorkspaceRule" + "(") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.packageGroup_)) + ", ") + ff_core_Option.ff_core_Show_Show$ff_core_Option_Option(ff_core_Show.ff_core_Show_Show$ff_core_String_String).show_(z_.packageName_)) + ", ") + ff_core_Show.ff_core_Show_Show$ff_core_String_String.show_(z_.location_)) + ")")
331
+ return
332
+ }
333
+ }
334
+ }
335
+ };
336
+
337
+ export const ff_core_Equal_Equal$ff_compiler_Workspace_Workspace = {
338
+ equals_(x_, y_) {
339
+ {
340
+ const x_a = x_;
341
+ const y_a = y_;
342
+ {
343
+ const _guard1 = (x_ === y_);
344
+ if(_guard1) {
345
+ return true
346
+ return
347
+ }
348
+ }
349
+ {
350
+ return (ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_compiler_Workspace.ff_core_Equal_Equal$ff_compiler_Workspace_WorkspaceRule).equals_(x_.rules_, y_.rules_) && ((x_.defaultLocation_ === y_.defaultLocation_) && (x_.packageDirectory_ === y_.packageDirectory_)))
351
+ return
352
+ }
353
+ }
354
+ },
355
+ async equals_$(x_, y_, $task) {
356
+ {
357
+ const x_a = x_;
358
+ const y_a = y_;
359
+ {
360
+ const _guard1 = (x_ === y_);
361
+ if(_guard1) {
362
+ return true
363
+ return
364
+ }
365
+ }
366
+ {
367
+ return (ff_core_List.ff_core_Equal_Equal$ff_core_List_List(ff_compiler_Workspace.ff_core_Equal_Equal$ff_compiler_Workspace_WorkspaceRule).equals_(x_.rules_, y_.rules_) && ((x_.defaultLocation_ === y_.defaultLocation_) && (x_.packageDirectory_ === y_.packageDirectory_)))
368
+ return
369
+ }
370
+ }
371
+ }
372
+ };
373
+
374
+ export const ff_core_Equal_Equal$ff_compiler_Workspace_WorkspaceRule = {
375
+ equals_(x_, y_) {
376
+ {
377
+ const x_a = x_;
378
+ const y_a = y_;
379
+ {
380
+ const _guard1 = (x_ === y_);
381
+ if(_guard1) {
382
+ return true
383
+ return
384
+ }
385
+ }
386
+ {
387
+ return ((x_.packageGroup_ === y_.packageGroup_) && (ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(x_.packageName_, y_.packageName_) && (x_.location_ === y_.location_)))
388
+ return
389
+ }
390
+ }
391
+ },
392
+ async equals_$(x_, y_, $task) {
393
+ {
394
+ const x_a = x_;
395
+ const y_a = y_;
396
+ {
397
+ const _guard1 = (x_ === y_);
398
+ if(_guard1) {
399
+ return true
400
+ return
401
+ }
402
+ }
403
+ {
404
+ return ((x_.packageGroup_ === y_.packageGroup_) && (ff_core_Option.ff_core_Equal_Equal$ff_core_Option_Option(ff_core_Equal.ff_core_Equal_Equal$ff_core_String_String).equals_(x_.packageName_, y_.packageName_) && (x_.location_ === y_.location_)))
405
+ return
406
+ }
407
+ }
408
+ }
409
+ };
410
+
411
+ export const ff_core_Ordering_Order$ff_compiler_Workspace_Workspace = {
412
+ compare_(x_, y_) {
413
+ {
414
+ const x_a = x_;
415
+ const y_a = y_;
416
+ {
417
+ const _guard1 = (x_ === y_);
418
+ if(_guard1) {
419
+ return ff_core_Ordering.OrderingSame()
420
+ return
421
+ }
422
+ }
423
+ {
424
+ const rulesOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_compiler_Workspace.ff_core_Ordering_Order$ff_compiler_Workspace_WorkspaceRule).compare_(x_.rules_, y_.rules_);
425
+ if((rulesOrdering_ !== ff_core_Ordering.OrderingSame())) {
426
+ return rulesOrdering_
427
+ } else {
428
+ const defaultLocationOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.defaultLocation_, y_.defaultLocation_);
429
+ if((defaultLocationOrdering_ !== ff_core_Ordering.OrderingSame())) {
430
+ return defaultLocationOrdering_
431
+ } else {
432
+ const packageDirectoryOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.packageDirectory_, y_.packageDirectory_);
433
+ if((packageDirectoryOrdering_ !== ff_core_Ordering.OrderingSame())) {
434
+ return packageDirectoryOrdering_
435
+ } else {
436
+ return ff_core_Ordering.OrderingSame()
437
+ }
438
+ }
439
+ }
440
+ return
441
+ }
442
+ }
443
+ },
444
+ async compare_$(x_, y_, $task) {
445
+ {
446
+ const x_a = x_;
447
+ const y_a = y_;
448
+ {
449
+ const _guard1 = (x_ === y_);
450
+ if(_guard1) {
451
+ return ff_core_Ordering.OrderingSame()
452
+ return
453
+ }
454
+ }
455
+ {
456
+ const rulesOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_List_List(ff_compiler_Workspace.ff_core_Ordering_Order$ff_compiler_Workspace_WorkspaceRule).compare_(x_.rules_, y_.rules_);
457
+ if((rulesOrdering_ !== ff_core_Ordering.OrderingSame())) {
458
+ return rulesOrdering_
459
+ } else {
460
+ const defaultLocationOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.defaultLocation_, y_.defaultLocation_);
461
+ if((defaultLocationOrdering_ !== ff_core_Ordering.OrderingSame())) {
462
+ return defaultLocationOrdering_
463
+ } else {
464
+ const packageDirectoryOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.packageDirectory_, y_.packageDirectory_);
465
+ if((packageDirectoryOrdering_ !== ff_core_Ordering.OrderingSame())) {
466
+ return packageDirectoryOrdering_
467
+ } else {
468
+ return ff_core_Ordering.OrderingSame()
469
+ }
470
+ }
471
+ }
472
+ return
473
+ }
474
+ }
475
+ }
476
+ };
477
+
478
+ export const ff_core_Ordering_Order$ff_compiler_Workspace_WorkspaceRule = {
479
+ compare_(x_, y_) {
480
+ {
481
+ const x_a = x_;
482
+ const y_a = y_;
483
+ {
484
+ const _guard1 = (x_ === y_);
485
+ if(_guard1) {
486
+ return ff_core_Ordering.OrderingSame()
487
+ return
488
+ }
489
+ }
490
+ {
491
+ const packageGroupOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.packageGroup_, y_.packageGroup_);
492
+ if((packageGroupOrdering_ !== ff_core_Ordering.OrderingSame())) {
493
+ return packageGroupOrdering_
494
+ } else {
495
+ const packageNameOrdering_ = ff_core_Option.ff_core_Ordering_Order$ff_core_Option_Option(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String).compare_(x_.packageName_, y_.packageName_);
496
+ if((packageNameOrdering_ !== ff_core_Ordering.OrderingSame())) {
497
+ return packageNameOrdering_
498
+ } else {
499
+ const locationOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.location_, y_.location_);
500
+ if((locationOrdering_ !== ff_core_Ordering.OrderingSame())) {
501
+ return locationOrdering_
502
+ } else {
503
+ return ff_core_Ordering.OrderingSame()
504
+ }
505
+ }
506
+ }
507
+ return
508
+ }
509
+ }
510
+ },
511
+ async compare_$(x_, y_, $task) {
512
+ {
513
+ const x_a = x_;
514
+ const y_a = y_;
515
+ {
516
+ const _guard1 = (x_ === y_);
517
+ if(_guard1) {
518
+ return ff_core_Ordering.OrderingSame()
519
+ return
520
+ }
521
+ }
522
+ {
523
+ const packageGroupOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.packageGroup_, y_.packageGroup_);
524
+ if((packageGroupOrdering_ !== ff_core_Ordering.OrderingSame())) {
525
+ return packageGroupOrdering_
526
+ } else {
527
+ const packageNameOrdering_ = ff_core_Option.ff_core_Ordering_Order$ff_core_Option_Option(ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String).compare_(x_.packageName_, y_.packageName_);
528
+ if((packageNameOrdering_ !== ff_core_Ordering.OrderingSame())) {
529
+ return packageNameOrdering_
530
+ } else {
531
+ const locationOrdering_ = ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String.compare_(x_.location_, y_.location_);
532
+ if((locationOrdering_ !== ff_core_Ordering.OrderingSame())) {
533
+ return locationOrdering_
534
+ } else {
535
+ return ff_core_Ordering.OrderingSame()
536
+ }
537
+ }
538
+ }
539
+ return
540
+ }
541
+ }
542
+ }
543
+ };
544
+
545
+ export const ff_core_Serializable_Serializable$ff_compiler_Workspace_Workspace = {
546
+ serializeUsing_(serialization_, value_) {
547
+ {
548
+ const serialization_a = serialization_;
549
+ const value_a = value_;
550
+ {
551
+ const v_ = value_a;
552
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
553
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
554
+ serialization_.offset_ += 1;
555
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_compiler_Workspace.ff_core_Serializable_Serializable$ff_compiler_Workspace_WorkspaceRule).serializeUsing_(serialization_, v_.rules_);
556
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.defaultLocation_);
557
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.packageDirectory_)
558
+ return
559
+ }
560
+ }
561
+ },
562
+ deserializeUsing_(serialization_) {
563
+ const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
564
+ serialization_.offset_ += 1;
565
+ {
566
+ const _1 = variantIndex_;
567
+ {
568
+ if(_1 == 0) {
569
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
570
+ return ff_compiler_Workspace.Workspace(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_compiler_Workspace.ff_core_Serializable_Serializable$ff_compiler_Workspace_WorkspaceRule).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
571
+ return
572
+ }
573
+ }
574
+ {
575
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
576
+ return
577
+ }
578
+ }
579
+ },
580
+ async serializeUsing_$(serialization_, value_, $task) {
581
+ {
582
+ const serialization_a = serialization_;
583
+ const value_a = value_;
584
+ {
585
+ const v_ = value_a;
586
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
587
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
588
+ serialization_.offset_ += 1;
589
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_compiler_Workspace.ff_core_Serializable_Serializable$ff_compiler_Workspace_WorkspaceRule).serializeUsing_(serialization_, v_.rules_);
590
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.defaultLocation_);
591
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.packageDirectory_)
592
+ return
593
+ }
594
+ }
595
+ },
596
+ async deserializeUsing_$(serialization_, $task) {
597
+ const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
598
+ serialization_.offset_ += 1;
599
+ {
600
+ const _1 = variantIndex_;
601
+ {
602
+ if(_1 == 0) {
603
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 31), 0);
604
+ return ff_compiler_Workspace.Workspace(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_List_List(ff_compiler_Workspace.ff_core_Serializable_Serializable$ff_compiler_Workspace_WorkspaceRule).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
605
+ return
606
+ }
607
+ }
608
+ {
609
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
610
+ return
611
+ }
612
+ }
613
+ }
614
+ };
615
+
616
+ export const ff_core_Serializable_Serializable$ff_compiler_Workspace_WorkspaceRule = {
617
+ serializeUsing_(serialization_, value_) {
618
+ {
619
+ const serialization_a = serialization_;
620
+ const value_a = value_;
621
+ {
622
+ const v_ = value_a;
623
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
624
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
625
+ serialization_.offset_ += 1;
626
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.packageGroup_);
627
+ ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).serializeUsing_(serialization_, v_.packageName_);
628
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.location_)
629
+ return
630
+ }
631
+ }
632
+ },
633
+ deserializeUsing_(serialization_) {
634
+ const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
635
+ serialization_.offset_ += 1;
636
+ {
637
+ const _1 = variantIndex_;
638
+ {
639
+ if(_1 == 0) {
640
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
641
+ return ff_compiler_Workspace.WorkspaceRule(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
642
+ return
643
+ }
644
+ }
645
+ {
646
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
647
+ return
648
+ }
649
+ }
650
+ },
651
+ async serializeUsing_$(serialization_, value_, $task) {
652
+ {
653
+ const serialization_a = serialization_;
654
+ const value_a = value_;
655
+ {
656
+ const v_ = value_a;
657
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
658
+ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 0);
659
+ serialization_.offset_ += 1;
660
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.packageGroup_);
661
+ ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).serializeUsing_(serialization_, v_.packageName_);
662
+ ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.serializeUsing_(serialization_, v_.location_)
663
+ return
664
+ }
665
+ }
666
+ },
667
+ async deserializeUsing_$(serialization_, $task) {
668
+ const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
669
+ serialization_.offset_ += 1;
670
+ {
671
+ const _1 = variantIndex_;
672
+ {
673
+ if(_1 == 0) {
674
+ serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 35), 0);
675
+ return ff_compiler_Workspace.WorkspaceRule(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_), ff_core_Option.ff_core_Serializable_Serializable$ff_core_Option_Option(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String).deserializeUsing_(serialization_), ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_String_String.deserializeUsing_(serialization_))
676
+ return
677
+ }
678
+ }
679
+ {
680
+ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
681
+ return
682
+ }
683
+ }
684
+ }
685
+ };
686
+
687
+