firefly-compiler 0.4.8 → 0.4.10

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 (85) hide show
  1. package/compiler/Compiler.ff +1 -0
  2. package/compiler/JsEmitter.ff +5 -3
  3. package/core/FileHandle.ff +6 -0
  4. package/core/Int.ff +4 -0
  5. package/core/JsSystem.ff +3 -0
  6. package/core/JsValue.ff +5 -0
  7. package/core/Json.ff +213 -0
  8. package/core/Path.ff +6 -2
  9. package/core/String.ff +22 -0
  10. package/output/js/ff/compiler/Builder.mjs +2 -0
  11. package/output/js/ff/compiler/Compiler.mjs +3 -1
  12. package/output/js/ff/compiler/Dependencies.mjs +2 -0
  13. package/output/js/ff/compiler/Deriver.mjs +2 -0
  14. package/output/js/ff/compiler/Dictionaries.mjs +2 -0
  15. package/output/js/ff/compiler/Environment.mjs +2 -0
  16. package/output/js/ff/compiler/Inference.mjs +2 -0
  17. package/output/js/ff/compiler/JsEmitter.mjs +12 -2
  18. package/output/js/ff/compiler/JsImporter.mjs +2 -0
  19. package/output/js/ff/compiler/LspHook.mjs +2 -0
  20. package/output/js/ff/compiler/Main.mjs +2 -0
  21. package/output/js/ff/compiler/Parser.mjs +2 -0
  22. package/output/js/ff/compiler/Patterns.mjs +2 -0
  23. package/output/js/ff/compiler/Resolver.mjs +2 -0
  24. package/output/js/ff/compiler/Substitution.mjs +2 -0
  25. package/output/js/ff/compiler/Syntax.mjs +2 -0
  26. package/output/js/ff/compiler/Token.mjs +2 -0
  27. package/output/js/ff/compiler/Tokenizer.mjs +2 -0
  28. package/output/js/ff/compiler/Unification.mjs +2 -0
  29. package/output/js/ff/compiler/Wildcards.mjs +2 -0
  30. package/output/js/ff/compiler/Workspace.mjs +2 -0
  31. package/output/js/ff/core/Any.mjs +2 -0
  32. package/output/js/ff/core/Array.mjs +2 -0
  33. package/output/js/ff/core/AssetSystem.mjs +2 -0
  34. package/output/js/ff/core/Atomic.mjs +2 -0
  35. package/output/js/ff/core/Bool.mjs +2 -0
  36. package/output/js/ff/core/Box.mjs +2 -0
  37. package/output/js/ff/core/BrowserSystem.mjs +2 -0
  38. package/output/js/ff/core/Buffer.mjs +2 -0
  39. package/output/js/ff/core/BuildSystem.mjs +2 -0
  40. package/output/js/ff/core/Channel.mjs +2 -0
  41. package/output/js/ff/core/Char.mjs +2 -0
  42. package/output/js/ff/core/Core.mjs +2 -0
  43. package/output/js/ff/core/Duration.mjs +2 -0
  44. package/output/js/ff/core/Equal.mjs +2 -0
  45. package/output/js/ff/core/Error.mjs +2 -0
  46. package/output/js/ff/core/FileHandle.mjs +14 -0
  47. package/output/js/ff/core/Float.mjs +2 -0
  48. package/output/js/ff/core/HttpClient.mjs +2 -0
  49. package/output/js/ff/core/Instant.mjs +2 -0
  50. package/output/js/ff/core/Int.mjs +10 -0
  51. package/output/js/ff/core/IntMap.mjs +2 -0
  52. package/output/js/ff/core/JsSystem.mjs +10 -0
  53. package/output/js/ff/core/JsValue.mjs +12 -0
  54. package/output/js/ff/core/Json.mjs +510 -0
  55. package/output/js/ff/core/List.mjs +2 -0
  56. package/output/js/ff/core/Lock.mjs +2 -0
  57. package/output/js/ff/core/Log.mjs +2 -0
  58. package/output/js/ff/core/Map.mjs +2 -0
  59. package/output/js/ff/core/NodeSystem.mjs +2 -0
  60. package/output/js/ff/core/Nothing.mjs +2 -0
  61. package/output/js/ff/core/Option.mjs +2 -0
  62. package/output/js/ff/core/Ordering.mjs +2 -0
  63. package/output/js/ff/core/Pair.mjs +2 -0
  64. package/output/js/ff/core/Path.mjs +8 -2
  65. package/output/js/ff/core/Random.mjs +2 -0
  66. package/output/js/ff/core/RbMap.mjs +2 -0
  67. package/output/js/ff/core/Serializable.mjs +2 -0
  68. package/output/js/ff/core/Set.mjs +2 -0
  69. package/output/js/ff/core/Show.mjs +2 -0
  70. package/output/js/ff/core/SourceLocation.mjs +2 -0
  71. package/output/js/ff/core/Stack.mjs +2 -0
  72. package/output/js/ff/core/Stream.mjs +2 -0
  73. package/output/js/ff/core/String.mjs +54 -0
  74. package/output/js/ff/core/StringMap.mjs +2 -0
  75. package/output/js/ff/core/Task.mjs +2 -0
  76. package/output/js/ff/core/Try.mjs +2 -0
  77. package/output/js/ff/core/Unit.mjs +2 -0
  78. package/output/js/ff/core/WebSocket.mjs +2 -0
  79. package/package.json +1 -1
  80. package/postgresql/Pg.ff +13 -13
  81. package/rpc/.firefly/package.ff +1 -0
  82. package/rpc/Rpc.ff +69 -0
  83. package/vscode/package.json +1 -1
  84. package/webserver/WebServer.ff +165 -88
  85. package/meetup/AutoCompletion.ff +0 -6
@@ -82,6 +82,7 @@ coreImports: List[DImport] =
82
82
  "Instant"
83
83
  "Int"
84
84
  "IntMap"
85
+ "Json"
85
86
  "JsValue"
86
87
  "JsSystem"
87
88
  "List"
@@ -395,11 +395,13 @@ extend self: JsEmitter {
395
395
  !effectTypeIsAsync(effect)
396
396
  } =>
397
397
  let n = name.map {escapeResolved(_)}.else {"i"}
398
- "((() => {\n" +
399
- "const size = " + self.emitArgument(at, size, async) + ";\n" +
398
+ let newAsync = self.emittingAsync && effectTypeIsAsync(effect)
399
+ let await = if(newAsync) {"await "} else {""}
400
+ await + "((() => {\n" +
401
+ "const size = " + self.emitArgument(at, size, async) + ";\n" + // Not correct if async and body isn't
400
402
  "const result = [];\n" +
401
403
  "for(let " + n + " = 0; " + n + " < size; " + n + "++) {\n" +
402
- "result.push(" + self.emitTerm(body, async) + ");\n" +
404
+ "result.push(" + self.emitTerm(body, newAsync) + ");\n" +
403
405
  "}\n" +
404
406
  "return result;\n" +
405
407
  "})())"
@@ -25,6 +25,12 @@ extend self: FileHandle {
25
25
  await self_.write(text, position.value_, encoding_)
26
26
  """
27
27
 
28
+ writeLine(text: String, position: Option[Int] = None, encoding: String = "utf8"): Unit
29
+ target js async """
30
+ ff_core_Task.Task_throwIfAborted($task)
31
+ await self_.write(text + "\\n", position.value_, encoding_)
32
+ """
33
+
28
34
  truncate(length: Int = 0): Unit
29
35
  target js async """
30
36
  ff_core_Task.Task_throwIfAborted($task)
package/core/Int.ff CHANGED
@@ -57,5 +57,9 @@ extend self: Int {
57
57
  clamp(from: Int, to: Int): Int {
58
58
  if(self <= from) {from} elseIf {self >= to} {to} else {self}
59
59
  }
60
+
61
+ pad(padding: String): String {
62
+ ("" + self).padStart(padding.size(), padding)
63
+ }
60
64
 
61
65
  }
package/core/JsSystem.ff CHANGED
@@ -22,6 +22,9 @@ extend self: JsSystem {
22
22
 
23
23
  array(values: List[JsValue]): JsValue
24
24
  target js sync "return ff_core_List.List_toArray(values_)"
25
+
26
+ json(value: Json): JsValue
27
+ target js sync "return value_"
25
28
 
26
29
  function0[R](body: () => R): JsValue
27
30
  target js sync "return body_"
package/core/JsValue.ff CHANGED
@@ -25,6 +25,11 @@ extend self: JsValue {
25
25
  if(!(self_ instanceof DataView)) throw new Error('Expected buffer, got '+ typeof self_);
26
26
  return self_
27
27
  """
28
+
29
+ grabJson(): Json
30
+ target js sync """
31
+ return self_
32
+ """
28
33
 
29
34
  equals[V: IsJsValue](value: V): Bool
30
35
  target js sync "return self_ === value_"
package/core/Json.ff ADDED
@@ -0,0 +1,213 @@
1
+ data Json {}
2
+
3
+ read(json: String): Option[Json]
4
+ target js sync """
5
+ try {
6
+ return ff_core_Option.Some(JSON.parse(json_));
7
+ } catch(e) {
8
+ return ff_core_Option.None();
9
+ }
10
+ """
11
+
12
+ write(json: Json, space: Option[String] = None): String
13
+ target js sync """
14
+ return JSON.stringify(json_, null, space_.value_);
15
+ """
16
+
17
+ string(json: String): Json
18
+ target js sync """
19
+ return json_;
20
+ """
21
+
22
+ int(json: Int): Json
23
+ target js sync """
24
+ return json_;
25
+ """
26
+
27
+ float(json: Float): Json
28
+ target js sync """
29
+ return json_;
30
+ """
31
+
32
+ bool(json: Bool): Json
33
+ target js sync """
34
+ return json_;
35
+ """
36
+
37
+ null(): Json
38
+ target js sync """
39
+ return null;
40
+ """
41
+
42
+ array(json: Array[Json]): Json
43
+ target js sync """
44
+ return json_;
45
+ """
46
+
47
+ list(json: List[Json]): Json {
48
+ array(json.toArray())
49
+ }
50
+
51
+ object(): Json
52
+ target js sync """
53
+ return {};
54
+ """
55
+
56
+ extend self: Json {
57
+
58
+ with(field: String, value: Json)
59
+ target js sync """
60
+ if(typeof self_ !== 'object' || self_ === null || Array.isArray(self_)) {
61
+ throw new Error('Not an object: ' + JSON.stringify(self_));
62
+ }
63
+ return {...self_, [field_]: value_};
64
+ """
65
+
66
+ merge(that: Json)
67
+ target js sync """
68
+ if(typeof self_ !== 'object' || self_ === null || Array.isArray(self_)) {
69
+ throw new Error('Not an object: ' + JSON.stringify(self_));
70
+ }
71
+ if(typeof that_ !== 'object' || that_ === null || Array.isArray(that_)) {
72
+ throw new Error('Not an object: ' + JSON.stringify(that_));
73
+ }
74
+ return {...self_, ...that_};
75
+ """
76
+
77
+ grabString(): String
78
+ target js sync """
79
+ if(typeof self_ !== 'string') throw new Error('Not a string: ' + JSON.stringify(self_));
80
+ return self_;
81
+ """
82
+
83
+ grabInt(): Int
84
+ target js sync """
85
+ if(!Number.isSafeInteger(self_)) throw new Error('Not an int: ' + JSON.stringify(self_));
86
+ return Math.trunc(self_);
87
+ """
88
+
89
+ grabFloat(): Float
90
+ target js sync """
91
+ if(typeof self_ !== 'number') throw new Error('Not a float: ' + JSON.stringify(self_));
92
+ return self_;
93
+ """
94
+
95
+ grabBool(): Bool
96
+ target js sync """
97
+ if(self_ === true) return true;
98
+ if(self_ === false) return false;
99
+ throw new Error('Not a bool: ' + JSON.stringify(self_));
100
+ """
101
+
102
+ grabArray(): Array[Json]
103
+ target js sync """
104
+ if(!Array.isArray(self_)) throw new Error('Not an array: ' + JSON.stringify(self_));
105
+ return self_;
106
+ """
107
+
108
+ isString(): Bool
109
+ target js sync """
110
+ return typeof self_ === 'string';
111
+ """
112
+
113
+ isInt(): Bool
114
+ target js sync """
115
+ return Number.isSafeInteger(self_);
116
+ """
117
+
118
+ isFloat(): Bool
119
+ target js sync """
120
+ return typeof self_ === 'number';
121
+ """
122
+
123
+ isBool(): Bool
124
+ target js sync """
125
+ return typeof self_ === 'boolean';
126
+ """
127
+
128
+ isArray(): Bool
129
+ target js sync """
130
+ return Array.isArray(self_);
131
+ """
132
+
133
+ isObject(): Bool
134
+ target js sync """
135
+ return typeof self_ === 'object' && self_ !== null && !Array.isArray(self_);
136
+ """
137
+
138
+ isNull(): Bool
139
+ target js sync """
140
+ return typeof self_ === null;
141
+ """
142
+
143
+ field(key: String): Json
144
+ target js sync """
145
+ return typeof self_ === 'object' && self_ !== null && !Array.isArray(self_) && Object.hasOwn(self_, key_)
146
+ ? self_[key_] : null;
147
+ """
148
+
149
+ index(key: Int): Json
150
+ target js sync """
151
+ return typeof self_ === 'array' ? self_[key] ?? null : null;
152
+ """
153
+
154
+ getField(key: String): Option[Json]
155
+ target js sync """
156
+ return typeof self_ === 'object' && self_ !== null && !Array.isArray(self_) && Object.hasOwn(self_, key_)
157
+ ? ff_core_Option.Some(self_[key_]) : ff_core_Option.None();
158
+ """
159
+
160
+ getIndex(key: Int): Option[Json]
161
+ target js sync """
162
+ return typeof self_ === 'array' ? ff_core_Option.Some(self_[key_] ?? null) : ff_core_Option.None();
163
+ """
164
+
165
+ getFields(): Option[Array[String]]
166
+ target js sync """
167
+ return typeof self_ === 'object' && self_ !== null && !Array.isArray(self_)
168
+ ? ff_core_Option.Some(Object.keys(self_)) : ff_core_Option.None();
169
+ """
170
+
171
+ grabField(key: String): Json {
172
+ self.getField(key).else {
173
+ throw(GrabException())
174
+ }
175
+ }
176
+
177
+ grabIndex(key: Int): Json {
178
+ self.getIndex(key).else {
179
+ throw(GrabException())
180
+ }
181
+ }
182
+
183
+ grabFields(): Array[String] {
184
+ self.getFields().else {
185
+ throw(GrabException())
186
+ }
187
+ }
188
+
189
+ map[T](body: (String, Json) => T): Array[T] {
190
+ let stack = Stack.make()
191
+ self.each {field, value => stack.push(body(field, value))}
192
+ stack.drain()
193
+ }
194
+
195
+ each(body: (String, Json) => Unit) {
196
+ if(!self.isObject()) {throw(GrabException())}
197
+ internalEach(self, body)
198
+ }
199
+
200
+ eachWhile(body: (String, Json) => Bool) {
201
+ if(!self.isObject()) {throw(GrabException())}
202
+ internalEachWhile(self, body)
203
+ }
204
+
205
+ }
206
+
207
+ internalEach(self: Json, body: (String, Json) => Unit): Unit
208
+ target js sync "for(const [key, value] of Object.entries(self_)) body_(key, value)"
209
+ target js async "for(const [key, value] of Object.entries(self_)) await body_(key, value, $task)"
210
+
211
+ internalEachWhile(self: Json, body: (String, Json) => Bool): Unit
212
+ target js sync "for(const [key, value] of Object.entries(self_)) if(!body_(key, value)) break"
213
+ target js async "for(const [key, value] of Object.entries(self_)) if(!await body_(key, value, $task)) break"
package/core/Path.ff CHANGED
@@ -277,7 +277,9 @@ extend self: Path {
277
277
  }
278
278
  }, $task)
279
279
  } finally {
280
- writeable.close()
280
+ await new Promise((resolve, reject) => {
281
+ writeable.close(err => {if(err) reject(err); else resolve();});
282
+ });
281
283
  }
282
284
  """
283
285
 
@@ -298,7 +300,9 @@ extend self: Path {
298
300
  }
299
301
  }, $task)
300
302
  } finally {
301
- writeable.close()
303
+ await new Promise((resolve, reject) => {
304
+ writeable.close(err => {if(err) reject(err); else resolve();});
305
+ });
302
306
  }
303
307
  """
304
308
 
package/core/String.ff CHANGED
@@ -22,6 +22,18 @@ extend self: String {
22
22
  reverse(): String
23
23
  target js sync "return [...self_].reverse().join('')"
24
24
 
25
+ repeat(count: Int): String
26
+ target js sync "return self_.repeat(count_)"
27
+
28
+ trim(): String
29
+ target js sync "return self_.trim()"
30
+
31
+ trimStart(): String
32
+ target js sync "return self_.trimStart()"
33
+
34
+ trimEnd(): String
35
+ target js sync "return self_.trimEnd()"
36
+
25
37
  lower(): String
26
38
  target js sync "return self_.toLowerCase()"
27
39
 
@@ -137,6 +149,16 @@ extend self: String {
137
149
  removeLast(suffix: String): Option[String] {
138
150
  if(self.endsWith(suffix)) {Some(self.dropLast(suffix.size()))} else {None}
139
151
  }
152
+
153
+ padStart(length: Int, padding: String = " "): String
154
+ target js sync """
155
+ return self_.padStart(length_, padding_);
156
+ """
157
+
158
+ padEnd(length: Int, padding: String = " "): String
159
+ target js sync """
160
+ return self_.padEnd(length_, padding_);
161
+ """
140
162
 
141
163
  any(body: Char => Bool): Bool
142
164
  target js sync """
@@ -66,6 +66,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
66
66
 
67
67
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
68
68
 
69
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
70
+
69
71
  import * as ff_core_List from "../../ff/core/List.mjs"
70
72
 
71
73
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -68,6 +68,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
68
68
 
69
69
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
70
70
 
71
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
72
+
71
73
  import * as ff_core_List from "../../ff/core/List.mjs"
72
74
 
73
75
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -119,7 +121,7 @@ export function Compiler(emitTarget_, task_, compilerModulePath_, jsOutputPath_,
119
121
  return {emitTarget_, task_, compilerModulePath_, jsOutputPath_, packagePaths_, singleFilePackages_, virtualFiles_, lspHook_, parsedModules_, resolvedModules_, derivedModules_, inferredModules_, emittedModules_, phaseDurations_, phaseDurationDelta_};
120
122
  }
121
123
 
122
- export const coreImports_ = ff_core_List.List_map(ff_core_List.Link("Any", ff_core_List.Link("Array", ff_core_List.Link("AssetSystem", ff_core_List.Link("Atomic", ff_core_List.Link("Bool", ff_core_List.Link("Box", ff_core_List.Link("BrowserSystem", ff_core_List.Link("Buffer", ff_core_List.Link("BuildSystem", ff_core_List.Link("Channel", ff_core_List.Link("Char", ff_core_List.Link("Core", ff_core_List.Link("Duration", ff_core_List.Link("Equal", ff_core_List.Link("Error", ff_core_List.Link("FileHandle", ff_core_List.Link("Float", ff_core_List.Link("HttpClient", ff_core_List.Link("Instant", ff_core_List.Link("Int", ff_core_List.Link("IntMap", ff_core_List.Link("JsValue", ff_core_List.Link("JsSystem", ff_core_List.Link("List", ff_core_List.Link("Lock", ff_core_List.Link("Log", ff_core_List.Link("Map", ff_core_List.Link("NodeSystem", ff_core_List.Link("Nothing", ff_core_List.Link("Option", ff_core_List.Link("Ordering", ff_core_List.Link("Pair", ff_core_List.Link("Path", ff_core_List.Link("Random", ff_core_List.Link("Serializable", ff_core_List.Link("Set", ff_core_List.Link("Show", ff_core_List.Link("SourceLocation", ff_core_List.Link("Stack", ff_core_List.Link("Stream", ff_core_List.Link("String", ff_core_List.Link("StringMap", ff_core_List.Link("Task", ff_core_List.Link("Try", ff_core_List.Link("Unit", ff_core_List.Link("WebSocket", ff_core_List.Empty())))))))))))))))))))))))))))))))))))))))))))))), ((moduleName_) => {
124
+ export const coreImports_ = ff_core_List.List_map(ff_core_List.Link("Any", ff_core_List.Link("Array", ff_core_List.Link("AssetSystem", ff_core_List.Link("Atomic", ff_core_List.Link("Bool", ff_core_List.Link("Box", ff_core_List.Link("BrowserSystem", ff_core_List.Link("Buffer", ff_core_List.Link("BuildSystem", ff_core_List.Link("Channel", ff_core_List.Link("Char", ff_core_List.Link("Core", ff_core_List.Link("Duration", ff_core_List.Link("Equal", ff_core_List.Link("Error", ff_core_List.Link("FileHandle", ff_core_List.Link("Float", ff_core_List.Link("HttpClient", ff_core_List.Link("Instant", ff_core_List.Link("Int", ff_core_List.Link("IntMap", ff_core_List.Link("Json", ff_core_List.Link("JsValue", ff_core_List.Link("JsSystem", ff_core_List.Link("List", ff_core_List.Link("Lock", ff_core_List.Link("Log", ff_core_List.Link("Map", ff_core_List.Link("NodeSystem", ff_core_List.Link("Nothing", ff_core_List.Link("Option", ff_core_List.Link("Ordering", ff_core_List.Link("Pair", ff_core_List.Link("Path", ff_core_List.Link("Random", ff_core_List.Link("Serializable", ff_core_List.Link("Set", ff_core_List.Link("Show", ff_core_List.Link("SourceLocation", ff_core_List.Link("Stack", ff_core_List.Link("Stream", ff_core_List.Link("String", ff_core_List.Link("StringMap", ff_core_List.Link("Task", ff_core_List.Link("Try", ff_core_List.Link("Unit", ff_core_List.Link("WebSocket", ff_core_List.Empty()))))))))))))))))))))))))))))))))))))))))))))))), ((moduleName_) => {
123
125
  return ff_compiler_Syntax.DImport(ff_compiler_Syntax.Location("<prelude>", 1, 1), moduleName_, ff_compiler_Syntax.PackagePair("ff", "core"), ff_core_List.Empty(), moduleName_)
124
126
  }));
125
127
 
@@ -58,6 +58,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
58
58
 
59
59
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
60
60
 
61
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
62
+
61
63
  import * as ff_core_List from "../../ff/core/List.mjs"
62
64
 
63
65
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -50,6 +50,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
50
50
 
51
51
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
52
52
 
53
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
54
+
53
55
  import * as ff_core_List from "../../ff/core/List.mjs"
54
56
 
55
57
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -54,6 +54,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
54
54
 
55
55
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
56
56
 
57
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
58
+
57
59
  import * as ff_core_List from "../../ff/core/List.mjs"
58
60
 
59
61
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -50,6 +50,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
50
50
 
51
51
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
52
52
 
53
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
54
+
53
55
  import * as ff_core_List from "../../ff/core/List.mjs"
54
56
 
55
57
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -58,6 +58,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
58
58
 
59
59
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
60
60
 
61
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
62
+
61
63
  import * as ff_core_List from "../../ff/core/List.mjs"
62
64
 
63
65
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -54,6 +54,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
54
54
 
55
55
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
56
56
 
57
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
58
+
57
59
  import * as ff_core_List from "../../ff/core/List.mjs"
58
60
 
59
61
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -1556,7 +1558,11 @@ return ff_compiler_JsEmitter.escapeResolved_(_w1)
1556
1558
  })), (() => {
1557
1559
  return "i"
1558
1560
  }));
1559
- return ((((((((((((((((("((() => {\n" + "const size = ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, size_, async_)) + ";\n") + "const result = [];\n") + "for(let ") + n_) + " = 0; ") + n_) + " < size; ") + n_) + "++) {\n") + "result.push(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_)) + ");\n") + "}\n") + "return result;\n") + "})())")
1561
+ const newAsync_ = (self_.emittingAsync_ && ff_compiler_JsEmitter.effectTypeIsAsync_(effect_));
1562
+ const await_ = (newAsync_
1563
+ ? "await "
1564
+ : "");
1565
+ return ((((((((((((((((((await_ + "((() => {\n") + "const size = ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, size_, async_)) + ";\n") + "const result = [];\n") + "for(let ") + n_) + " = 0; ") + n_) + " < size; ") + n_) + "++) {\n") + "result.push(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, newAsync_)) + ");\n") + "}\n") + "return result;\n") + "})())")
1560
1566
  return
1561
1567
  }
1562
1568
  }
@@ -3651,7 +3657,11 @@ return ff_compiler_JsEmitter.escapeResolved_(_w1)
3651
3657
  })), (() => {
3652
3658
  return "i"
3653
3659
  }));
3654
- return ((((((((((((((((("((() => {\n" + "const size = ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, size_, async_, $task))) + ";\n") + "const result = [];\n") + "for(let ") + n_) + " = 0; ") + n_) + " < size; ") + n_) + "++) {\n") + "result.push(") + (await ff_compiler_JsEmitter.JsEmitter_emitTerm$(self_, body_, async_, $task))) + ");\n") + "}\n") + "return result;\n") + "})())")
3660
+ const newAsync_ = (self_.emittingAsync_ && ff_compiler_JsEmitter.effectTypeIsAsync_(effect_));
3661
+ const await_ = (newAsync_
3662
+ ? "await "
3663
+ : "");
3664
+ return ((((((((((((((((((await_ + "((() => {\n") + "const size = ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, size_, async_, $task))) + ";\n") + "const result = [];\n") + "for(let ") + n_) + " = 0; ") + n_) + " < size; ") + n_) + "++) {\n") + "result.push(") + (await ff_compiler_JsEmitter.JsEmitter_emitTerm$(self_, body_, newAsync_, $task))) + ");\n") + "}\n") + "return result;\n") + "})())")
3655
3665
  return
3656
3666
  }
3657
3667
  }
@@ -50,6 +50,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
50
50
 
51
51
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
52
52
 
53
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
54
+
53
55
  import * as ff_core_List from "../../ff/core/List.mjs"
54
56
 
55
57
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -54,6 +54,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
54
54
 
55
55
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
56
56
 
57
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
58
+
57
59
  import * as ff_core_List from "../../ff/core/List.mjs"
58
60
 
59
61
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -70,6 +70,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
70
70
 
71
71
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
72
72
 
73
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
74
+
73
75
  import * as ff_core_List from "../../ff/core/List.mjs"
74
76
 
75
77
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -56,6 +56,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
56
56
 
57
57
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
58
58
 
59
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
60
+
59
61
  import * as ff_core_List from "../../ff/core/List.mjs"
60
62
 
61
63
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -50,6 +50,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
50
50
 
51
51
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
52
52
 
53
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
54
+
53
55
  import * as ff_core_List from "../../ff/core/List.mjs"
54
56
 
55
57
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -52,6 +52,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
52
52
 
53
53
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
54
54
 
55
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
56
+
55
57
  import * as ff_core_List from "../../ff/core/List.mjs"
56
58
 
57
59
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -50,6 +50,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
50
50
 
51
51
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
52
52
 
53
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
54
+
53
55
  import * as ff_core_List from "../../ff/core/List.mjs"
54
56
 
55
57
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -48,6 +48,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
48
48
 
49
49
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
50
50
 
51
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
52
+
51
53
  import * as ff_core_List from "../../ff/core/List.mjs"
52
54
 
53
55
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -50,6 +50,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
50
50
 
51
51
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
52
52
 
53
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
54
+
53
55
  import * as ff_core_List from "../../ff/core/List.mjs"
54
56
 
55
57
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -54,6 +54,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
54
54
 
55
55
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
56
56
 
57
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
58
+
57
59
  import * as ff_core_List from "../../ff/core/List.mjs"
58
60
 
59
61
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -52,6 +52,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
52
52
 
53
53
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
54
54
 
55
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
56
+
55
57
  import * as ff_core_List from "../../ff/core/List.mjs"
56
58
 
57
59
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -50,6 +50,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
50
50
 
51
51
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
52
52
 
53
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
54
+
53
55
  import * as ff_core_List from "../../ff/core/List.mjs"
54
56
 
55
57
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -50,6 +50,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
50
50
 
51
51
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
52
52
 
53
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
54
+
53
55
  import * as ff_core_List from "../../ff/core/List.mjs"
54
56
 
55
57
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -46,6 +46,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
46
46
 
47
47
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
48
48
 
49
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
50
+
49
51
  import * as ff_core_List from "../../ff/core/List.mjs"
50
52
 
51
53
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -46,6 +46,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
46
46
 
47
47
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
48
48
 
49
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
50
+
49
51
  import * as ff_core_List from "../../ff/core/List.mjs"
50
52
 
51
53
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -46,6 +46,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
46
46
 
47
47
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
48
48
 
49
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
50
+
49
51
  import * as ff_core_List from "../../ff/core/List.mjs"
50
52
 
51
53
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"
@@ -46,6 +46,8 @@ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
46
46
 
47
47
  import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
48
48
 
49
+ import * as ff_core_Json from "../../ff/core/Json.mjs"
50
+
49
51
  import * as ff_core_List from "../../ff/core/List.mjs"
50
52
 
51
53
  import * as ff_core_Lock from "../../ff/core/Lock.mjs"