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.
Files changed (164) hide show
  1. package/.hintrc +4 -4
  2. package/.vscode/settings.json +4 -4
  3. package/bin/Release.ff +153 -153
  4. package/bin/firefly.mjs +1 -1
  5. package/compiler/Builder.ff +257 -257
  6. package/compiler/Compiler.ff +227 -227
  7. package/compiler/Dependencies.ff +187 -187
  8. package/compiler/DependencyLock.ff +17 -17
  9. package/compiler/Inference.ff +2 -1
  10. package/compiler/JsEmitter.ff +940 -946
  11. package/compiler/LspHook.ff +202 -202
  12. package/compiler/Main.ff +3 -3
  13. package/compiler/ModuleCache.ff +178 -178
  14. package/compiler/Tokenizer.ff +1 -1
  15. package/compiler/Unification.ff +1 -1
  16. package/compiler/Workspace.ff +88 -88
  17. package/core/.firefly/include/package-lock.json +564 -564
  18. package/core/.firefly/include/package.json +5 -5
  19. package/core/.firefly/include/prepare.sh +1 -1
  20. package/core/.firefly/package.ff +2 -2
  21. package/core/Array.ff +265 -265
  22. package/core/Atomic.ff +64 -64
  23. package/core/Box.ff +7 -7
  24. package/core/BrowserSystem.ff +40 -40
  25. package/core/BuildSystem.ff +148 -148
  26. package/core/Crypto.ff +96 -96
  27. package/core/Equal.ff +36 -36
  28. package/core/Float.ff +25 -0
  29. package/core/HttpClient.ff +148 -148
  30. package/core/JsSystem.ff +69 -69
  31. package/core/Json.ff +434 -434
  32. package/core/List.ff +486 -486
  33. package/core/Lock.ff +144 -144
  34. package/core/NodeSystem.ff +216 -216
  35. package/core/Ordering.ff +161 -161
  36. package/core/Path.ff +401 -401
  37. package/core/Random.ff +134 -134
  38. package/core/RbMap.ff +216 -216
  39. package/core/Show.ff +43 -43
  40. package/core/SourceLocation.ff +68 -68
  41. package/core/Stream.ff +9 -9
  42. package/core/Task.ff +149 -141
  43. package/core/Try.ff +25 -4
  44. package/experimental/benchmarks/ListGrab.ff +23 -23
  45. package/experimental/benchmarks/ListGrab.java +55 -55
  46. package/experimental/benchmarks/Pyrotek45.ff +30 -30
  47. package/experimental/benchmarks/Pyrotek45.java +64 -64
  48. package/experimental/bidirectional/Bidi.ff +88 -88
  49. package/experimental/random/Index.ff +53 -53
  50. package/experimental/random/Process.ff +120 -120
  51. package/experimental/random/Scrape.ff +51 -51
  52. package/experimental/random/Symbols.ff +73 -73
  53. package/experimental/random/Tensor.ff +52 -52
  54. package/experimental/random/Units.ff +36 -36
  55. package/experimental/s3/S3TestAuthorizationHeader.ff +39 -39
  56. package/experimental/s3/S3TestPut.ff +16 -16
  57. package/experimental/tests/TestJson.ff +26 -26
  58. package/firefly.sh +0 -0
  59. package/fireflysite/.firefly/package.ff +4 -4
  60. package/fireflysite/CommunityOverview.ff +20 -20
  61. package/fireflysite/CountingButtonDemo.ff +58 -58
  62. package/fireflysite/DocumentParser.ff +331 -217
  63. package/fireflysite/ExamplesOverview.ff +40 -40
  64. package/fireflysite/FrontPage.ff +344 -360
  65. package/fireflysite/{GuideIntroduction.ff → GettingStarted.ff} +45 -52
  66. package/fireflysite/Guide.ff +442 -411
  67. package/fireflysite/Main.ff +151 -137
  68. package/fireflysite/MatchingPasswordsDemo.ff +82 -82
  69. package/fireflysite/PackagesOverview.ff +49 -49
  70. package/fireflysite/PostgresqlDemo.ff +34 -34
  71. package/fireflysite/ReferenceAll.ff +18 -0
  72. package/fireflysite/ReferenceIntroduction.ff +11 -0
  73. package/fireflysite/Styles.ff +567 -495
  74. package/fireflysite/Test.ff +46 -0
  75. package/fireflysite/assets/markdown/reference/BaseTypes.md +209 -0
  76. package/fireflysite/assets/markdown/reference/EmittedJavascript.md +66 -0
  77. package/fireflysite/assets/markdown/reference/Exceptions.md +101 -0
  78. package/fireflysite/assets/markdown/reference/FunctionsAndMethods.md +338 -0
  79. package/fireflysite/assets/markdown/reference/JavascriptInterop.md +134 -0
  80. package/fireflysite/assets/markdown/reference/ModulesAndPackages.md +162 -0
  81. package/fireflysite/assets/markdown/reference/OldStructuredConcurrency.md +48 -0
  82. package/fireflysite/assets/markdown/reference/PatternMatching.md +224 -0
  83. package/fireflysite/assets/markdown/reference/StatementsAndExpressions.md +86 -0
  84. package/fireflysite/assets/markdown/reference/StructuredConcurrency.md +99 -0
  85. package/fireflysite/assets/markdown/reference/TraitsAndInstances.md +100 -0
  86. package/fireflysite/assets/markdown/reference/UserDefinedTypes.md +184 -0
  87. package/fireflysite/assets/markdown/{ControlFlow.md → scratch/ControlFlow.md} +136 -136
  88. package/fireflysite/assets/markdown/scratch/Toc.md +41 -0
  89. package/lsp/.firefly/package.ff +1 -1
  90. package/lsp/CompletionHandler.ff +828 -828
  91. package/lsp/Handler.ff +714 -714
  92. package/lsp/HoverHandler.ff +79 -79
  93. package/lsp/LanguageServer.ff +272 -272
  94. package/lsp/SignatureHelpHandler.ff +55 -55
  95. package/lsp/SymbolHandler.ff +181 -181
  96. package/lsp/TestReferences.ff +17 -17
  97. package/lsp/TestReferencesCase.ff +7 -7
  98. package/lsp/stderr.txt +1 -1
  99. package/lsp/stdout.txt +34 -34
  100. package/lux/.firefly/package.ff +1 -1
  101. package/lux/Css.ff +648 -648
  102. package/lux/CssTest.ff +48 -48
  103. package/lux/Lux.ff +593 -487
  104. package/lux/LuxEvent.ff +116 -116
  105. package/lux/Main.ff +123 -123
  106. package/lux/Main2.ff +143 -143
  107. package/lux/TestDry.ff +27 -0
  108. package/output/js/ff/compiler/Builder.mjs +47 -47
  109. package/output/js/ff/compiler/Dependencies.mjs +3 -3
  110. package/output/js/ff/compiler/Inference.mjs +2 -2
  111. package/output/js/ff/compiler/JsEmitter.mjs +18 -72
  112. package/output/js/ff/compiler/Main.mjs +4 -4
  113. package/output/js/ff/compiler/ModuleCache.mjs +4 -4
  114. package/output/js/ff/core/Array.mjs +59 -59
  115. package/output/js/ff/core/Atomic.mjs +36 -36
  116. package/output/js/ff/core/BrowserSystem.mjs +11 -11
  117. package/output/js/ff/core/BuildSystem.mjs +30 -30
  118. package/output/js/ff/core/Crypto.mjs +40 -40
  119. package/output/js/ff/core/Float.mjs +50 -0
  120. package/output/js/ff/core/HttpClient.mjs +56 -56
  121. package/output/js/ff/core/Json.mjs +147 -147
  122. package/output/js/ff/core/List.mjs +50 -50
  123. package/output/js/ff/core/Lock.mjs +97 -97
  124. package/output/js/ff/core/NodeSystem.mjs +87 -87
  125. package/output/js/ff/core/Ordering.mjs +8 -8
  126. package/output/js/ff/core/Path.mjs +231 -231
  127. package/output/js/ff/core/Random.mjs +56 -56
  128. package/output/js/ff/core/Task.mjs +71 -39
  129. package/output/js/ff/core/Try.mjs +98 -4
  130. package/package.json +1 -1
  131. package/postgresql/Pg.ff +1 -1
  132. package/rpc/.firefly/package.ff +1 -1
  133. package/rpc/Rpc.ff +70 -70
  134. package/s3/.firefly/package.ff +1 -1
  135. package/s3/S3.ff +94 -94
  136. package/unsafejs/UnsafeJs.ff +19 -19
  137. package/vscode/LICENSE.txt +21 -21
  138. package/vscode/Prepublish.ff +15 -15
  139. package/vscode/README.md +16 -16
  140. package/vscode/client/package.json +22 -22
  141. package/vscode/client/src/extension.ts +104 -104
  142. package/vscode/icons/firefly-icon.svg +10 -10
  143. package/vscode/language-configuration.json +61 -61
  144. package/vscode/package-lock.json +3623 -3623
  145. package/vscode/package.json +1 -1
  146. package/vscode/snippets.json +241 -241
  147. package/vscode/syntaxes/firefly-markdown-injection.json +45 -45
  148. package/webserver/.firefly/include/package-lock.json +22 -22
  149. package/webserver/.firefly/include/package.json +5 -5
  150. package/webserver/.firefly/package.ff +2 -2
  151. package/webserver/WebServer.ff +685 -685
  152. package/websocket/.firefly/package.ff +1 -1
  153. package/websocket/WebSocket.ff +131 -131
  154. package/fireflysite/GuideAll.ff +0 -21
  155. package/fireflysite/GuideBaseTypes.ff +0 -168
  156. package/fireflysite/GuideControlFlow.ff +0 -212
  157. package/fireflysite/assets/markdown/Example.md +0 -78
  158. /package/fireflysite/assets/{NotoSansMono-Regular.ttf → font/NotoSansMono-Regular.ttf} +0 -0
  159. /package/fireflysite/assets/{NunitoSans-VariableFont_YTLC,opsz,wdth,wght.ttf → font/NunitoSans-VariableFont_YTLC,opsz,wdth,wght.ttf} +0 -0
  160. /package/fireflysite/assets/{autocomplete-small.png → image/autocomplete-small.png} +0 -0
  161. /package/fireflysite/assets/{autocomplete.png → image/autocomplete.png} +0 -0
  162. /package/fireflysite/assets/{edit-time-error.png → image/edit-time-error.png} +0 -0
  163. /package/fireflysite/assets/{firefly-logo-notext.png → image/firefly-logo-notext.png} +0 -0
  164. /package/fireflysite/assets/{firefly-logo-yellow.png → image/firefly-logo-yellow.png} +0 -0
package/lux/Main2.ff CHANGED
@@ -1,143 +1,143 @@
1
- import HttpServer from ff:httpserver
2
-
3
- import Lux
4
- import LuxEvent
5
-
6
-
7
- mainComponent(lux: Lux, system: BrowserSystem) {
8
- sleepComponent(lux, system)
9
- }
10
-
11
- sleepComponent(lux: Lux, system: BrowserSystem) {
12
- lux.useState(False): start, setStart =>
13
- if(start) {
14
- lux.useSuspense {
15
- lux.div {
16
- lux.div {lux.text("Sleeping")}
17
- lux.button {
18
- lux.text("Cancel")
19
- lux.onClick {event =>
20
- event.preventDefault()
21
- setStart(False)
22
- }
23
- }
24
- }
25
- } {lux =>
26
- trySleep(lux.task, "A")
27
- lux.div {lux.text("Done sleeping")}
28
- }
29
- } else {
30
- lux.button {
31
- lux.text("Start")
32
- lux.onClick {event =>
33
- event.preventDefault()
34
- setStart(True)
35
- }
36
- }
37
- }
38
- }
39
-
40
- ifComponent(lux: Lux, system: BrowserSystem) {
41
- lux.useState(False): start, setStart =>
42
- if(start) {
43
- lux.div {lux.text("Started")}
44
- } else {
45
- lux.button {
46
- lux.text("Start")
47
- lux.onClick {event =>
48
- event.preventDefault()
49
- setStart(True)
50
- }
51
- }
52
- }
53
- }
54
-
55
- rhymeComponent(lux: Lux, system: BrowserSystem) {
56
- lux.div {
57
- lux.useState(0): count, setCount =>
58
- Log.debug("useState(0)")
59
- lux.useState("Ɛ"): text, setText =>
60
- lux.div {
61
- lux.button {
62
- lux.text("Count: " + count)
63
- lux.onClick {event =>
64
- setCount(count + 1)
65
- }
66
- }
67
- lux.div {
68
- lux.useCallback1(setText): setText =>
69
- lux.useLazy1(text): text =>
70
- lux.div {
71
- lux.div {
72
- lux.text("Text: " + text + " -> ")
73
- lux.useSuspense {lux.span {lux.text("Rhyming...")}} {lux =>
74
- lux.span {
75
- lux.text(rhyme(system, text))
76
- }
77
- }
78
- }
79
- lux.input {
80
- lux.setValue(text)
81
- Log.debug("setValue: " + text)
82
- lux.onInput {event =>
83
- Log.debug(text + " -> " + event.text())
84
- setText(event.text())
85
- }
86
- }
87
- }
88
- }
89
- }
90
- }
91
- }
92
-
93
-
94
- rhyme(system: BrowserSystem, text: String): String {
95
- let json = system.httpClient().get("https://api.datamuse.com/words?rel_rhy=" + text, []) {_.readJson()}
96
- json.index(0).field("word").getString().else {"?"}
97
- }
98
-
99
- browserMain(system: BrowserSystem): Unit {
100
- Lux.renderById(system, "main") {lux =>
101
- lux.div {
102
- mainComponent(lux, system)
103
- }
104
- }
105
- }
106
-
107
- nodeMain(system: NodeSystem): Unit {
108
- HttpServer.listen(system, "localhost", 8080) {request, response =>
109
- if(request.path() == "/") {
110
- response.setHeader("Content-Type", ["text/html; charset=UTF-8"])
111
- response.writeText("<!doctype html>")
112
- response.writeText("<div id='main'></div>")
113
- response.writeText("<script type='module' src='/js/script/script/Main2.mjs'></script>")
114
- } elseIf {request.path().startsWith("/js/") && !request.path().contains("..")} {
115
- response.setHeader("Content-Type", ["text/javascript; charset=UTF-8"])
116
- response.writeText(system.assets().readText(request.path()))
117
- } elseIf {request.path() == "/chat"} {
118
- system.mainTask().sleep(Duration(request.readText().size().toFloat()))
119
- response.setHeader("Content-Type", ["text/plain; charset=UTF-8"])
120
- response.writeText("Hello there!")
121
- } else {
122
- response.writeStatus(404, Some("Not found"))
123
- }
124
- }
125
- }
126
-
127
- buildMain(system: BuildSystem) {
128
- let browser = system.compileForBrowser("Main2.ff")
129
- let assets = AssetSystem.create().addAssets("/js", browser.assets())
130
- system.setAssets(assets)
131
- }
132
-
133
- trySleep(task: Task, name: String) {
134
- try {
135
- task.sleep(Duration(4.0))
136
- Log.debug("Slept!")
137
- } catchAny {error =>
138
- if(error.name() == "AbortError") {
139
- Log.debug(name + " aborted")
140
- }
141
- error.rethrow()
142
- } grab()
143
- }
1
+ import HttpServer from ff:httpserver
2
+
3
+ import Lux
4
+ import LuxEvent
5
+
6
+
7
+ mainComponent(lux: Lux, system: BrowserSystem) {
8
+ sleepComponent(lux, system)
9
+ }
10
+
11
+ sleepComponent(lux: Lux, system: BrowserSystem) {
12
+ lux.useState(False): start, setStart =>
13
+ if(start) {
14
+ lux.useSuspense {
15
+ lux.div {
16
+ lux.div {lux.text("Sleeping")}
17
+ lux.button {
18
+ lux.text("Cancel")
19
+ lux.onClick {event =>
20
+ event.preventDefault()
21
+ setStart(False)
22
+ }
23
+ }
24
+ }
25
+ } {lux =>
26
+ trySleep(lux.task, "A")
27
+ lux.div {lux.text("Done sleeping")}
28
+ }
29
+ } else {
30
+ lux.button {
31
+ lux.text("Start")
32
+ lux.onClick {event =>
33
+ event.preventDefault()
34
+ setStart(True)
35
+ }
36
+ }
37
+ }
38
+ }
39
+
40
+ ifComponent(lux: Lux, system: BrowserSystem) {
41
+ lux.useState(False): start, setStart =>
42
+ if(start) {
43
+ lux.div {lux.text("Started")}
44
+ } else {
45
+ lux.button {
46
+ lux.text("Start")
47
+ lux.onClick {event =>
48
+ event.preventDefault()
49
+ setStart(True)
50
+ }
51
+ }
52
+ }
53
+ }
54
+
55
+ rhymeComponent(lux: Lux, system: BrowserSystem) {
56
+ lux.div {
57
+ lux.useState(0): count, setCount =>
58
+ Log.debug("useState(0)")
59
+ lux.useState("Ɛ"): text, setText =>
60
+ lux.div {
61
+ lux.button {
62
+ lux.text("Count: " + count)
63
+ lux.onClick {event =>
64
+ setCount(count + 1)
65
+ }
66
+ }
67
+ lux.div {
68
+ lux.useCallback1(setText): setText =>
69
+ lux.useLazy1(text): text =>
70
+ lux.div {
71
+ lux.div {
72
+ lux.text("Text: " + text + " -> ")
73
+ lux.useSuspense {lux.span {lux.text("Rhyming...")}} {lux =>
74
+ lux.span {
75
+ lux.text(rhyme(system, text))
76
+ }
77
+ }
78
+ }
79
+ lux.input {
80
+ lux.setValue(text)
81
+ Log.debug("setValue: " + text)
82
+ lux.onInput {event =>
83
+ Log.debug(text + " -> " + event.text())
84
+ setText(event.text())
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
91
+ }
92
+
93
+
94
+ rhyme(system: BrowserSystem, text: String): String {
95
+ let json = system.httpClient().get("https://api.datamuse.com/words?rel_rhy=" + text, []) {_.readJson()}
96
+ json.index(0).field("word").getString().else {"?"}
97
+ }
98
+
99
+ browserMain(system: BrowserSystem): Unit {
100
+ Lux.renderById(system, "main") {lux =>
101
+ lux.div {
102
+ mainComponent(lux, system)
103
+ }
104
+ }
105
+ }
106
+
107
+ nodeMain(system: NodeSystem): Unit {
108
+ HttpServer.listen(system, "localhost", 8080) {request, response =>
109
+ if(request.path() == "/") {
110
+ response.setHeader("Content-Type", ["text/html; charset=UTF-8"])
111
+ response.writeText("<!doctype html>")
112
+ response.writeText("<div id='main'></div>")
113
+ response.writeText("<script type='module' src='/js/script/script/Main2.mjs'></script>")
114
+ } elseIf {request.path().startsWith("/js/") && !request.path().contains("..")} {
115
+ response.setHeader("Content-Type", ["text/javascript; charset=UTF-8"])
116
+ response.writeText(system.assets().readText(request.path()))
117
+ } elseIf {request.path() == "/chat"} {
118
+ system.mainTask().sleep(Duration(request.readText().size().toFloat()))
119
+ response.setHeader("Content-Type", ["text/plain; charset=UTF-8"])
120
+ response.writeText("Hello there!")
121
+ } else {
122
+ response.writeStatus(404, Some("Not found"))
123
+ }
124
+ }
125
+ }
126
+
127
+ buildMain(system: BuildSystem) {
128
+ let browser = system.compileForBrowser("Main2.ff")
129
+ let assets = AssetSystem.create().addAssets("/js", browser.assets())
130
+ system.setAssets(assets)
131
+ }
132
+
133
+ trySleep(task: Task, name: String) {
134
+ try {
135
+ task.sleep(Duration(4.0))
136
+ Log.debug("Slept!")
137
+ } catchAny {error =>
138
+ if(error.name() == "AbortError") {
139
+ Log.debug(name + " aborted")
140
+ }
141
+ error.rethrow()
142
+ }
143
+ }
package/lux/TestDry.ff ADDED
@@ -0,0 +1,27 @@
1
+ import Lux
2
+
3
+ nodeMain(system: NodeSystem) {
4
+
5
+
6
+
7
+ let html = Lux.renderToString(system, render)
8
+ Log.trace(html)
9
+
10
+ }
11
+
12
+ render(lux: Lux): Unit {
13
+ lux.div {
14
+ lux.set("id", "its-me")
15
+ lux.span {
16
+ lux.text("Hello")
17
+ lux.div {
18
+ lux.set("id", "it's \"a-me\"")
19
+ lux.span {
20
+ lux.text("Hello ]]>")
21
+ }
22
+ lux.text("Hi")
23
+ }
24
+ }
25
+ lux.text("Hi")
26
+ }
27
+ }
@@ -203,7 +203,7 @@ return (!ff_core_Path.Path_contains(_w1, [".firefly", "dependencies"]))
203
203
  })));
204
204
  ff_core_List.List_each(files_, ((file_) => {
205
205
  const localFile_ = ff_core_Path.Path_base(file_);
206
- ff_core_Try.Try_grab(ff_core_Try.Try_catch(ff_core_Try.Try_catch(ff_core_Core.try_((() => {
206
+ ff_core_Try.Try_catch(ff_core_Try.Try_tryCatch(ff_core_Core.try_((() => {
207
207
  if(infer_) {
208
208
  ff_compiler_Compiler.Compiler_infer(compiler_, resolvedDependencies_.mainPackagePair_, ff_core_String.String_dropLast(localFile_, ff_core_String.String_size(".ff")))
209
209
  } else {
@@ -223,7 +223,7 @@ const error_ = _2;
223
223
  ff_core_Array.Array_pushList(errors_, compileErrors_)
224
224
  return
225
225
  }
226
- }), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileErrors))
226
+ }), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileErrors)
227
227
  }));
228
228
  ff_compiler_ModuleCache.ModuleCache_mergeVersions(cache_, compiler_.cache_)
229
229
  }));
@@ -287,24 +287,24 @@ ff_core_Path.Path_writeStream(p_, makeStream_(), false)
287
287
  return
288
288
  }
289
289
  }));
290
- const json_ = `{
291
- "name": "main",
292
- "bin": {
293
- "firefly-main": "Main.bundle.js"
294
- },
295
- "devDependencies": {
296
- "pkg": "^5.8.0"
297
- },
298
- "pkg": {
299
- "scripts": "Main.bundle.js",
300
- "outputPath": "bin",
301
- "assets": ["../assets/**/*"],
302
- "targets": [
303
- "node18-linux-x64",
304
- "node18-macos-x64",
305
- "node18-win-x64"
306
- ]
307
- }
290
+ const json_ = `{
291
+ "name": "main",
292
+ "bin": {
293
+ "firefly-main": "Main.bundle.js"
294
+ },
295
+ "devDependencies": {
296
+ "pkg": "^5.8.0"
297
+ },
298
+ "pkg": {
299
+ "scripts": "Main.bundle.js",
300
+ "outputPath": "bin",
301
+ "assets": ["../assets/**/*"],
302
+ "targets": [
303
+ "node18-linux-x64",
304
+ "node18-macos-x64",
305
+ "node18-win-x64"
306
+ ]
307
+ }
308
308
  }`;
309
309
  const packageFile_ = ff_core_Path.Path_slash(outputPath_, "executable/package.json");
310
310
  ff_core_Path.Path_writeText(packageFile_, json_);
@@ -397,7 +397,7 @@ return (!(await ff_core_Path.Path_contains$(_w1, [".firefly", "dependencies"], $
397
397
  }), $task)));
398
398
  (await ff_core_List.List_each$(files_, (async (file_, $task) => {
399
399
  const localFile_ = (await ff_core_Path.Path_base$(file_, $task));
400
- ff_core_Try.Try_grab(ff_core_Try.Try_catch(ff_core_Try.Try_catch((await ff_core_Core.try_$((async ($task) => {
400
+ ff_core_Try.Try_catch(ff_core_Try.Try_tryCatch((await ff_core_Core.try_$((async ($task) => {
401
401
  if(infer_) {
402
402
  (await ff_compiler_Compiler.Compiler_infer$(compiler_, resolvedDependencies_.mainPackagePair_, ff_core_String.String_dropLast(localFile_, ff_core_String.String_size(".ff")), $task))
403
403
  } else {
@@ -417,7 +417,7 @@ const error_ = _2;
417
417
  ff_core_Array.Array_pushList(errors_, compileErrors_)
418
418
  return
419
419
  }
420
- }), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileErrors))
420
+ }), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileErrors)
421
421
  }), $task));
422
422
  ff_compiler_ModuleCache.ModuleCache_mergeVersions(cache_, compiler_.cache_)
423
423
  }), $task));
@@ -481,24 +481,24 @@ const p_ = (await ff_core_Path.Path_slash$(assetOutputPath_, path_, $task));
481
481
  return
482
482
  }
483
483
  }), $task));
484
- const json_ = `{
485
- "name": "main",
486
- "bin": {
487
- "firefly-main": "Main.bundle.js"
488
- },
489
- "devDependencies": {
490
- "pkg": "^5.8.0"
491
- },
492
- "pkg": {
493
- "scripts": "Main.bundle.js",
494
- "outputPath": "bin",
495
- "assets": ["../assets/**/*"],
496
- "targets": [
497
- "node18-linux-x64",
498
- "node18-macos-x64",
499
- "node18-win-x64"
500
- ]
501
- }
484
+ const json_ = `{
485
+ "name": "main",
486
+ "bin": {
487
+ "firefly-main": "Main.bundle.js"
488
+ },
489
+ "devDependencies": {
490
+ "pkg": "^5.8.0"
491
+ },
492
+ "pkg": {
493
+ "scripts": "Main.bundle.js",
494
+ "outputPath": "bin",
495
+ "assets": ["../assets/**/*"],
496
+ "targets": [
497
+ "node18-linux-x64",
498
+ "node18-macos-x64",
499
+ "node18-win-x64"
500
+ ]
501
+ }
502
502
  }`;
503
503
  const packageFile_ = (await ff_core_Path.Path_slash$(outputPath_, "executable/package.json", $task));
504
504
  (await ff_core_Path.Path_writeText$(packageFile_, json_, $task));
@@ -506,13 +506,13 @@ const packageFile_ = (await ff_core_Path.Path_slash$(outputPath_, "executable/pa
506
506
  }
507
507
 
508
508
  export async function internalCallPkg_$(self_, packageFile_, outputPath_, targets_, $task) {
509
-
510
- const pkg = import$0
511
- return await pkg.exec([
512
- packageFile_,
513
- '--out-path', outputPath_,
514
- '--target', targets_.join(',')
515
- ])
509
+
510
+ const pkg = import$0
511
+ return await pkg.exec([
512
+ packageFile_,
513
+ '--out-path', outputPath_,
514
+ '--target', targets_.join(',')
515
+ ])
516
516
 
517
517
  }
518
518
 
@@ -187,9 +187,9 @@ ff_core_Core.panic_(((("Dependency declaration and package declaration disagree
187
187
  }
188
188
 
189
189
  export async function internalExtractTarGz_$(tarGzPath_, path_, $task) {
190
-
191
- const tar = import$0
192
- await tar.extract({file: tarGzPath_, cwd: path_, strict: true})
190
+
191
+ const tar = import$0
192
+ await tar.extract({file: tarGzPath_, cwd: path_, strict: true})
193
193
 
194
194
  }
195
195
 
@@ -899,7 +899,7 @@ const c_ = _guard3;
899
899
  const _guard2 = c_.function_;
900
900
  if(_guard2.EField) {
901
901
  const f_ = _guard2;
902
- if(((((((f_.field_ === "else") || (f_.field_ === "elseIf")) || (f_.field_ === "grab")) || (f_.field_ === "catch")) || (f_.field_ === "catchAny")) || (f_.field_ === "finally"))) {
902
+ if(((((((((f_.field_ === "else") || (f_.field_ === "elseIf")) || (f_.field_ === "tryCatch")) || (f_.field_ === "tryCatchAny")) || (f_.field_ === "tryFinally")) || (f_.field_ === "catch")) || (f_.field_ === "catchAny")) || (f_.field_ === "finally"))) {
903
903
  {
904
904
  const _1 = e_;
905
905
  {
@@ -2746,7 +2746,7 @@ const c_ = _guard3;
2746
2746
  const _guard2 = c_.function_;
2747
2747
  if(_guard2.EField) {
2748
2748
  const f_ = _guard2;
2749
- if(((((((f_.field_ === "else") || (f_.field_ === "elseIf")) || (f_.field_ === "grab")) || (f_.field_ === "catch")) || (f_.field_ === "catchAny")) || (f_.field_ === "finally"))) {
2749
+ if(((((((((f_.field_ === "else") || (f_.field_ === "elseIf")) || (f_.field_ === "tryCatch")) || (f_.field_ === "tryCatchAny")) || (f_.field_ === "tryFinally")) || (f_.field_ === "catch")) || (f_.field_ === "catchAny")) || (f_.field_ === "finally"))) {
2750
2750
  {
2751
2751
  const _1 = e_;
2752
2752
  {
@@ -1307,52 +1307,25 @@ const d_ = ff_compiler_JsEmitter.JsEmitter_emitDictionary(self_, dictionary_);
1307
1307
  const a_ = ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, argument_, async_);
1308
1308
  return (((("throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(" + a_) + ", ") + d_) + ")})")
1309
1309
  }
1310
- if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/Core.try") {
1311
- const at_ = _1.at_;
1312
- if((!last_)) {
1313
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Statements can't be a try without a grab"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
1314
- }
1315
- }
1316
- if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/Try.Try_map") {
1317
- const at_ = _1.at_;
1318
- if((!last_)) {
1319
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Statements can't be a map without a grab"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
1320
- }
1321
- }
1322
- if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/Try.Try_flatMap") {
1323
- const at_ = _1.at_;
1324
- if((!last_)) {
1325
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Statements can't be a flatMap without a grab"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
1326
- }
1327
- }
1328
- if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/Try.Try_flatten") {
1329
- const at_ = _1.at_;
1330
- if((!last_)) {
1331
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Statements can't be a flatten without a grab"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
1332
- }
1333
- }
1334
1310
  if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/Try.Try_catch") {
1335
1311
  const at_ = _1.at_;
1336
- if((!last_)) {
1337
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Statements can't be a catch without a grab"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
1312
+ const _guard1 = ff_compiler_JsEmitter.JsEmitter_emitTryCatchFinally(self_, term_, last_, async_);
1313
+ if(_guard1.Some) {
1314
+ const code_ = _guard1.value_;
1315
+ return code_
1338
1316
  }
1339
1317
  }
1340
1318
  if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/Try.Try_catchAny") {
1341
1319
  const at_ = _1.at_;
1342
- if((!last_)) {
1343
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Statements can't be a catchAny without a grab"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
1320
+ const _guard1 = ff_compiler_JsEmitter.JsEmitter_emitTryCatchFinally(self_, term_, last_, async_);
1321
+ if(_guard1.Some) {
1322
+ const code_ = _guard1.value_;
1323
+ return code_
1344
1324
  }
1345
1325
  }
1346
1326
  if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/Try.Try_finally") {
1347
1327
  const at_ = _1.at_;
1348
- if((!last_)) {
1349
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Statements can't be a finally without a grab"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
1350
- }
1351
- }
1352
- if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/Try.Try_grab" && _1.arguments_.length === 1) {
1353
- const at_ = _1.at_;
1354
- const argument_ = _1.arguments_[0];
1355
- const _guard1 = ff_compiler_JsEmitter.JsEmitter_emitTryCatchFinally(self_, argument_.value_, last_, async_);
1328
+ const _guard1 = ff_compiler_JsEmitter.JsEmitter_emitTryCatchFinally(self_, term_, last_, async_);
1356
1329
  if(_guard1.Some) {
1357
1330
  const code_ = _guard1.value_;
1358
1331
  return code_
@@ -2672,52 +2645,25 @@ const d_ = (await ff_compiler_JsEmitter.JsEmitter_emitDictionary$(self_, diction
2672
2645
  const a_ = (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, argument_, async_, $task));
2673
2646
  return (((("throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(" + a_) + ", ") + d_) + ")})")
2674
2647
  }
2675
- if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/Core.try") {
2676
- const at_ = _1.at_;
2677
- if((!last_)) {
2678
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Statements can't be a try without a grab"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
2679
- }
2680
- }
2681
- if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/Try.Try_map") {
2682
- const at_ = _1.at_;
2683
- if((!last_)) {
2684
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Statements can't be a map without a grab"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
2685
- }
2686
- }
2687
- if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/Try.Try_flatMap") {
2688
- const at_ = _1.at_;
2689
- if((!last_)) {
2690
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Statements can't be a flatMap without a grab"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
2691
- }
2692
- }
2693
- if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/Try.Try_flatten") {
2694
- const at_ = _1.at_;
2695
- if((!last_)) {
2696
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Statements can't be a flatten without a grab"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
2697
- }
2698
- }
2699
2648
  if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/Try.Try_catch") {
2700
2649
  const at_ = _1.at_;
2701
- if((!last_)) {
2702
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Statements can't be a catch without a grab"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
2650
+ const _guard1 = (await ff_compiler_JsEmitter.JsEmitter_emitTryCatchFinally$(self_, term_, last_, async_, $task));
2651
+ if(_guard1.Some) {
2652
+ const code_ = _guard1.value_;
2653
+ return code_
2703
2654
  }
2704
2655
  }
2705
2656
  if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/Try.Try_catchAny") {
2706
2657
  const at_ = _1.at_;
2707
- if((!last_)) {
2708
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Statements can't be a catchAny without a grab"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
2658
+ const _guard1 = (await ff_compiler_JsEmitter.JsEmitter_emitTryCatchFinally$(self_, term_, last_, async_, $task));
2659
+ if(_guard1.Some) {
2660
+ const code_ = _guard1.value_;
2661
+ return code_
2709
2662
  }
2710
2663
  }
2711
2664
  if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/Try.Try_finally") {
2712
2665
  const at_ = _1.at_;
2713
- if((!last_)) {
2714
- throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(at_, "Statements can't be a finally without a grab"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
2715
- }
2716
- }
2717
- if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/Try.Try_grab" && _1.arguments_.length === 1) {
2718
- const at_ = _1.at_;
2719
- const argument_ = _1.arguments_[0];
2720
- const _guard1 = (await ff_compiler_JsEmitter.JsEmitter_emitTryCatchFinally$(self_, argument_.value_, last_, async_, $task));
2666
+ const _guard1 = (await ff_compiler_JsEmitter.JsEmitter_emitTryCatchFinally$(self_, term_, last_, async_, $task));
2721
2667
  if(_guard1.Some) {
2722
2668
  const code_ = _guard1.value_;
2723
2669
  return code_
@@ -229,7 +229,7 @@ ff_compiler_Builder.build_(system_, ff_compiler_JsEmitter.EmitNode(), ff_compile
229
229
  return
230
230
  }
231
231
  }
232
- ff_core_Try.Try_grab(ff_core_Try.Try_catch(ff_core_Try.Try_catch(ff_core_Try.Try_catch(ff_core_Core.try_((() => {
232
+ ff_core_Try.Try_catch(ff_core_Try.Try_tryCatch(ff_core_Try.Try_tryCatch(ff_core_Core.try_((() => {
233
233
  const command_ = ff_compiler_Main.parseCommandLine_(ff_core_NodeSystem.NodeSystem_arguments(system_));
234
234
  runCommand_(command_)
235
235
  })), ((_1, _2) => {
@@ -259,7 +259,7 @@ return ff_core_Log.debug_((((((" at " + ff_core_String.String_replace(at_.file_,
259
259
  }))
260
260
  return
261
261
  }
262
- }), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileErrors))
262
+ }), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileErrors)
263
263
  }
264
264
 
265
265
  export function parseCommandLine_(arguments_) {
@@ -477,7 +477,7 @@ const fakeLocation_ = ff_compiler_Syntax.Location("<core>", 0, 0);
477
477
  return
478
478
  }
479
479
  }
480
- ff_core_Try.Try_grab(ff_core_Try.Try_catch(ff_core_Try.Try_catch(ff_core_Try.Try_catch((await ff_core_Core.try_$((async ($task) => {
480
+ ff_core_Try.Try_catch(ff_core_Try.Try_tryCatch(ff_core_Try.Try_tryCatch((await ff_core_Core.try_$((async ($task) => {
481
481
  const command_ = ff_compiler_Main.parseCommandLine_((await ff_core_NodeSystem.NodeSystem_arguments$(system_, $task)));
482
482
  (await runCommand_$(command_, $task))
483
483
  }), $task)), ((_1, _2) => {
@@ -507,7 +507,7 @@ return ff_core_Log.debug_((((((" at " + ff_core_String.String_replace(at_.file_,
507
507
  }))
508
508
  return
509
509
  }
510
- }), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileErrors))
510
+ }), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileErrors)
511
511
  }
512
512
 
513
513
  export async function parseCommandLine_$(arguments_, $task) {