firefly-compiler 0.4.79 → 0.4.81
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.
- package/.hintrc +4 -4
- package/.vscode/settings.json +4 -4
- package/bin/Release.ff +153 -153
- package/bin/firefly.mjs +1 -1
- package/compiler/Builder.ff +257 -257
- package/compiler/Compiler.ff +227 -227
- package/compiler/Dependencies.ff +187 -187
- package/compiler/DependencyLock.ff +17 -17
- package/compiler/Inference.ff +2 -1
- package/compiler/JsEmitter.ff +940 -946
- package/compiler/LspHook.ff +202 -202
- package/compiler/Main.ff +3 -3
- package/compiler/ModuleCache.ff +178 -178
- package/compiler/Tokenizer.ff +1 -1
- package/compiler/Unification.ff +1 -1
- package/compiler/Workspace.ff +88 -88
- package/core/.firefly/include/package-lock.json +564 -564
- package/core/.firefly/include/package.json +5 -5
- package/core/.firefly/include/prepare.sh +1 -1
- package/core/.firefly/package.ff +2 -2
- package/core/Array.ff +265 -265
- package/core/Atomic.ff +64 -64
- package/core/Box.ff +7 -7
- package/core/BrowserSystem.ff +40 -40
- package/core/BuildSystem.ff +148 -148
- package/core/Crypto.ff +96 -96
- package/core/Equal.ff +36 -36
- package/core/Float.ff +25 -0
- package/core/HttpClient.ff +148 -148
- package/core/JsSystem.ff +69 -69
- package/core/Json.ff +434 -434
- package/core/List.ff +486 -486
- package/core/Lock.ff +144 -144
- package/core/NodeSystem.ff +216 -216
- package/core/Ordering.ff +161 -161
- package/core/Path.ff +401 -401
- package/core/Random.ff +134 -134
- package/core/RbMap.ff +216 -216
- package/core/Show.ff +43 -43
- package/core/SourceLocation.ff +68 -68
- package/core/Stream.ff +9 -9
- package/core/Task.ff +149 -141
- package/core/Try.ff +25 -4
- package/experimental/benchmarks/ListGrab.ff +23 -23
- package/experimental/benchmarks/ListGrab.java +55 -55
- package/experimental/benchmarks/Pyrotek45.ff +30 -30
- package/experimental/benchmarks/Pyrotek45.java +64 -64
- package/experimental/bidirectional/Bidi.ff +88 -88
- package/experimental/random/Index.ff +53 -53
- package/experimental/random/Process.ff +120 -120
- package/experimental/random/Scrape.ff +51 -51
- package/experimental/random/Symbols.ff +73 -73
- package/experimental/random/Tensor.ff +52 -52
- package/experimental/random/Units.ff +36 -36
- package/experimental/s3/S3TestAuthorizationHeader.ff +39 -39
- package/experimental/s3/S3TestPut.ff +16 -16
- package/experimental/tests/TestJson.ff +26 -26
- package/firefly.sh +0 -0
- package/fireflysite/.firefly/package.ff +4 -4
- package/fireflysite/CommunityOverview.ff +20 -20
- package/fireflysite/CountingButtonDemo.ff +58 -58
- package/fireflysite/DocumentParser.ff +331 -217
- package/fireflysite/ExamplesOverview.ff +40 -40
- package/fireflysite/FrontPage.ff +344 -360
- package/fireflysite/{GuideIntroduction.ff → GettingStarted.ff} +45 -52
- package/fireflysite/Guide.ff +442 -411
- package/fireflysite/Main.ff +151 -137
- package/fireflysite/MatchingPasswordsDemo.ff +82 -82
- package/fireflysite/PackagesOverview.ff +49 -49
- package/fireflysite/PostgresqlDemo.ff +34 -34
- package/fireflysite/ReferenceAll.ff +18 -0
- package/fireflysite/ReferenceIntroduction.ff +11 -0
- package/fireflysite/Styles.ff +567 -495
- package/fireflysite/Test.ff +46 -0
- package/fireflysite/assets/markdown/reference/BaseTypes.md +209 -0
- package/fireflysite/assets/markdown/reference/EmittedJavascript.md +66 -0
- package/fireflysite/assets/markdown/reference/Exceptions.md +101 -0
- package/fireflysite/assets/markdown/reference/FunctionsAndMethods.md +338 -0
- package/fireflysite/assets/markdown/reference/JavascriptInterop.md +134 -0
- package/fireflysite/assets/markdown/reference/ModulesAndPackages.md +162 -0
- package/fireflysite/assets/markdown/reference/OldStructuredConcurrency.md +48 -0
- package/fireflysite/assets/markdown/reference/PatternMatching.md +224 -0
- package/fireflysite/assets/markdown/reference/StatementsAndExpressions.md +86 -0
- package/fireflysite/assets/markdown/reference/StructuredConcurrency.md +99 -0
- package/fireflysite/assets/markdown/reference/TraitsAndInstances.md +100 -0
- package/fireflysite/assets/markdown/reference/UserDefinedTypes.md +184 -0
- package/fireflysite/assets/markdown/{ControlFlow.md → scratch/ControlFlow.md} +136 -136
- package/fireflysite/assets/markdown/scratch/Toc.md +41 -0
- package/lsp/.firefly/package.ff +1 -1
- package/lsp/CompletionHandler.ff +828 -828
- package/lsp/Handler.ff +714 -714
- package/lsp/HoverHandler.ff +79 -79
- package/lsp/LanguageServer.ff +272 -272
- package/lsp/SignatureHelpHandler.ff +55 -55
- package/lsp/SymbolHandler.ff +181 -181
- package/lsp/TestReferences.ff +17 -17
- package/lsp/TestReferencesCase.ff +7 -7
- package/lsp/stderr.txt +1 -1
- package/lsp/stdout.txt +34 -34
- package/lux/.firefly/package.ff +1 -1
- package/lux/Css.ff +648 -648
- package/lux/CssTest.ff +48 -48
- package/lux/Lux.ff +593 -487
- package/lux/LuxEvent.ff +116 -116
- package/lux/Main.ff +123 -123
- package/lux/Main2.ff +143 -143
- package/lux/TestDry.ff +27 -0
- package/output/js/ff/compiler/Builder.mjs +47 -47
- package/output/js/ff/compiler/Dependencies.mjs +3 -3
- package/output/js/ff/compiler/Inference.mjs +2 -2
- package/output/js/ff/compiler/JsEmitter.mjs +18 -72
- package/output/js/ff/compiler/Main.mjs +4 -4
- package/output/js/ff/compiler/ModuleCache.mjs +4 -4
- package/output/js/ff/core/Array.mjs +59 -59
- package/output/js/ff/core/Atomic.mjs +36 -36
- package/output/js/ff/core/BrowserSystem.mjs +11 -11
- package/output/js/ff/core/BuildSystem.mjs +30 -30
- package/output/js/ff/core/Crypto.mjs +40 -40
- package/output/js/ff/core/Float.mjs +50 -0
- package/output/js/ff/core/HttpClient.mjs +56 -56
- package/output/js/ff/core/Json.mjs +147 -147
- package/output/js/ff/core/List.mjs +50 -50
- package/output/js/ff/core/Lock.mjs +97 -97
- package/output/js/ff/core/NodeSystem.mjs +87 -87
- package/output/js/ff/core/Ordering.mjs +8 -8
- package/output/js/ff/core/Path.mjs +231 -231
- package/output/js/ff/core/Random.mjs +56 -56
- package/output/js/ff/core/Task.mjs +71 -39
- package/output/js/ff/core/Try.mjs +98 -4
- package/package.json +1 -1
- package/postgresql/Pg.ff +1 -1
- package/rpc/.firefly/package.ff +1 -1
- package/rpc/Rpc.ff +70 -70
- package/s3/.firefly/package.ff +1 -1
- package/s3/S3.ff +94 -94
- package/unsafejs/UnsafeJs.ff +19 -19
- package/vscode/LICENSE.txt +21 -21
- package/vscode/Prepublish.ff +15 -15
- package/vscode/README.md +16 -16
- package/vscode/client/package.json +22 -22
- package/vscode/client/src/extension.ts +104 -104
- package/vscode/icons/firefly-icon.svg +10 -10
- package/vscode/language-configuration.json +61 -61
- package/vscode/package-lock.json +3623 -3623
- package/vscode/package.json +1 -1
- package/vscode/snippets.json +241 -241
- package/vscode/syntaxes/firefly-markdown-injection.json +45 -45
- package/webserver/.firefly/include/package-lock.json +22 -22
- package/webserver/.firefly/include/package.json +5 -5
- package/webserver/.firefly/package.ff +2 -2
- package/webserver/WebServer.ff +685 -685
- package/websocket/.firefly/package.ff +1 -1
- package/websocket/WebSocket.ff +131 -131
- package/fireflysite/GuideAll.ff +0 -21
- package/fireflysite/GuideBaseTypes.ff +0 -168
- package/fireflysite/GuideControlFlow.ff +0 -212
- package/fireflysite/assets/markdown/Example.md +0 -78
- /package/fireflysite/assets/{NotoSansMono-Regular.ttf → font/NotoSansMono-Regular.ttf} +0 -0
- /package/fireflysite/assets/{NunitoSans-VariableFont_YTLC,opsz,wdth,wght.ttf → font/NunitoSans-VariableFont_YTLC,opsz,wdth,wght.ttf} +0 -0
- /package/fireflysite/assets/{autocomplete-small.png → image/autocomplete-small.png} +0 -0
- /package/fireflysite/assets/{autocomplete.png → image/autocomplete.png} +0 -0
- /package/fireflysite/assets/{edit-time-error.png → image/edit-time-error.png} +0 -0
- /package/fireflysite/assets/{firefly-logo-notext.png → image/firefly-logo-notext.png} +0 -0
- /package/fireflysite/assets/{firefly-logo-yellow.png → image/firefly-logo-yellow.png} +0 -0
|
@@ -313,12 +313,12 @@ export function ModuleCache_cacheEmittedModule(self_, packagePaths_, packagePair
|
|
|
313
313
|
const path_ = ff_compiler_ModuleCache.modulePath_(packagePaths_, packagePair_, moduleName_);
|
|
314
314
|
if((!ff_core_Map.Map_contains(self_.emittedModules_, ff_core_Path.Path_absolute(path_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))) {
|
|
315
315
|
self_.emittedModules_ = ff_core_Map.Map_add(self_.emittedModules_, ff_core_Path.Path_absolute(path_), self_.version_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
316
|
-
ff_core_Try.
|
|
316
|
+
ff_core_Try.Try_catchAny(ff_core_Core.try_((() => {
|
|
317
317
|
body_(path_)
|
|
318
318
|
})), ((error_) => {
|
|
319
319
|
self_.emittedModules_ = ff_core_Map.Map_remove(self_.emittedModules_, ff_core_Path.Path_absolute(path_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
320
320
|
ff_core_Error.Error_rethrow(error_)
|
|
321
|
-
}))
|
|
321
|
+
}))
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
|
|
@@ -486,12 +486,12 @@ export async function ModuleCache_cacheEmittedModule$(self_, packagePaths_, pack
|
|
|
486
486
|
const path_ = (await ff_compiler_ModuleCache.modulePath_$(packagePaths_, packagePair_, moduleName_, $task));
|
|
487
487
|
if((!ff_core_Map.Map_contains(self_.emittedModules_, (await ff_core_Path.Path_absolute$(path_, $task)), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String))) {
|
|
488
488
|
self_.emittedModules_ = ff_core_Map.Map_add(self_.emittedModules_, (await ff_core_Path.Path_absolute$(path_, $task)), self_.version_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
489
|
-
|
|
489
|
+
(await ff_core_Try.Try_catchAny$((await ff_core_Core.try_$((async ($task) => {
|
|
490
490
|
(await body_(path_, $task))
|
|
491
491
|
}), $task)), (async (error_, $task) => {
|
|
492
492
|
self_.emittedModules_ = ff_core_Map.Map_remove(self_.emittedModules_, (await ff_core_Path.Path_absolute$(path_, $task)), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
493
493
|
ff_core_Error.Error_rethrow(error_)
|
|
494
|
-
}), $task))
|
|
494
|
+
}), $task))
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
|
|
@@ -100,20 +100,20 @@ return {array: []}
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
export function fill_(size_, value_) {
|
|
103
|
-
|
|
104
|
-
return {array: new Array(size_).fill(value_)};
|
|
103
|
+
|
|
104
|
+
return {array: new Array(size_).fill(value_)};
|
|
105
105
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
export function fillBy_(size_, body_) {
|
|
109
|
-
|
|
110
|
-
return {array: Array.from({length: size_}, (_, i) => body_(i))};
|
|
109
|
+
|
|
110
|
+
return {array: Array.from({length: size_}, (_, i) => body_(i))};
|
|
111
111
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
export function range_(size_) {
|
|
115
|
-
|
|
116
|
-
return {array: Array.from({length: size_}, (_, i) => i)};
|
|
115
|
+
|
|
116
|
+
return {array: Array.from({length: size_}, (_, i) => i)};
|
|
117
117
|
|
|
118
118
|
}
|
|
119
119
|
|
|
@@ -146,8 +146,8 @@ j_ += 1
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
export function internalGrab_(self_, index_) {
|
|
149
|
-
|
|
150
|
-
return index_ < 0 || index_ >= self_.array.length ? ff_core_Try.internalThrowGrabException_() : self_.array[index_];
|
|
149
|
+
|
|
150
|
+
return index_ < 0 || index_ >= self_.array.length ? ff_core_Try.internalThrowGrabException_() : self_.array[index_];
|
|
151
151
|
|
|
152
152
|
}
|
|
153
153
|
|
|
@@ -208,16 +208,16 @@ return self_.array.length
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
export function Array_get(self_, index_) {
|
|
211
|
-
|
|
212
|
-
return index_ >= 0 && index_ < self_.array.length
|
|
213
|
-
? ff_core_Option.Some(self_.array[index_])
|
|
214
|
-
: ff_core_Option.None()
|
|
211
|
+
|
|
212
|
+
return index_ >= 0 && index_ < self_.array.length
|
|
213
|
+
? ff_core_Option.Some(self_.array[index_])
|
|
214
|
+
: ff_core_Option.None()
|
|
215
215
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
export function Array_grab(self_, index_) {
|
|
219
|
-
|
|
220
|
-
return self_.array[index_] ?? internalGrab_(self_, index_);
|
|
219
|
+
|
|
220
|
+
return self_.array[index_] ?? internalGrab_(self_, index_);
|
|
221
221
|
|
|
222
222
|
}
|
|
223
223
|
|
|
@@ -230,18 +230,18 @@ return ff_core_Array.Array_grab(self_, (ff_core_Array.Array_size(self_) - 1))
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
export function Array_first(self_) {
|
|
233
|
-
|
|
234
|
-
return self_.array.length > 0
|
|
235
|
-
? ff_core_Option.Some(self_.array[0])
|
|
236
|
-
: ff_core_Option.None()
|
|
233
|
+
|
|
234
|
+
return self_.array.length > 0
|
|
235
|
+
? ff_core_Option.Some(self_.array[0])
|
|
236
|
+
: ff_core_Option.None()
|
|
237
237
|
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
export function Array_last(self_) {
|
|
241
|
-
|
|
242
|
-
return self_.array.length > 0
|
|
243
|
-
? ff_core_Option.Some(self_.array[self_.array.length - 1])
|
|
244
|
-
: ff_core_Option.None()
|
|
241
|
+
|
|
242
|
+
return self_.array.length > 0
|
|
243
|
+
? ff_core_Option.Some(self_.array[self_.array.length - 1])
|
|
244
|
+
: ff_core_Option.None()
|
|
245
245
|
|
|
246
246
|
}
|
|
247
247
|
|
|
@@ -258,70 +258,70 @@ self_.array.push(...value_)
|
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
export function Array_pop(self_) {
|
|
261
|
-
|
|
262
|
-
return self_.array.length > 0
|
|
263
|
-
? ff_core_Option.Some(self_.array.pop())
|
|
264
|
-
: ff_core_Option.None()
|
|
261
|
+
|
|
262
|
+
return self_.array.length > 0
|
|
263
|
+
? ff_core_Option.Some(self_.array.pop())
|
|
264
|
+
: ff_core_Option.None()
|
|
265
265
|
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
export function Array_set(self_, index_, value_) {
|
|
269
|
-
|
|
270
|
-
if(index_ < 0 || index_ > self_.array.length) {
|
|
271
|
-
ff_core_Try.internalThrowGrabException_()
|
|
272
|
-
}
|
|
273
|
-
self_.array[index_] = value_
|
|
269
|
+
|
|
270
|
+
if(index_ < 0 || index_ > self_.array.length) {
|
|
271
|
+
ff_core_Try.internalThrowGrabException_()
|
|
272
|
+
}
|
|
273
|
+
self_.array[index_] = value_
|
|
274
274
|
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
export function Array_modify(self_, index_, body_) {
|
|
278
|
-
|
|
279
|
-
if(index_ < 0 || index_ >= self_.array.length) {
|
|
280
|
-
ff_core_Try.internalThrowGrabException_()
|
|
281
|
-
}
|
|
282
|
-
self_.array[index_] = body_(self_.array[index_])
|
|
278
|
+
|
|
279
|
+
if(index_ < 0 || index_ >= self_.array.length) {
|
|
280
|
+
ff_core_Try.internalThrowGrabException_()
|
|
281
|
+
}
|
|
282
|
+
self_.array[index_] = body_(self_.array[index_])
|
|
283
283
|
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
export function Array_fill(self_, value_, start_ = 0, end_ = 9007199254740991) {
|
|
287
|
-
|
|
288
|
-
self_.array.fill(value_, start_, end_);
|
|
287
|
+
|
|
288
|
+
self_.array.fill(value_, start_, end_);
|
|
289
289
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
export function Array_copy(self_, target_, start_, end_) {
|
|
293
|
-
|
|
294
|
-
self_.array.copyWithin(target_, start_, end_);
|
|
293
|
+
|
|
294
|
+
self_.array.copyWithin(target_, start_, end_);
|
|
295
295
|
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
export function Array_delete(self_, start_, deleteCount_) {
|
|
299
|
-
|
|
300
|
-
self_.array.splice(start_, deleteCount_);
|
|
299
|
+
|
|
300
|
+
self_.array.splice(start_, deleteCount_);
|
|
301
301
|
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
export function Array_insert(self_, start_, value_, deleteCount_ = 0) {
|
|
305
|
-
|
|
306
|
-
self_.array.splice(start_, deleteCount_, value_);
|
|
305
|
+
|
|
306
|
+
self_.array.splice(start_, deleteCount_, value_);
|
|
307
307
|
|
|
308
308
|
}
|
|
309
309
|
|
|
310
310
|
export function Array_insertArray(self_, start_, value_, deleteCount_ = 0) {
|
|
311
|
-
|
|
312
|
-
self_.array.splice(start_, deleteCount_, ...value_.array);
|
|
311
|
+
|
|
312
|
+
self_.array.splice(start_, deleteCount_, ...value_.array);
|
|
313
313
|
|
|
314
314
|
}
|
|
315
315
|
|
|
316
316
|
export function Array_insertList(self_, start_, value_, deleteCount_ = 0) {
|
|
317
|
-
|
|
318
|
-
self_.array.splice(start_, deleteCount_, ...value_);
|
|
317
|
+
|
|
318
|
+
self_.array.splice(start_, deleteCount_, ...value_);
|
|
319
319
|
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
export function Array_each(self_, body_) {
|
|
323
|
-
|
|
324
|
-
return self_.array.forEach(body_);
|
|
323
|
+
|
|
324
|
+
return self_.array.forEach(body_);
|
|
325
325
|
|
|
326
326
|
}
|
|
327
327
|
|
|
@@ -452,11 +452,11 @@ throw new Error('Function Array_set is missing on this target in async context.'
|
|
|
452
452
|
}
|
|
453
453
|
|
|
454
454
|
export async function Array_modify$(self_, index_, body_, $task) {
|
|
455
|
-
|
|
456
|
-
if(index_ < 0 || index_ >= self_.array.length) {
|
|
457
|
-
ff_core_Try.internalThrowGrabException_()
|
|
458
|
-
}
|
|
459
|
-
self_.array[index_] = await body_(self_.array[index_], $task)
|
|
455
|
+
|
|
456
|
+
if(index_ < 0 || index_ >= self_.array.length) {
|
|
457
|
+
ff_core_Try.internalThrowGrabException_()
|
|
458
|
+
}
|
|
459
|
+
self_.array[index_] = await body_(self_.array[index_], $task)
|
|
460
460
|
|
|
461
461
|
}
|
|
462
462
|
|
|
@@ -485,10 +485,10 @@ throw new Error('Function Array_insertList is missing on this target in async co
|
|
|
485
485
|
}
|
|
486
486
|
|
|
487
487
|
export async function Array_each$(self_, body_, $task) {
|
|
488
|
-
|
|
489
|
-
for(let i = 0; i < self_.array.length; i++) {
|
|
490
|
-
await body_(self_.array[i], $task)
|
|
491
|
-
}
|
|
488
|
+
|
|
489
|
+
for(let i = 0; i < self_.array.length; i++) {
|
|
490
|
+
await body_(self_.array[i], $task)
|
|
491
|
+
}
|
|
492
492
|
|
|
493
493
|
}
|
|
494
494
|
|
|
@@ -96,8 +96,8 @@ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
|
96
96
|
|
|
97
97
|
|
|
98
98
|
export function new_(value_) {
|
|
99
|
-
|
|
100
|
-
return {value: value_}
|
|
99
|
+
|
|
100
|
+
return {value: value_}
|
|
101
101
|
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -106,68 +106,68 @@ throw new Error('Function new is missing on this target in async context.');
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
export function Atomic_modify(self_, body_) {
|
|
109
|
-
|
|
110
|
-
return self_.value = body_(self_.value)
|
|
109
|
+
|
|
110
|
+
return self_.value = body_(self_.value)
|
|
111
111
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
export function Atomic_getAndModify(self_, body_) {
|
|
115
|
-
|
|
116
|
-
const currentValue = self_.value
|
|
117
|
-
self_.value = body_(currentValue)
|
|
118
|
-
return currentValue
|
|
115
|
+
|
|
116
|
+
const currentValue = self_.value
|
|
117
|
+
self_.value = body_(currentValue)
|
|
118
|
+
return currentValue
|
|
119
119
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
export function Atomic_get(self_) {
|
|
123
|
-
|
|
124
|
-
return self_.value
|
|
123
|
+
|
|
124
|
+
return self_.value
|
|
125
125
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
export function Atomic_set(self_, value_) {
|
|
129
|
-
|
|
130
|
-
self_.value = value
|
|
129
|
+
|
|
130
|
+
self_.value = value
|
|
131
131
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
export function Atomic_getAndSet(self_, newValue_) {
|
|
135
|
-
|
|
136
|
-
const currentValue = self_.value
|
|
137
|
-
self_.value = newValue
|
|
138
|
-
return currentValue
|
|
135
|
+
|
|
136
|
+
const currentValue = self_.value
|
|
137
|
+
self_.value = newValue
|
|
138
|
+
return currentValue
|
|
139
139
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
export function Atomic_compareAndSet(self_, currentValue_, newValue_) {
|
|
143
|
-
|
|
144
|
-
if(self_.value !== currentValue) return false
|
|
145
|
-
self_.value = newValue
|
|
146
|
-
return true
|
|
143
|
+
|
|
144
|
+
if(self_.value !== currentValue) return false
|
|
145
|
+
self_.value = newValue
|
|
146
|
+
return true
|
|
147
147
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
export async function Atomic_modify$(self_, body_, $task) {
|
|
151
|
-
|
|
152
|
-
let currentValue, newValue
|
|
153
|
-
do {
|
|
154
|
-
currentValue = self_.value
|
|
155
|
-
newValue = await body_(currentValue)
|
|
156
|
-
} while(currentValue !== self_.value)
|
|
157
|
-
self_.value = newValue
|
|
158
|
-
return newValue
|
|
151
|
+
|
|
152
|
+
let currentValue, newValue
|
|
153
|
+
do {
|
|
154
|
+
currentValue = self_.value
|
|
155
|
+
newValue = await body_(currentValue)
|
|
156
|
+
} while(currentValue !== self_.value)
|
|
157
|
+
self_.value = newValue
|
|
158
|
+
return newValue
|
|
159
159
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
export async function Atomic_getAndModify$(self_, body_, $task) {
|
|
163
|
-
|
|
164
|
-
let currentValue, newValue
|
|
165
|
-
do {
|
|
166
|
-
currentValue = self_.value
|
|
167
|
-
newValue = await body_(currentValue)
|
|
168
|
-
} while(currentValue !== self_.value)
|
|
169
|
-
self_.value = newValue
|
|
170
|
-
return currentValue
|
|
163
|
+
|
|
164
|
+
let currentValue, newValue
|
|
165
|
+
do {
|
|
166
|
+
currentValue = self_.value
|
|
167
|
+
newValue = await body_(currentValue)
|
|
168
|
+
} while(currentValue !== self_.value)
|
|
169
|
+
self_.value = newValue
|
|
170
|
+
return currentValue
|
|
171
171
|
|
|
172
172
|
}
|
|
173
173
|
|
|
@@ -148,29 +148,29 @@ return typeof globalThis !== 'undefined' ? globalThis : window
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
export async function BrowserSystem_url$(self_, $task) {
|
|
151
|
-
|
|
152
|
-
return location.href;
|
|
151
|
+
|
|
152
|
+
return location.href;
|
|
153
153
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
export async function BrowserSystem_urlPath$(self_, $task) {
|
|
157
|
-
|
|
158
|
-
return location.pathname;
|
|
157
|
+
|
|
158
|
+
return location.pathname;
|
|
159
159
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
export async function BrowserSystem_urlQuery$(self_, name_, $task) {
|
|
163
|
-
|
|
164
|
-
const param = new URLSearchParams(location.search).get(name_)
|
|
165
|
-
if(param == null) return ff_core_Option.None();
|
|
166
|
-
return ff_core_Option.Some(param);
|
|
163
|
+
|
|
164
|
+
const param = new URLSearchParams(location.search).get(name_)
|
|
165
|
+
if(param == null) return ff_core_Option.None();
|
|
166
|
+
return ff_core_Option.Some(param);
|
|
167
167
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
export async function BrowserSystem_urlFragment$(self_, $task) {
|
|
171
|
-
|
|
172
|
-
if(!location.hash.startsWith('#')) return ff_core_Option.None();
|
|
173
|
-
return ff_core_Option.Some(location.hash.slice(1));
|
|
171
|
+
|
|
172
|
+
if(!location.hash.startsWith('#')) return ff_core_Option.None();
|
|
173
|
+
return ff_core_Option.Some(location.hash.slice(1));
|
|
174
174
|
|
|
175
175
|
}
|
|
176
176
|
|
|
@@ -143,34 +143,34 @@ throw new Error('Function internalMainPackagePair is missing on this target in s
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
export async function internalCallEsBuild_$(self_, mainJsFile_, outputPath_, minify_, sourceMap_, $task) {
|
|
146
|
-
|
|
147
|
-
const esbuild = import$0
|
|
148
|
-
return await esbuild.build({
|
|
149
|
-
entryPoints: [mainJsFile_],
|
|
150
|
-
bundle: true,
|
|
151
|
-
minify: minify_,
|
|
152
|
-
sourcemap: sourceMap_,
|
|
153
|
-
platform: 'browser',
|
|
154
|
-
target: 'es6',
|
|
155
|
-
external: ['../../../node_modules/*'], // TODO
|
|
156
|
-
outfile: outputPath_
|
|
157
|
-
})
|
|
146
|
+
|
|
147
|
+
const esbuild = import$0
|
|
148
|
+
return await esbuild.build({
|
|
149
|
+
entryPoints: [mainJsFile_],
|
|
150
|
+
bundle: true,
|
|
151
|
+
minify: minify_,
|
|
152
|
+
sourcemap: sourceMap_,
|
|
153
|
+
platform: 'browser',
|
|
154
|
+
target: 'es6',
|
|
155
|
+
external: ['../../../node_modules/*'], // TODO
|
|
156
|
+
outfile: outputPath_
|
|
157
|
+
})
|
|
158
158
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
export async function internalNodeCallEsBuild_$(self_, mainJsFile_, outputPath_, minify_, $task) {
|
|
162
|
-
|
|
163
|
-
const esbuild = import$0
|
|
164
|
-
return await esbuild.build({
|
|
165
|
-
entryPoints: [mainJsFile_],
|
|
166
|
-
bundle: true,
|
|
167
|
-
minify: minify_,
|
|
168
|
-
sourcemap: true,
|
|
169
|
-
platform: 'node',
|
|
170
|
-
target: 'es6',
|
|
171
|
-
external: ['../../../node_modules/*'], // TODO
|
|
172
|
-
outfile: outputPath_
|
|
173
|
-
})
|
|
162
|
+
|
|
163
|
+
const esbuild = import$0
|
|
164
|
+
return await esbuild.build({
|
|
165
|
+
entryPoints: [mainJsFile_],
|
|
166
|
+
bundle: true,
|
|
167
|
+
minify: minify_,
|
|
168
|
+
sourcemap: true,
|
|
169
|
+
platform: 'node',
|
|
170
|
+
target: 'es6',
|
|
171
|
+
external: ['../../../node_modules/*'], // TODO
|
|
172
|
+
outfile: outputPath_
|
|
173
|
+
})
|
|
174
174
|
|
|
175
175
|
}
|
|
176
176
|
|
|
@@ -192,20 +192,20 @@ return (await ff_core_Path.Path_readStream$(file_, $task))
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
export async function internalPath_$(buildSystem_, absoluteOrRelative_, $task) {
|
|
195
|
-
|
|
196
|
-
return absoluteOrRelative_
|
|
195
|
+
|
|
196
|
+
return absoluteOrRelative_
|
|
197
197
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
export async function internalCompile_$(buildSystem_, mainFile_, target_, $task) {
|
|
201
|
-
|
|
202
|
-
return await $firefly_compiler.buildViaBuildSystem_$(buildSystem_, buildSystem_.fireflyPath_, mainFile_, target_, $task)
|
|
201
|
+
|
|
202
|
+
return await $firefly_compiler.buildViaBuildSystem_$(buildSystem_, buildSystem_.fireflyPath_, mainFile_, target_, $task)
|
|
203
203
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
export async function internalMainPackagePair_$(buildSystem_, $task) {
|
|
207
|
-
|
|
208
|
-
return {first_: buildSystem_.mainPackagePair_.group_, second_: buildSystem_.mainPackagePair_.name_}
|
|
207
|
+
|
|
208
|
+
return {first_: buildSystem_.mainPackagePair_.group_, second_: buildSystem_.mainPackagePair_.name_}
|
|
209
209
|
|
|
210
210
|
}
|
|
211
211
|
|
|
@@ -100,25 +100,25 @@ throw new Error('Function internalHashPassword is missing on this target in sync
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
export async function internalHashPassword_$(system_, salt_, password_, iterations_, $task) {
|
|
103
|
-
|
|
104
|
-
const keyMaterial = await crypto.subtle.importKey(
|
|
105
|
-
'raw',
|
|
106
|
-
password_,
|
|
107
|
-
{name: 'PBKDF2'},
|
|
108
|
-
false,
|
|
109
|
-
['deriveBits']
|
|
110
|
-
);
|
|
111
|
-
const hashBuffer = await crypto.subtle.deriveBits(
|
|
112
|
-
{
|
|
113
|
-
name: 'PBKDF2',
|
|
114
|
-
salt: salt_,
|
|
115
|
-
iterations: iterations_,
|
|
116
|
-
hash: 'SHA-256'
|
|
117
|
-
},
|
|
118
|
-
keyMaterial,
|
|
119
|
-
256
|
|
120
|
-
);
|
|
121
|
-
return new DataView(hashBuffer);
|
|
103
|
+
|
|
104
|
+
const keyMaterial = await crypto.subtle.importKey(
|
|
105
|
+
'raw',
|
|
106
|
+
password_,
|
|
107
|
+
{name: 'PBKDF2'},
|
|
108
|
+
false,
|
|
109
|
+
['deriveBits']
|
|
110
|
+
);
|
|
111
|
+
const hashBuffer = await crypto.subtle.deriveBits(
|
|
112
|
+
{
|
|
113
|
+
name: 'PBKDF2',
|
|
114
|
+
salt: salt_,
|
|
115
|
+
iterations: iterations_,
|
|
116
|
+
hash: 'SHA-256'
|
|
117
|
+
},
|
|
118
|
+
keyMaterial,
|
|
119
|
+
256
|
|
120
|
+
);
|
|
121
|
+
return new DataView(hashBuffer);
|
|
122
122
|
|
|
123
123
|
}
|
|
124
124
|
|
|
@@ -186,8 +186,8 @@ return (v_ === 0)
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
export async function Crypto_randomUuid$(self_, $task) {
|
|
189
|
-
|
|
190
|
-
return self_.randomUUID();
|
|
189
|
+
|
|
190
|
+
return self_.randomUUID();
|
|
191
191
|
|
|
192
192
|
}
|
|
193
193
|
|
|
@@ -198,33 +198,33 @@ return buffer_
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
export async function Crypto_randomizeBuffer$(self_, buffer_, $task) {
|
|
201
|
-
|
|
202
|
-
self_.getRandomValues(new Uint8Array(buffer_.buffer, buffer_.byteOffset, buffer_.byteLength));
|
|
201
|
+
|
|
202
|
+
self_.getRandomValues(new Uint8Array(buffer_.buffer, buffer_.byteOffset, buffer_.byteLength));
|
|
203
203
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
export async function Crypto_hmacSha256$(self_, key_, buffer_, $task) {
|
|
207
|
-
|
|
208
|
-
const cryptoKey = await self_.subtle.importKey(
|
|
209
|
-
'raw',
|
|
210
|
-
key_,
|
|
211
|
-
{name: 'HMAC', hash: {name: 'SHA-256'}},
|
|
212
|
-
false,
|
|
213
|
-
['sign']
|
|
214
|
-
);
|
|
215
|
-
const signature = await self_.subtle.sign(
|
|
216
|
-
'HMAC',
|
|
217
|
-
cryptoKey,
|
|
218
|
-
buffer_
|
|
219
|
-
);
|
|
220
|
-
return new DataView(signature);
|
|
207
|
+
|
|
208
|
+
const cryptoKey = await self_.subtle.importKey(
|
|
209
|
+
'raw',
|
|
210
|
+
key_,
|
|
211
|
+
{name: 'HMAC', hash: {name: 'SHA-256'}},
|
|
212
|
+
false,
|
|
213
|
+
['sign']
|
|
214
|
+
);
|
|
215
|
+
const signature = await self_.subtle.sign(
|
|
216
|
+
'HMAC',
|
|
217
|
+
cryptoKey,
|
|
218
|
+
buffer_
|
|
219
|
+
);
|
|
220
|
+
return new DataView(signature);
|
|
221
221
|
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
export async function Crypto_sha256$(self_, buffer_, $task) {
|
|
225
|
-
|
|
226
|
-
let hash = await self_.subtle.digest('SHA-256', buffer_);
|
|
227
|
-
return new DataView(hash);
|
|
225
|
+
|
|
226
|
+
let hash = await self_.subtle.digest('SHA-256', buffer_);
|
|
227
|
+
return new DataView(hash);
|
|
228
228
|
|
|
229
229
|
}
|
|
230
230
|
|
|
@@ -149,6 +149,18 @@ export function sqrt2_() {
|
|
|
149
149
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
export function nan_() {
|
|
153
|
+
|
|
154
|
+
return NaN;
|
|
155
|
+
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export function infinity_() {
|
|
159
|
+
|
|
160
|
+
return Infinity;
|
|
161
|
+
|
|
162
|
+
}
|
|
163
|
+
|
|
152
164
|
export async function hypot_$(values_, $task) {
|
|
153
165
|
throw new Error('Function hypot is missing on this target in async context.');
|
|
154
166
|
}
|
|
@@ -185,6 +197,14 @@ export async function sqrt2_$($task) {
|
|
|
185
197
|
throw new Error('Function sqrt2 is missing on this target in async context.');
|
|
186
198
|
}
|
|
187
199
|
|
|
200
|
+
export async function nan_$($task) {
|
|
201
|
+
throw new Error('Function nan is missing on this target in async context.');
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export async function infinity_$($task) {
|
|
205
|
+
throw new Error('Function infinity is missing on this target in async context.');
|
|
206
|
+
}
|
|
207
|
+
|
|
188
208
|
export function Float_toInt(self_) {
|
|
189
209
|
return Math.trunc(self_) || 0
|
|
190
210
|
}
|
|
@@ -374,6 +394,24 @@ export function Float_tanh(self_) {
|
|
|
374
394
|
|
|
375
395
|
}
|
|
376
396
|
|
|
397
|
+
export function Float_isFinite(self_) {
|
|
398
|
+
|
|
399
|
+
return Number.isFinite(self_);
|
|
400
|
+
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export function Float_isNan(self_) {
|
|
404
|
+
|
|
405
|
+
return Number.isNaN(self_);
|
|
406
|
+
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
export function Float_isSafeInteger(self_) {
|
|
410
|
+
|
|
411
|
+
return Number.isSafeInteger(self_);
|
|
412
|
+
|
|
413
|
+
}
|
|
414
|
+
|
|
377
415
|
export async function Float_toInt$(self_, $task) {
|
|
378
416
|
throw new Error('Function Float_toInt is missing on this target in async context.');
|
|
379
417
|
}
|
|
@@ -519,6 +557,18 @@ export async function Float_tanh$(self_, $task) {
|
|
|
519
557
|
throw new Error('Function Float_tanh is missing on this target in async context.');
|
|
520
558
|
}
|
|
521
559
|
|
|
560
|
+
export async function Float_isFinite$(self_, $task) {
|
|
561
|
+
throw new Error('Function Float_isFinite is missing on this target in async context.');
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
export async function Float_isNan$(self_, $task) {
|
|
565
|
+
throw new Error('Function Float_isNan is missing on this target in async context.');
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
export async function Float_isSafeInteger$(self_, $task) {
|
|
569
|
+
throw new Error('Function Float_isSafeInteger is missing on this target in async context.');
|
|
570
|
+
}
|
|
571
|
+
|
|
522
572
|
export const ff_core_Any_HasAnyTag$ff_core_Float_Float = {
|
|
523
573
|
anyTag_() {
|
|
524
574
|
return ff_core_Any.internalAnyTag_((("ff:core/Float.Float" + "[") + "]"))
|