firefly-compiler 0.4.6 → 0.4.8

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 (90) hide show
  1. package/compiler/Compiler.ff +2 -0
  2. package/compiler/Deriver.ff +7 -0
  3. package/core/Array.ff +17 -4
  4. package/core/AssetSystem.ff +1 -1
  5. package/core/BrowserSystem.ff +27 -0
  6. package/core/List.ff +4 -0
  7. package/core/Lock.ff +2 -2
  8. package/core/Random.ff +148 -0
  9. package/core/SourceLocation.ff +27 -0
  10. package/core/Task.ff +3 -0
  11. package/core/WebSocket.ff +127 -0
  12. package/httpserver/HttpServer.ff +1 -1
  13. package/lux/Css.ff +648 -0
  14. package/lux/CssTest.ff +48 -0
  15. package/lux/Lux.ff +33 -18
  16. package/lux/Main.ff +4 -1
  17. package/output/js/ff/compiler/Builder.mjs +448 -444
  18. package/output/js/ff/compiler/Compiler.mjs +420 -416
  19. package/output/js/ff/compiler/Dependencies.mjs +393 -389
  20. package/output/js/ff/compiler/Deriver.mjs +1178 -1170
  21. package/output/js/ff/compiler/Dictionaries.mjs +1315 -1309
  22. package/output/js/ff/compiler/Environment.mjs +1025 -1015
  23. package/output/js/ff/compiler/Inference.mjs +4272 -4268
  24. package/output/js/ff/compiler/JsEmitter.mjs +5405 -5391
  25. package/output/js/ff/compiler/JsImporter.mjs +270 -266
  26. package/output/js/ff/compiler/LspHook.mjs +799 -793
  27. package/output/js/ff/compiler/Main.mjs +1691 -1675
  28. package/output/js/ff/compiler/Parser.mjs +4016 -4008
  29. package/output/js/ff/compiler/Patterns.mjs +935 -927
  30. package/output/js/ff/compiler/Resolver.mjs +2311 -2307
  31. package/output/js/ff/compiler/Substitution.mjs +1154 -1150
  32. package/output/js/ff/compiler/Syntax.mjs +12566 -12434
  33. package/output/js/ff/compiler/Token.mjs +3152 -3096
  34. package/output/js/ff/compiler/Tokenizer.mjs +597 -593
  35. package/output/js/ff/compiler/Unification.mjs +1762 -1752
  36. package/output/js/ff/compiler/Wildcards.mjs +612 -608
  37. package/output/js/ff/compiler/Workspace.mjs +695 -687
  38. package/output/js/ff/core/Any.mjs +147 -143
  39. package/output/js/ff/core/Array.mjs +573 -547
  40. package/output/js/ff/core/AssetSystem.mjs +278 -274
  41. package/output/js/ff/core/Atomic.mjs +158 -154
  42. package/output/js/ff/core/Bool.mjs +156 -152
  43. package/output/js/ff/core/Box.mjs +116 -112
  44. package/output/js/ff/core/BrowserSystem.mjs +181 -126
  45. package/output/js/ff/core/Buffer.mjs +399 -395
  46. package/output/js/ff/core/BuildSystem.mjs +300 -296
  47. package/output/js/ff/core/Channel.mjs +193 -189
  48. package/output/js/ff/core/Char.mjs +153 -149
  49. package/output/js/ff/core/Core.mjs +304 -300
  50. package/output/js/ff/core/Duration.mjs +120 -116
  51. package/output/js/ff/core/Equal.mjs +183 -179
  52. package/output/js/ff/core/Error.mjs +146 -142
  53. package/output/js/ff/core/FileHandle.mjs +154 -150
  54. package/output/js/ff/core/Float.mjs +229 -225
  55. package/output/js/ff/core/HttpClient.mjs +195 -191
  56. package/output/js/ff/core/Instant.mjs +113 -109
  57. package/output/js/ff/core/Int.mjs +269 -265
  58. package/output/js/ff/core/IntMap.mjs +284 -280
  59. package/output/js/ff/core/JsSystem.mjs +242 -238
  60. package/output/js/ff/core/JsValue.mjs +712 -708
  61. package/output/js/ff/core/List.mjs +2346 -2334
  62. package/output/js/ff/core/Lock.mjs +235 -231
  63. package/output/js/ff/core/Log.mjs +167 -163
  64. package/output/js/ff/core/Map.mjs +366 -362
  65. package/output/js/ff/core/NodeSystem.mjs +298 -294
  66. package/output/js/ff/core/Nothing.mjs +108 -104
  67. package/output/js/ff/core/Option.mjs +1023 -1015
  68. package/output/js/ff/core/Ordering.mjs +734 -730
  69. package/output/js/ff/core/Pair.mjs +337 -331
  70. package/output/js/ff/core/Path.mjs +549 -545
  71. package/output/js/ff/core/Random.mjs +340 -0
  72. package/output/js/ff/core/RbMap.mjs +1944 -1940
  73. package/output/js/ff/core/Serializable.mjs +432 -428
  74. package/output/js/ff/core/Set.mjs +258 -254
  75. package/output/js/ff/core/Show.mjs +209 -205
  76. package/output/js/ff/core/SourceLocation.mjs +273 -229
  77. package/output/js/ff/core/Stack.mjs +533 -529
  78. package/output/js/ff/core/Stream.mjs +1308 -1304
  79. package/output/js/ff/core/String.mjs +369 -365
  80. package/output/js/ff/core/StringMap.mjs +284 -280
  81. package/output/js/ff/core/Task.mjs +325 -319
  82. package/output/js/ff/core/Try.mjs +511 -507
  83. package/output/js/ff/core/Unit.mjs +155 -151
  84. package/output/js/ff/core/WebSocket.mjs +198 -0
  85. package/package.json +1 -1
  86. package/vscode/package.json +1 -1
  87. package/webserver/.firefly/include/package-lock.json +16 -0
  88. package/webserver/.firefly/include/package.json +5 -0
  89. package/webserver/.firefly/package.ff +2 -0
  90. package/webserver/WebServer.ff +608 -0
@@ -1,185 +1,189 @@
1
-
2
-
3
- import * as ff_core_Any from "../../ff/core/Any.mjs"
4
-
5
- import * as ff_core_Array from "../../ff/core/Array.mjs"
6
-
7
- import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
8
-
9
- import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
10
-
11
- import * as ff_core_Bool from "../../ff/core/Bool.mjs"
12
-
13
- import * as ff_core_Box from "../../ff/core/Box.mjs"
14
-
15
- import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
16
-
17
- import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
18
-
19
- import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
20
-
21
- import * as ff_core_Channel from "../../ff/core/Channel.mjs"
22
-
23
- import * as ff_core_Char from "../../ff/core/Char.mjs"
24
-
25
- import * as ff_core_Core from "../../ff/core/Core.mjs"
26
-
27
- import * as ff_core_Duration from "../../ff/core/Duration.mjs"
28
-
29
- import * as ff_core_Equal from "../../ff/core/Equal.mjs"
30
-
31
- import * as ff_core_Error from "../../ff/core/Error.mjs"
32
-
33
- import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
34
-
35
- import * as ff_core_Float from "../../ff/core/Float.mjs"
36
-
37
- import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
38
-
39
- import * as ff_core_Instant from "../../ff/core/Instant.mjs"
40
-
41
- import * as ff_core_Int from "../../ff/core/Int.mjs"
42
-
43
- import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
44
-
45
- import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
46
-
47
- import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
48
-
49
- import * as ff_core_List from "../../ff/core/List.mjs"
50
-
51
- import * as ff_core_Lock from "../../ff/core/Lock.mjs"
52
-
53
- import * as ff_core_Log from "../../ff/core/Log.mjs"
54
-
55
- import * as ff_core_Map from "../../ff/core/Map.mjs"
56
-
57
- import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
58
-
59
- import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
60
-
61
- import * as ff_core_Option from "../../ff/core/Option.mjs"
62
-
63
- import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
64
-
65
- import * as ff_core_Pair from "../../ff/core/Pair.mjs"
66
-
67
- import * as ff_core_Path from "../../ff/core/Path.mjs"
68
-
69
- import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
70
-
71
- import * as ff_core_Set from "../../ff/core/Set.mjs"
72
-
73
- import * as ff_core_Show from "../../ff/core/Show.mjs"
74
-
75
- import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
76
-
77
- import * as ff_core_Stack from "../../ff/core/Stack.mjs"
78
-
79
- import * as ff_core_Stream from "../../ff/core/Stream.mjs"
80
-
81
- import * as ff_core_String from "../../ff/core/String.mjs"
82
-
83
- import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
84
-
85
- import * as ff_core_Task from "../../ff/core/Task.mjs"
86
-
87
- import * as ff_core_Try from "../../ff/core/Try.mjs"
88
-
89
- import * as ff_core_Unit from "../../ff/core/Unit.mjs"
90
-
91
- // type String
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
- export function String_size(self_) {
101
- return self_.length
102
- }
103
-
104
- export function String_grab(self_, index_) {
1
+
2
+
3
+ import * as ff_core_Any from "../../ff/core/Any.mjs"
4
+
5
+ import * as ff_core_Array from "../../ff/core/Array.mjs"
6
+
7
+ import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
8
+
9
+ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
10
+
11
+ import * as ff_core_Bool from "../../ff/core/Bool.mjs"
12
+
13
+ import * as ff_core_Box from "../../ff/core/Box.mjs"
14
+
15
+ import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
16
+
17
+ import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
18
+
19
+ import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
20
+
21
+ import * as ff_core_Channel from "../../ff/core/Channel.mjs"
22
+
23
+ import * as ff_core_Char from "../../ff/core/Char.mjs"
24
+
25
+ import * as ff_core_Core from "../../ff/core/Core.mjs"
26
+
27
+ import * as ff_core_Duration from "../../ff/core/Duration.mjs"
28
+
29
+ import * as ff_core_Equal from "../../ff/core/Equal.mjs"
30
+
31
+ import * as ff_core_Error from "../../ff/core/Error.mjs"
32
+
33
+ import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
34
+
35
+ import * as ff_core_Float from "../../ff/core/Float.mjs"
36
+
37
+ import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
38
+
39
+ import * as ff_core_Instant from "../../ff/core/Instant.mjs"
40
+
41
+ import * as ff_core_Int from "../../ff/core/Int.mjs"
42
+
43
+ import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
44
+
45
+ import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
46
+
47
+ import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
48
+
49
+ import * as ff_core_List from "../../ff/core/List.mjs"
50
+
51
+ import * as ff_core_Lock from "../../ff/core/Lock.mjs"
52
+
53
+ import * as ff_core_Log from "../../ff/core/Log.mjs"
54
+
55
+ import * as ff_core_Map from "../../ff/core/Map.mjs"
56
+
57
+ import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
58
+
59
+ import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
60
+
61
+ import * as ff_core_Option from "../../ff/core/Option.mjs"
62
+
63
+ import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
64
+
65
+ import * as ff_core_Pair from "../../ff/core/Pair.mjs"
66
+
67
+ import * as ff_core_Path from "../../ff/core/Path.mjs"
68
+
69
+ import * as ff_core_Random from "../../ff/core/Random.mjs"
70
+
71
+ import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
72
+
73
+ import * as ff_core_Set from "../../ff/core/Set.mjs"
74
+
75
+ import * as ff_core_Show from "../../ff/core/Show.mjs"
76
+
77
+ import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
78
+
79
+ import * as ff_core_Stack from "../../ff/core/Stack.mjs"
80
+
81
+ import * as ff_core_Stream from "../../ff/core/Stream.mjs"
82
+
83
+ import * as ff_core_String from "../../ff/core/String.mjs"
84
+
85
+ import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
86
+
87
+ import * as ff_core_Task from "../../ff/core/Task.mjs"
88
+
89
+ import * as ff_core_Try from "../../ff/core/Try.mjs"
90
+
91
+ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
92
+
93
+ import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
94
+
95
+ // type String
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+ export function String_size(self_) {
105
+ return self_.length
106
+ }
107
+
108
+ export function String_grab(self_, index_) {
105
109
 
106
110
  if(index_ < 0 || index_ >= self_.length) {
107
111
  ff_core_Try.internalThrowGrabException_()
108
112
  }
109
113
  return self_.charCodeAt(index_)
110
-
111
- }
112
-
113
- export function String_replace(self_, needle_, replacement_) {
114
- return self_.replaceAll(needle_, replacement_)
115
- }
116
-
117
- export function String_replaceFirst(self_, needle_, replacement_) {
118
- return self_.replace(needle_, replacement_)
119
- }
120
-
121
- export function String_reverse(self_) {
122
- return [...self_].reverse().join('')
123
- }
124
-
125
- export function String_lower(self_) {
126
- return self_.toLowerCase()
127
- }
128
-
129
- export function String_upper(self_) {
130
- return self_.toUpperCase()
131
- }
132
-
133
- export function String_dropWhile(self_, p_) {
114
+
115
+ }
116
+
117
+ export function String_replace(self_, needle_, replacement_) {
118
+ return self_.replaceAll(needle_, replacement_)
119
+ }
120
+
121
+ export function String_replaceFirst(self_, needle_, replacement_) {
122
+ return self_.replace(needle_, replacement_)
123
+ }
124
+
125
+ export function String_reverse(self_) {
126
+ return [...self_].reverse().join('')
127
+ }
128
+
129
+ export function String_lower(self_) {
130
+ return self_.toLowerCase()
131
+ }
132
+
133
+ export function String_upper(self_) {
134
+ return self_.toUpperCase()
135
+ }
136
+
137
+ export function String_dropWhile(self_, p_) {
134
138
 
135
139
  let i = 0
136
140
  for(; i < self_.length && p_(self_.codePointAt(i)); i++);
137
141
  return self_.slice(i)
138
-
139
- }
140
-
141
- export function String_takeWhile(self_, p_) {
142
+
143
+ }
144
+
145
+ export function String_takeWhile(self_, p_) {
142
146
 
143
147
  let i = 0
144
148
  for(; i < self_.length && p_(self_.codePointAt(i)); i++);
145
149
  return self_.slice(0, i)
146
-
147
- }
148
-
149
- export function String_slice(self_, from_, until_) {
150
- return self_.slice(from_, until_)
151
- }
152
-
153
- export function String_split(self_, char_) {
154
- return self_.split(String.fromCharCode(char_))
155
- }
156
-
157
- export function String_splitFirst(self_, char_) {
150
+
151
+ }
152
+
153
+ export function String_slice(self_, from_, until_) {
154
+ return self_.slice(from_, until_)
155
+ }
156
+
157
+ export function String_split(self_, char_) {
158
+ return self_.split(String.fromCharCode(char_))
159
+ }
160
+
161
+ export function String_splitFirst(self_, char_) {
158
162
 
159
163
  const array = self_.split(String.fromCharCode(char_), 2)
160
164
  return array.length === 2
161
165
  ? ff_core_Option.Some(ff_core_Pair.Pair(array[0], array[1]))
162
166
  : ff_core_Option.None()
163
-
164
- }
165
-
166
- export function String_lines(self_) {
167
+
168
+ }
169
+
170
+ export function String_lines(self_) {
167
171
 
168
172
  return ff_core_Array.Array_toList(self_.split(
169
173
  new RegExp("[" + String.fromCharCode(13) + "]?[" + String.fromCharCode(10) + "]", "g")
170
174
  ))
171
-
172
- }
173
-
174
- export function String_dropFirst(self_, count_ = 1) {
175
- return self_.slice(count_)
176
- }
177
-
178
- export function String_dropLast(self_, count_ = 1) {
179
- return self_.slice(0, self_.length - count_)
180
- }
181
-
182
- export function String_getInt(self_) {
175
+
176
+ }
177
+
178
+ export function String_dropFirst(self_, count_ = 1) {
179
+ return self_.slice(count_)
180
+ }
181
+
182
+ export function String_dropLast(self_, count_ = 1) {
183
+ return self_.slice(0, self_.length - count_)
184
+ }
185
+
186
+ export function String_getInt(self_) {
183
187
 
184
188
  if(self_.length == 0) {
185
189
  return ff_core_Option.None()
@@ -189,10 +193,10 @@ export function String_getInt(self_) {
189
193
  if(c < 48 || c > 57) ff_core_Option.None()
190
194
  }
191
195
  return ff_core_Option.Some(parseInt(self_, 10));
192
-
193
- }
194
-
195
- export function String_grabInt(self_) {
196
+
197
+ }
198
+
199
+ export function String_grabInt(self_) {
196
200
 
197
201
  if(self_.length == 0) {
198
202
  ff_core_Try.internalThrowGrabException_()
@@ -202,243 +206,243 @@ export function String_grabInt(self_) {
202
206
  if(c < 48 || c > 57) ff_core_Try.internalThrowGrabException_()
203
207
  }
204
208
  return parseInt(self_, 10);
205
-
206
- }
207
-
208
- export function String_first(self_) {
209
+
210
+ }
211
+
212
+ export function String_first(self_) {
209
213
 
210
214
  return self_.length > 0
211
215
  ? ff_core_Option.Some(self_.charCodeAt(0))
212
216
  : ff_core_Option.None()
213
-
214
- }
215
-
216
- export function String_last(self_) {
217
+
218
+ }
219
+
220
+ export function String_last(self_) {
217
221
 
218
222
  return self_.length > 0
219
223
  ? ff_core_Option.Some(self_.charCodeAt(self_.length - 1))
220
224
  : ff_core_Option.None()
221
-
222
- }
223
-
224
- export function String_grabFirst(self_) {
225
- return ff_core_Option.Option_else(ff_core_String.String_first(self_), (() => {
226
- return ff_core_Try.internalThrowGrabException_()
227
- }))
228
- }
229
-
230
- export function String_grabLast(self_) {
231
- return ff_core_Option.Option_else(ff_core_String.String_last(self_), (() => {
232
- return ff_core_Try.internalThrowGrabException_()
233
- }))
234
- }
235
-
236
- export function String_contains(self_, substring_) {
237
- return self_.includes(substring_)
238
- }
239
-
240
- export function String_startsWith(self_, prefix_, offset_ = 0) {
241
- return self_.startsWith(prefix_, offset_)
242
- }
243
-
244
- export function String_endsWith(self_, prefix_) {
245
- return self_.endsWith(prefix_)
246
- }
247
-
248
- export function String_removeFirst(self_, prefix_) {
249
- if(ff_core_String.String_startsWith(self_, prefix_, 0)) {
250
- return ff_core_Option.Some(ff_core_String.String_dropFirst(self_, ff_core_String.String_size(prefix_)))
251
- } else {
252
- return ff_core_Option.None()
253
- }
254
- }
255
-
256
- export function String_removeLast(self_, suffix_) {
257
- if(ff_core_String.String_endsWith(self_, suffix_)) {
258
- return ff_core_Option.Some(ff_core_String.String_dropLast(self_, ff_core_String.String_size(suffix_)))
259
- } else {
260
- return ff_core_Option.None()
261
- }
262
- }
263
-
264
- export function String_any(self_, body_) {
225
+
226
+ }
227
+
228
+ export function String_grabFirst(self_) {
229
+ return ff_core_Option.Option_else(ff_core_String.String_first(self_), (() => {
230
+ return ff_core_Try.internalThrowGrabException_()
231
+ }))
232
+ }
233
+
234
+ export function String_grabLast(self_) {
235
+ return ff_core_Option.Option_else(ff_core_String.String_last(self_), (() => {
236
+ return ff_core_Try.internalThrowGrabException_()
237
+ }))
238
+ }
239
+
240
+ export function String_contains(self_, substring_) {
241
+ return self_.includes(substring_)
242
+ }
243
+
244
+ export function String_startsWith(self_, prefix_, offset_ = 0) {
245
+ return self_.startsWith(prefix_, offset_)
246
+ }
247
+
248
+ export function String_endsWith(self_, prefix_) {
249
+ return self_.endsWith(prefix_)
250
+ }
251
+
252
+ export function String_removeFirst(self_, prefix_) {
253
+ if(ff_core_String.String_startsWith(self_, prefix_, 0)) {
254
+ return ff_core_Option.Some(ff_core_String.String_dropFirst(self_, ff_core_String.String_size(prefix_)))
255
+ } else {
256
+ return ff_core_Option.None()
257
+ }
258
+ }
259
+
260
+ export function String_removeLast(self_, suffix_) {
261
+ if(ff_core_String.String_endsWith(self_, suffix_)) {
262
+ return ff_core_Option.Some(ff_core_String.String_dropLast(self_, ff_core_String.String_size(suffix_)))
263
+ } else {
264
+ return ff_core_Option.None()
265
+ }
266
+ }
267
+
268
+ export function String_any(self_, body_) {
265
269
 
266
270
  for(let i = 0; i < self_.length; i++) {
267
271
  if(body_(self_.charCodeAt(i))) return true;
268
272
  }
269
273
  return false;
270
-
271
- }
272
-
273
- export function String_all(self_, body_) {
274
+
275
+ }
276
+
277
+ export function String_all(self_, body_) {
274
278
 
275
279
  for(let i = 0; i < self_.length; i++) {
276
280
  if(!body_(self_.charCodeAt(i))) return false;
277
281
  }
278
282
  return true;
279
-
280
- }
281
-
282
- export function String_toBuffer(self_) {
283
+
284
+ }
285
+
286
+ export function String_toBuffer(self_) {
283
287
 
284
288
  const encoded = new TextEncoder().encode(self_)
285
289
  return new DataView(encoded.buffer, encoded.byteOffset, encoded.byteLength)
286
-
287
- }
288
-
289
- export async function String_size$(self_, $task) {
290
- throw new Error('Function String_size is missing on this target in async context.');
291
- }
292
-
293
- export async function String_grab$(self_, index_, $task) {
294
- throw new Error('Function String_grab is missing on this target in async context.');
295
- }
296
-
297
- export async function String_replace$(self_, needle_, replacement_, $task) {
298
- throw new Error('Function String_replace is missing on this target in async context.');
299
- }
300
-
301
- export async function String_replaceFirst$(self_, needle_, replacement_, $task) {
302
- throw new Error('Function String_replaceFirst is missing on this target in async context.');
303
- }
304
-
305
- export async function String_reverse$(self_, $task) {
306
- throw new Error('Function String_reverse is missing on this target in async context.');
307
- }
308
-
309
- export async function String_lower$(self_, $task) {
310
- throw new Error('Function String_lower is missing on this target in async context.');
311
- }
312
-
313
- export async function String_upper$(self_, $task) {
314
- throw new Error('Function String_upper is missing on this target in async context.');
315
- }
316
-
317
- export async function String_dropWhile$(self_, p_, $task) {
290
+
291
+ }
292
+
293
+ export async function String_size$(self_, $task) {
294
+ throw new Error('Function String_size is missing on this target in async context.');
295
+ }
296
+
297
+ export async function String_grab$(self_, index_, $task) {
298
+ throw new Error('Function String_grab is missing on this target in async context.');
299
+ }
300
+
301
+ export async function String_replace$(self_, needle_, replacement_, $task) {
302
+ throw new Error('Function String_replace is missing on this target in async context.');
303
+ }
304
+
305
+ export async function String_replaceFirst$(self_, needle_, replacement_, $task) {
306
+ throw new Error('Function String_replaceFirst is missing on this target in async context.');
307
+ }
308
+
309
+ export async function String_reverse$(self_, $task) {
310
+ throw new Error('Function String_reverse is missing on this target in async context.');
311
+ }
312
+
313
+ export async function String_lower$(self_, $task) {
314
+ throw new Error('Function String_lower is missing on this target in async context.');
315
+ }
316
+
317
+ export async function String_upper$(self_, $task) {
318
+ throw new Error('Function String_upper is missing on this target in async context.');
319
+ }
320
+
321
+ export async function String_dropWhile$(self_, p_, $task) {
318
322
 
319
323
  let i = 0
320
324
  for(; i < self_.length && await p_(self_.codePointAt(i), $task); i++);
321
325
  return self_.slice(i)
322
-
323
- }
324
-
325
- export async function String_takeWhile$(self_, p_, $task) {
326
+
327
+ }
328
+
329
+ export async function String_takeWhile$(self_, p_, $task) {
326
330
 
327
331
  let i = 0
328
332
  for(; i < self_.length && await p_(self_.codePointAt(i), $task); i++);
329
333
  return self_.slice(0, i)
330
-
331
- }
332
-
333
- export async function String_slice$(self_, from_, until_, $task) {
334
- throw new Error('Function String_slice is missing on this target in async context.');
335
- }
336
-
337
- export async function String_split$(self_, char_, $task) {
338
- throw new Error('Function String_split is missing on this target in async context.');
339
- }
340
-
341
- export async function String_splitFirst$(self_, char_, $task) {
342
- throw new Error('Function String_splitFirst is missing on this target in async context.');
343
- }
344
-
345
- export async function String_lines$(self_, $task) {
346
- throw new Error('Function String_lines is missing on this target in async context.');
347
- }
348
-
349
- export async function String_dropFirst$(self_, count_ = 1, $task) {
350
- throw new Error('Function String_dropFirst is missing on this target in async context.');
351
- }
352
-
353
- export async function String_dropLast$(self_, count_ = 1, $task) {
354
- throw new Error('Function String_dropLast is missing on this target in async context.');
355
- }
356
-
357
- export async function String_getInt$(self_, $task) {
358
- throw new Error('Function String_getInt is missing on this target in async context.');
359
- }
360
-
361
- export async function String_grabInt$(self_, $task) {
362
- throw new Error('Function String_grabInt is missing on this target in async context.');
363
- }
364
-
365
- export async function String_first$(self_, $task) {
366
- throw new Error('Function String_first is missing on this target in async context.');
367
- }
368
-
369
- export async function String_last$(self_, $task) {
370
- throw new Error('Function String_last is missing on this target in async context.');
371
- }
372
-
373
- export async function String_grabFirst$(self_, $task) {
374
- return ff_core_Option.Option_else(ff_core_String.String_first(self_), (() => {
375
- return ff_core_Try.internalThrowGrabException_()
376
- }))
377
- }
378
-
379
- export async function String_grabLast$(self_, $task) {
380
- return ff_core_Option.Option_else(ff_core_String.String_last(self_), (() => {
381
- return ff_core_Try.internalThrowGrabException_()
382
- }))
383
- }
384
-
385
- export async function String_contains$(self_, substring_, $task) {
386
- throw new Error('Function String_contains is missing on this target in async context.');
387
- }
388
-
389
- export async function String_startsWith$(self_, prefix_, offset_ = 0, $task) {
390
- throw new Error('Function String_startsWith is missing on this target in async context.');
391
- }
392
-
393
- export async function String_endsWith$(self_, prefix_, $task) {
394
- throw new Error('Function String_endsWith is missing on this target in async context.');
395
- }
396
-
397
- export async function String_removeFirst$(self_, prefix_, $task) {
398
- if(ff_core_String.String_startsWith(self_, prefix_, 0)) {
399
- return ff_core_Option.Some(ff_core_String.String_dropFirst(self_, ff_core_String.String_size(prefix_)))
400
- } else {
401
- return ff_core_Option.None()
402
- }
403
- }
404
-
405
- export async function String_removeLast$(self_, suffix_, $task) {
406
- if(ff_core_String.String_endsWith(self_, suffix_)) {
407
- return ff_core_Option.Some(ff_core_String.String_dropLast(self_, ff_core_String.String_size(suffix_)))
408
- } else {
409
- return ff_core_Option.None()
410
- }
411
- }
412
-
413
- export async function String_any$(self_, body_, $task) {
334
+
335
+ }
336
+
337
+ export async function String_slice$(self_, from_, until_, $task) {
338
+ throw new Error('Function String_slice is missing on this target in async context.');
339
+ }
340
+
341
+ export async function String_split$(self_, char_, $task) {
342
+ throw new Error('Function String_split is missing on this target in async context.');
343
+ }
344
+
345
+ export async function String_splitFirst$(self_, char_, $task) {
346
+ throw new Error('Function String_splitFirst is missing on this target in async context.');
347
+ }
348
+
349
+ export async function String_lines$(self_, $task) {
350
+ throw new Error('Function String_lines is missing on this target in async context.');
351
+ }
352
+
353
+ export async function String_dropFirst$(self_, count_ = 1, $task) {
354
+ throw new Error('Function String_dropFirst is missing on this target in async context.');
355
+ }
356
+
357
+ export async function String_dropLast$(self_, count_ = 1, $task) {
358
+ throw new Error('Function String_dropLast is missing on this target in async context.');
359
+ }
360
+
361
+ export async function String_getInt$(self_, $task) {
362
+ throw new Error('Function String_getInt is missing on this target in async context.');
363
+ }
364
+
365
+ export async function String_grabInt$(self_, $task) {
366
+ throw new Error('Function String_grabInt is missing on this target in async context.');
367
+ }
368
+
369
+ export async function String_first$(self_, $task) {
370
+ throw new Error('Function String_first is missing on this target in async context.');
371
+ }
372
+
373
+ export async function String_last$(self_, $task) {
374
+ throw new Error('Function String_last is missing on this target in async context.');
375
+ }
376
+
377
+ export async function String_grabFirst$(self_, $task) {
378
+ return ff_core_Option.Option_else(ff_core_String.String_first(self_), (() => {
379
+ return ff_core_Try.internalThrowGrabException_()
380
+ }))
381
+ }
382
+
383
+ export async function String_grabLast$(self_, $task) {
384
+ return ff_core_Option.Option_else(ff_core_String.String_last(self_), (() => {
385
+ return ff_core_Try.internalThrowGrabException_()
386
+ }))
387
+ }
388
+
389
+ export async function String_contains$(self_, substring_, $task) {
390
+ throw new Error('Function String_contains is missing on this target in async context.');
391
+ }
392
+
393
+ export async function String_startsWith$(self_, prefix_, offset_ = 0, $task) {
394
+ throw new Error('Function String_startsWith is missing on this target in async context.');
395
+ }
396
+
397
+ export async function String_endsWith$(self_, prefix_, $task) {
398
+ throw new Error('Function String_endsWith is missing on this target in async context.');
399
+ }
400
+
401
+ export async function String_removeFirst$(self_, prefix_, $task) {
402
+ if(ff_core_String.String_startsWith(self_, prefix_, 0)) {
403
+ return ff_core_Option.Some(ff_core_String.String_dropFirst(self_, ff_core_String.String_size(prefix_)))
404
+ } else {
405
+ return ff_core_Option.None()
406
+ }
407
+ }
408
+
409
+ export async function String_removeLast$(self_, suffix_, $task) {
410
+ if(ff_core_String.String_endsWith(self_, suffix_)) {
411
+ return ff_core_Option.Some(ff_core_String.String_dropLast(self_, ff_core_String.String_size(suffix_)))
412
+ } else {
413
+ return ff_core_Option.None()
414
+ }
415
+ }
416
+
417
+ export async function String_any$(self_, body_, $task) {
414
418
 
415
419
  for(let i = 0; i < self_.length; i++) {
416
420
  if(await body_(self_.charCodeAt(i), $task)) return true;
417
421
  }
418
422
  return false;
419
-
420
- }
421
-
422
- export async function String_all$(self_, body_, $task) {
423
+
424
+ }
425
+
426
+ export async function String_all$(self_, body_, $task) {
423
427
 
424
428
  for(let i = 0; i < self_.length; i++) {
425
429
  if(!await body_(self_.charCodeAt(i), $task)) return false;
426
430
  }
427
431
  return true;
428
-
429
- }
430
-
431
- export async function String_toBuffer$(self_, $task) {
432
- throw new Error('Function String_toBuffer is missing on this target in async context.');
433
- }
434
-
435
- export const ff_core_Any_HasAnyTag$ff_core_String_String = {
436
- anyTag_() {
437
- return ff_core_Any.internalAnyTag_((("ff:core/String.String" + "[") + "]"))
438
- },
439
- async anyTag_$($task) {
440
- return ff_core_Any.internalAnyTag_((("ff:core/String.String" + "[") + "]"))
441
- }
442
- };
443
-
444
-
432
+
433
+ }
434
+
435
+ export async function String_toBuffer$(self_, $task) {
436
+ throw new Error('Function String_toBuffer is missing on this target in async context.');
437
+ }
438
+
439
+ export const ff_core_Any_HasAnyTag$ff_core_String_String = {
440
+ anyTag_() {
441
+ return ff_core_Any.internalAnyTag_((("ff:core/String.String" + "[") + "]"))
442
+ },
443
+ async anyTag_$($task) {
444
+ return ff_core_Any.internalAnyTag_((("ff:core/String.String" + "[") + "]"))
445
+ }
446
+ };
447
+
448
+