firefly-compiler 0.4.78 → 0.4.80
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/compiler/Builder.ff +2 -2
- package/compiler/Compiler.ff +1 -1
- package/compiler/Inference.ff +2 -1
- package/compiler/JsEmitter.ff +11 -17
- package/compiler/Main.ff +3 -3
- package/compiler/ModuleCache.ff +1 -1
- package/compiler/Tokenizer.ff +1 -1
- package/compiler/Unification.ff +1 -1
- package/core/.firefly/include/package-lock.json +267 -97
- package/core/.firefly/include/package.json +1 -1
- package/core/Float.ff +25 -0
- package/core/Lock.ff +1 -1
- package/core/NodeSystem.ff +1 -1
- package/core/Stream.ff +9 -9
- package/core/Task.ff +3 -3
- package/core/Try.ff +25 -4
- package/experimental/s3/S3TestAuthorizationHeader.ff +2 -1
- package/experimental/s3/S3TestPut.ff +2 -1
- package/fireflysite/CommunityOverview.ff +2 -2
- package/fireflysite/CountingButtonDemo.ff +1 -1
- package/fireflysite/DocumentParser.ff +332 -0
- package/fireflysite/ExamplesOverview.ff +11 -2
- package/fireflysite/FrontPage.ff +344 -0
- package/fireflysite/{GuideIntroduction.ff → GettingStarted.ff} +1 -25
- package/fireflysite/Guide.ff +239 -104
- package/fireflysite/Main.ff +100 -51
- package/fireflysite/MatchingPasswordsDemo.ff +13 -17
- package/fireflysite/PackagesOverview.ff +1 -1
- package/fireflysite/PostgresqlDemo.ff +34 -0
- package/fireflysite/ReferenceAll.ff +19 -0
- package/fireflysite/ReferenceIntroduction.ff +11 -0
- package/fireflysite/Styles.ff +358 -97
- package/fireflysite/Test.ff +38 -0
- package/fireflysite/assets/font/NotoSansMono-Regular.ttf +0 -0
- package/fireflysite/assets/font/NunitoSans-VariableFont_YTLC,opsz,wdth,wght.ttf +0 -0
- package/fireflysite/assets/image/autocomplete-small.png +0 -0
- package/fireflysite/assets/image/autocomplete.png +0 -0
- package/fireflysite/assets/image/edit-time-error.png +0 -0
- package/fireflysite/assets/image/firefly-logo-yellow.png +0 -0
- package/fireflysite/assets/markdown/reference/BaseTypes.md +209 -0
- package/fireflysite/assets/markdown/reference/FunctionsAndMethods.md +208 -0
- package/fireflysite/assets/markdown/reference/ModulesAndPackages.md +168 -0
- package/fireflysite/assets/markdown/reference/PatternMatching.md +224 -0
- package/fireflysite/assets/markdown/reference/StatementsAndExpressions.md +86 -0
- package/fireflysite/assets/markdown/reference/TraitsAndInstances.md +100 -0
- package/fireflysite/assets/markdown/reference/UserDefinedTypes.md +184 -0
- package/fireflysite/assets/markdown/scratch/ControlFlow.md +136 -0
- package/fireflysite/assets/markdown/scratch/Toc.md +41 -0
- package/lsp/Handler.ff +4 -4
- package/lsp/LanguageServer.ff +5 -5
- package/lux/Lux.ff +9 -9
- package/lux/Main2.ff +1 -1
- package/output/js/ff/compiler/Builder.mjs +4 -4
- 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/Float.mjs +50 -0
- package/output/js/ff/core/NodeSystem.mjs +4 -4
- package/output/js/ff/core/Task.mjs +8 -8
- package/output/js/ff/core/Try.mjs +98 -4
- package/package.json +1 -1
- package/postgresql/Pg.ff +1 -1
- package/vscode/package.json +15 -1
- package/vscode/syntaxes/firefly-markdown-injection.json +45 -0
- package/webserver/.firefly/include/package-lock.json +7 -1
- /package/fireflysite/{firefly-logo-notext.png → assets/image/firefly-logo-notext.png} +0 -0
|
@@ -120,11 +120,11 @@ throw new Error('Function internalListDirectoryWithoutOpendir is missing on this
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
export function internalProcessError_(problem_) {
|
|
123
|
-
return ff_core_Try.
|
|
123
|
+
return ff_core_Try.Try_catchAny(ff_core_Core.try_((() => {
|
|
124
124
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_NodeSystem.ProcessException(problem_), ff_core_NodeSystem.ff_core_Any_HasAnyTag$ff_core_NodeSystem_ProcessException)})
|
|
125
125
|
})), ((error_) => {
|
|
126
126
|
return error_
|
|
127
|
-
}))
|
|
127
|
+
}))
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
export function internalWindowsWhere_(system_, cmd_, command_, directory_ = ff_core_Option.None(), environment_ = ff_core_Option.None()) {
|
|
@@ -156,11 +156,11 @@ export async function internalListDirectoryWithoutOpendir_$(system_, path_, $tas
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
export async function internalProcessError_$(problem_, $task) {
|
|
159
|
-
return ff_core_Try.
|
|
159
|
+
return ff_core_Try.Try_catchAny(ff_core_Core.try_((() => {
|
|
160
160
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_NodeSystem.ProcessException(problem_), ff_core_NodeSystem.ff_core_Any_HasAnyTag$ff_core_NodeSystem_ProcessException)})
|
|
161
161
|
})), ((error_) => {
|
|
162
162
|
return error_
|
|
163
|
-
}))
|
|
163
|
+
}))
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
export async function internalWindowsWhere_$(system_, cmd_, command_, directory_ = ff_core_Option.None(), environment_ = ff_core_Option.None(), $task) {
|
|
@@ -215,7 +215,7 @@ const successChannel_ = ff_core_Task.Task_channel(self_, 0);
|
|
|
215
215
|
const failureChannel_ = ff_core_Task.Task_channel(self_, 0);
|
|
216
216
|
ff_core_Task.Task_spawn(self_, ((t_) => {
|
|
217
217
|
const channel_ = ff_core_Task.Task_channel(t_, 0);
|
|
218
|
-
ff_core_Try.
|
|
218
|
+
ff_core_Try.Try_catchAny(ff_core_Core.try_((() => {
|
|
219
219
|
ff_core_List.List_each(ff_core_List.List_pairs(tasks_), ((_1) => {
|
|
220
220
|
{
|
|
221
221
|
const i_ = _1.first_;
|
|
@@ -237,7 +237,7 @@ ff_core_Channel.Channel_write(successChannel_, result_)
|
|
|
237
237
|
})), ((error_) => {
|
|
238
238
|
ff_core_Channel.Channel_write(failureChannel_, error_);
|
|
239
239
|
ff_core_Task.Task_abort(t_)
|
|
240
|
-
}))
|
|
240
|
+
}))
|
|
241
241
|
}));
|
|
242
242
|
return ff_core_Channel.ChannelAction_wait(ff_core_Channel.ChannelAction_readOr(ff_core_Channel.readOr_(successChannel_, ((_w1) => {
|
|
243
243
|
return _w1
|
|
@@ -252,14 +252,14 @@ const failureChannel_ = ff_core_Task.Task_channel(self_, 0);
|
|
|
252
252
|
let live_ = ff_core_List.List_size(tasks_);
|
|
253
253
|
const started_ = ff_core_List.List_map(tasks_, ((task_) => {
|
|
254
254
|
return ff_core_Task.Task_spawn(self_, ((_) => {
|
|
255
|
-
ff_core_Try.
|
|
255
|
+
ff_core_Try.Try_catchAny(ff_core_Core.try_((() => {
|
|
256
256
|
ff_core_Channel.Channel_write(successChannel_, task_())
|
|
257
257
|
})), ((e_) => {
|
|
258
258
|
live_ -= 1;
|
|
259
259
|
if((live_ === 0)) {
|
|
260
260
|
ff_core_Channel.Channel_write(failureChannel_, e_)
|
|
261
261
|
}
|
|
262
|
-
}))
|
|
262
|
+
}))
|
|
263
263
|
}))
|
|
264
264
|
}));
|
|
265
265
|
try {
|
|
@@ -288,7 +288,7 @@ const successChannel_ = (await ff_core_Task.Task_channel$(self_, 0, $task));
|
|
|
288
288
|
const failureChannel_ = (await ff_core_Task.Task_channel$(self_, 0, $task));
|
|
289
289
|
(await ff_core_Task.Task_spawn$(self_, (async (t_, $task) => {
|
|
290
290
|
const channel_ = (await ff_core_Task.Task_channel$(t_, 0, $task));
|
|
291
|
-
|
|
291
|
+
(await ff_core_Try.Try_catchAny$((await ff_core_Core.try_$((async ($task) => {
|
|
292
292
|
(await ff_core_List.List_each$(ff_core_List.List_pairs(tasks_), (async (_1, $task) => {
|
|
293
293
|
{
|
|
294
294
|
const i_ = _1.first_;
|
|
@@ -310,7 +310,7 @@ return _w1.second_
|
|
|
310
310
|
}), $task)), (async (error_, $task) => {
|
|
311
311
|
(await ff_core_Channel.Channel_write$(failureChannel_, error_, $task));
|
|
312
312
|
(await ff_core_Task.Task_abort$(t_, $task))
|
|
313
|
-
}), $task))
|
|
313
|
+
}), $task))
|
|
314
314
|
}), $task));
|
|
315
315
|
return (await ff_core_Channel.ChannelAction_wait$((await ff_core_Channel.ChannelAction_readOr$((await ff_core_Channel.readOr_$(successChannel_, (async (_w1, $task) => {
|
|
316
316
|
return _w1
|
|
@@ -325,14 +325,14 @@ const failureChannel_ = (await ff_core_Task.Task_channel$(self_, 0, $task));
|
|
|
325
325
|
let live_ = ff_core_List.List_size(tasks_);
|
|
326
326
|
const started_ = (await ff_core_List.List_map$(tasks_, (async (task_, $task) => {
|
|
327
327
|
return (await ff_core_Task.Task_spawn$(self_, (async (_, $task) => {
|
|
328
|
-
|
|
328
|
+
(await ff_core_Try.Try_catchAny$((await ff_core_Core.try_$((async ($task) => {
|
|
329
329
|
(await ff_core_Channel.Channel_write$(successChannel_, (await task_($task)), $task))
|
|
330
330
|
}), $task)), (async (e_, $task) => {
|
|
331
331
|
live_ -= 1;
|
|
332
332
|
if((live_ === 0)) {
|
|
333
333
|
(await ff_core_Channel.Channel_write$(failureChannel_, e_, $task))
|
|
334
334
|
}
|
|
335
|
-
}), $task))
|
|
335
|
+
}), $task))
|
|
336
336
|
}), $task))
|
|
337
337
|
}), $task));
|
|
338
338
|
try {
|
|
@@ -139,6 +139,53 @@ return ff_core_Any.fromAny_(any_, ff_core_Any_HasAnyTag$E)
|
|
|
139
139
|
}));
|
|
140
140
|
if(_guard1.Some) {
|
|
141
141
|
const e_ = _guard1.value_;
|
|
142
|
+
return body_(e_, error_)
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
{
|
|
146
|
+
return ff_core_Try.Try_grab(self_)
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function Try_catchAny(self_, body_) {
|
|
152
|
+
{
|
|
153
|
+
const _1 = self_;
|
|
154
|
+
if(_1.Failure) {
|
|
155
|
+
const error_ = _1.error_;
|
|
156
|
+
return body_(error_)
|
|
157
|
+
}
|
|
158
|
+
{
|
|
159
|
+
return ff_core_Try.Try_grab(self_)
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export function Try_finally(self_, body_) {
|
|
165
|
+
{
|
|
166
|
+
const _1 = self_;
|
|
167
|
+
if(_1.Success) {
|
|
168
|
+
const value_ = _1.value_;
|
|
169
|
+
body_();
|
|
170
|
+
return value_
|
|
171
|
+
}
|
|
172
|
+
if(_1.Failure) {
|
|
173
|
+
body_();
|
|
174
|
+
return ff_core_Try.Try_grab(self_)
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function Try_tryCatch(self_, body_, ff_core_Any_HasAnyTag$E) {
|
|
180
|
+
{
|
|
181
|
+
const _1 = self_;
|
|
182
|
+
if(_1.Failure) {
|
|
183
|
+
const error_ = _1.error_;
|
|
184
|
+
const _guard1 = ff_core_Option.Option_flatMap(ff_core_Error.Error_exception(error_), ((any_) => {
|
|
185
|
+
return ff_core_Any.fromAny_(any_, ff_core_Any_HasAnyTag$E)
|
|
186
|
+
}));
|
|
187
|
+
if(_guard1.Some) {
|
|
188
|
+
const e_ = _guard1.value_;
|
|
142
189
|
return ff_core_Core.try_((() => {
|
|
143
190
|
return body_(e_, error_)
|
|
144
191
|
}))
|
|
@@ -151,7 +198,7 @@ return self_
|
|
|
151
198
|
}
|
|
152
199
|
}
|
|
153
200
|
|
|
154
|
-
export function
|
|
201
|
+
export function Try_tryCatchAny(self_, body_) {
|
|
155
202
|
{
|
|
156
203
|
const _1 = self_;
|
|
157
204
|
if(_1.Failure) {
|
|
@@ -167,7 +214,7 @@ return self_
|
|
|
167
214
|
}
|
|
168
215
|
}
|
|
169
216
|
|
|
170
|
-
export function
|
|
217
|
+
export function Try_tryFinally(self_, body_) {
|
|
171
218
|
{
|
|
172
219
|
const _1 = self_;
|
|
173
220
|
if(_1.Success) {
|
|
@@ -267,6 +314,53 @@ return ff_core_Any.fromAny_(any_, ff_core_Any_HasAnyTag$E)
|
|
|
267
314
|
}));
|
|
268
315
|
if(_guard1.Some) {
|
|
269
316
|
const e_ = _guard1.value_;
|
|
317
|
+
return (await body_(e_, error_, $task))
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
{
|
|
321
|
+
return ff_core_Try.Try_grab(self_)
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export async function Try_catchAny$(self_, body_, $task) {
|
|
327
|
+
{
|
|
328
|
+
const _1 = self_;
|
|
329
|
+
if(_1.Failure) {
|
|
330
|
+
const error_ = _1.error_;
|
|
331
|
+
return (await body_(error_, $task))
|
|
332
|
+
}
|
|
333
|
+
{
|
|
334
|
+
return ff_core_Try.Try_grab(self_)
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export async function Try_finally$(self_, body_, $task) {
|
|
340
|
+
{
|
|
341
|
+
const _1 = self_;
|
|
342
|
+
if(_1.Success) {
|
|
343
|
+
const value_ = _1.value_;
|
|
344
|
+
(await body_($task));
|
|
345
|
+
return value_
|
|
346
|
+
}
|
|
347
|
+
if(_1.Failure) {
|
|
348
|
+
(await body_($task));
|
|
349
|
+
return ff_core_Try.Try_grab(self_)
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export async function Try_tryCatch$(self_, body_, ff_core_Any_HasAnyTag$E, $task) {
|
|
355
|
+
{
|
|
356
|
+
const _1 = self_;
|
|
357
|
+
if(_1.Failure) {
|
|
358
|
+
const error_ = _1.error_;
|
|
359
|
+
const _guard1 = ff_core_Option.Option_flatMap(ff_core_Error.Error_exception(error_), ((any_) => {
|
|
360
|
+
return ff_core_Any.fromAny_(any_, ff_core_Any_HasAnyTag$E)
|
|
361
|
+
}));
|
|
362
|
+
if(_guard1.Some) {
|
|
363
|
+
const e_ = _guard1.value_;
|
|
270
364
|
return (await ff_core_Core.try_$((async ($task) => {
|
|
271
365
|
return (await body_(e_, error_, $task))
|
|
272
366
|
}), $task))
|
|
@@ -279,7 +373,7 @@ return self_
|
|
|
279
373
|
}
|
|
280
374
|
}
|
|
281
375
|
|
|
282
|
-
export async function
|
|
376
|
+
export async function Try_tryCatchAny$(self_, body_, $task) {
|
|
283
377
|
{
|
|
284
378
|
const _1 = self_;
|
|
285
379
|
if(_1.Failure) {
|
|
@@ -295,7 +389,7 @@ return self_
|
|
|
295
389
|
}
|
|
296
390
|
}
|
|
297
391
|
|
|
298
|
-
export async function
|
|
392
|
+
export async function Try_tryFinally$(self_, body_, $task) {
|
|
299
393
|
{
|
|
300
394
|
const _1 = self_;
|
|
301
395
|
if(_1.Success) {
|
package/package.json
CHANGED
package/postgresql/Pg.ff
CHANGED
package/vscode/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"description": "Firefly language support",
|
|
5
5
|
"author": "Firefly team",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"version": "0.4.
|
|
7
|
+
"version": "0.4.80",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/Ahnfelt/firefly-boot"
|
|
@@ -37,6 +37,9 @@
|
|
|
37
37
|
"light": "./icons/firefly-icon.svg",
|
|
38
38
|
"dark": "./icons/firefly-icon.svg"
|
|
39
39
|
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": "firefly-markdown-injection"
|
|
40
43
|
}
|
|
41
44
|
],
|
|
42
45
|
"grammars": [
|
|
@@ -47,6 +50,17 @@
|
|
|
47
50
|
"embeddedLanguages": {
|
|
48
51
|
"meta.embedded.block.javascript": "javascript"
|
|
49
52
|
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"language": "firefly-markdown-injection",
|
|
56
|
+
"scopeName": "markdown.firefly.codeblock",
|
|
57
|
+
"path": "./syntaxes/firefly-markdown-injection.json",
|
|
58
|
+
"injectTo": [
|
|
59
|
+
"text.html.markdown"
|
|
60
|
+
],
|
|
61
|
+
"embeddedLanguages": {
|
|
62
|
+
"meta.embedded.block.firefly": "firefly"
|
|
63
|
+
}
|
|
50
64
|
}
|
|
51
65
|
],
|
|
52
66
|
"problemMatchers": [
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"fileTypes": [],
|
|
3
|
+
"injectionSelector": "L:text.html.markdown",
|
|
4
|
+
"patterns": [
|
|
5
|
+
{
|
|
6
|
+
"include": "#firefly-code-block"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"repository": {
|
|
10
|
+
"firefly-code-block": {
|
|
11
|
+
"begin": "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(firefly)(\\s+[^`~]*)?$)",
|
|
12
|
+
"name": "markup.fenced_code.block.markdown",
|
|
13
|
+
"end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
|
|
14
|
+
"beginCaptures": {
|
|
15
|
+
"3": {
|
|
16
|
+
"name": "punctuation.definition.markdown"
|
|
17
|
+
},
|
|
18
|
+
"4": {
|
|
19
|
+
"name": "fenced_code.block.language.markdown"
|
|
20
|
+
},
|
|
21
|
+
"5": {
|
|
22
|
+
"name": "fenced_code.block.language.attributes.markdown"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"endCaptures": {
|
|
26
|
+
"3": {
|
|
27
|
+
"name": "punctuation.definition.markdown"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"patterns": [
|
|
31
|
+
{
|
|
32
|
+
"begin": "(^|\\G)(\\s*)(.*)",
|
|
33
|
+
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
|
|
34
|
+
"contentName": "meta.embedded.block.firefly",
|
|
35
|
+
"patterns": [
|
|
36
|
+
{
|
|
37
|
+
"include": "source.firefly"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"scopeName": "markdown.firefly.codeblock"
|
|
45
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "include",
|
|
3
|
-
"lockfileVersion":
|
|
3
|
+
"lockfileVersion": 2,
|
|
4
4
|
"requires": true,
|
|
5
5
|
"packages": {
|
|
6
6
|
"": {
|
|
@@ -12,5 +12,11 @@
|
|
|
12
12
|
"version": "20.41.0",
|
|
13
13
|
"resolved": "git+ssh://git@github.com/uNetworking/uWebSockets.js.git#105d9ec47126cb82e4a6f3a08aa2ac78b4bb14f1"
|
|
14
14
|
}
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"uWebSockets.js": {
|
|
18
|
+
"version": "git+ssh://git@github.com/uNetworking/uWebSockets.js.git#105d9ec47126cb82e4a6f3a08aa2ac78b4bb14f1",
|
|
19
|
+
"from": "uWebSockets.js@github:uNetworking/uWebSockets.js#v20.41.0"
|
|
20
|
+
}
|
|
15
21
|
}
|
|
16
22
|
}
|
|
File without changes
|