firefly-compiler 0.5.47 → 0.5.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +1 -1
- package/bin/firefly.mjs +1 -1
- package/compiler/Builder.ff +9 -1
- package/compiler/Compiler.ff +1 -1
- package/compiler/Dependencies.ff +11 -7
- package/compiler/JsEmitter.ff +75 -58
- package/core/BrowserSystem.ff +5 -0
- package/core/Date.ff +623 -0
- package/core/Instant.ff +0 -24
- package/core/JsValue.ff +1 -1
- package/core/Map.ff +16 -0
- package/core/NodeSystem.ff +5 -0
- package/core/Path.ff +2 -2
- package/core/Random.ff +0 -4
- package/core/RbMap.ff +32 -0
- package/core/Set.ff +4 -0
- package/core/Task.ff +0 -4
- package/experimental/tests/TestDate.ff +10 -0
- package/experimental/tests/TestEmailAlertDateLogic.ff +84 -0
- package/firefly.sh +5 -5
- package/lsp/LanguageServer.ff +3 -0
- package/output/js/ff/compiler/Builder.mjs +46 -4
- package/output/js/ff/compiler/Compiler.mjs +3 -3
- package/output/js/ff/compiler/Dependencies.mjs +28 -14
- package/output/js/ff/compiler/DependencyLock.mjs +2 -2
- package/output/js/ff/compiler/Deriver.mjs +2 -2
- package/output/js/ff/compiler/Dictionaries.mjs +2 -2
- package/output/js/ff/compiler/Environment.mjs +2 -2
- package/output/js/ff/compiler/Inference.mjs +2 -2
- package/output/js/ff/compiler/JsEmitter.mjs +675 -575
- package/output/js/ff/compiler/JsImporter.mjs +2 -2
- package/output/js/ff/compiler/LspHook.mjs +2 -2
- package/output/js/ff/compiler/Main.mjs +2 -2
- package/output/js/ff/compiler/ModuleCache.mjs +2 -2
- package/output/js/ff/compiler/Parser.mjs +2 -2
- package/output/js/ff/compiler/Patterns.mjs +2 -2
- package/output/js/ff/compiler/Resolver.mjs +2 -2
- package/output/js/ff/compiler/Substitution.mjs +2 -2
- package/output/js/ff/compiler/Syntax.mjs +2 -2
- package/output/js/ff/compiler/Token.mjs +2 -2
- package/output/js/ff/compiler/Tokenizer.mjs +2 -2
- package/output/js/ff/compiler/Unification.mjs +2 -2
- package/output/js/ff/compiler/Wildcards.mjs +2 -2
- package/output/js/ff/compiler/Workspace.mjs +2 -2
- package/output/js/ff/core/Any.mjs +2 -2
- package/output/js/ff/core/Array.mjs +2 -2
- package/output/js/ff/core/AssetSystem.mjs +2 -2
- package/output/js/ff/core/Atomic.mjs +2 -2
- package/output/js/ff/core/Bool.mjs +2 -2
- package/output/js/ff/core/BrowserSystem.mjs +28 -2
- package/output/js/ff/core/Buffer.mjs +2 -2
- package/output/js/ff/core/BuildSystem.mjs +2 -2
- package/output/js/ff/core/Channel.mjs +2 -2
- package/output/js/ff/core/Char.mjs +2 -2
- package/output/js/ff/core/Core.mjs +2 -2
- package/output/js/ff/core/Crypto.mjs +2 -2
- package/output/js/ff/core/Date.mjs +1009 -0
- package/output/js/ff/core/Duration.mjs +2 -2
- package/output/js/ff/core/Equal.mjs +2 -2
- package/output/js/ff/core/Error.mjs +2 -2
- package/output/js/ff/core/FileHandle.mjs +2 -2
- package/output/js/ff/core/Float.mjs +2 -2
- package/output/js/ff/core/HttpClient.mjs +2 -2
- package/output/js/ff/core/Int.mjs +2 -2
- package/output/js/ff/core/IntMap.mjs +2 -2
- package/output/js/ff/core/Js.mjs +2 -2
- package/output/js/ff/core/JsSystem.mjs +2 -2
- package/output/js/ff/core/JsValue.mjs +3 -3
- package/output/js/ff/core/Json.mjs +2 -2
- package/output/js/ff/core/List.mjs +2 -2
- package/output/js/ff/core/Lock.mjs +2 -2
- package/output/js/ff/core/Log.mjs +2 -2
- package/output/js/ff/core/Map.mjs +34 -2
- package/output/js/ff/core/NodeSystem.mjs +28 -2
- package/output/js/ff/core/Nothing.mjs +2 -2
- package/output/js/ff/core/Option.mjs +2 -2
- package/output/js/ff/core/Ordering.mjs +2 -2
- package/output/js/ff/core/Pair.mjs +2 -2
- package/output/js/ff/core/Path.mjs +6 -12
- package/output/js/ff/core/Queue.mjs +2 -2
- package/output/js/ff/core/Random.mjs +2 -10
- package/output/js/ff/core/RbMap.mjs +186 -2
- package/output/js/ff/core/Serializable.mjs +2 -2
- package/output/js/ff/core/Set.mjs +50 -2
- package/output/js/ff/core/Show.mjs +2 -2
- package/output/js/ff/core/SourceLocation.mjs +2 -2
- package/output/js/ff/core/Stream.mjs +2 -2
- package/output/js/ff/core/String.mjs +2 -2
- package/output/js/ff/core/StringMap.mjs +2 -2
- package/output/js/ff/core/Task.mjs +2 -10
- package/output/js/ff/core/Try.mjs +2 -2
- package/output/js/ff/core/Unit.mjs +2 -2
- package/package.json +1 -1
- package/postgresql/Pg.ff +0 -40
- package/s3/S3.ff +4 -4
- package/vscode/package.json +1 -1
- package/output/js/ff/core/Instant.mjs +0 -149
- /package/fireflysite/assets/markdown/scratch/{Toc.md → toc.md} +0 -0
|
@@ -32,6 +32,8 @@ import * as ff_core_Core from "../../ff/core/Core.mjs"
|
|
|
32
32
|
|
|
33
33
|
import * as ff_core_Crypto from "../../ff/core/Crypto.mjs"
|
|
34
34
|
|
|
35
|
+
import * as ff_core_Date from "../../ff/core/Date.mjs"
|
|
36
|
+
|
|
35
37
|
import * as ff_core_Duration from "../../ff/core/Duration.mjs"
|
|
36
38
|
|
|
37
39
|
import * as ff_core_Equal from "../../ff/core/Equal.mjs"
|
|
@@ -44,8 +46,6 @@ import * as ff_core_Float from "../../ff/core/Float.mjs"
|
|
|
44
46
|
|
|
45
47
|
import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
|
|
46
48
|
|
|
47
|
-
import * as ff_core_Instant from "../../ff/core/Instant.mjs"
|
|
48
|
-
|
|
49
49
|
import * as ff_core_Int from "../../ff/core/Int.mjs"
|
|
50
50
|
|
|
51
51
|
import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
|
|
@@ -747,7 +747,7 @@ export function JsEmitter_emitLetDefinition(self_, definition_, mutable_, async_
|
|
|
747
747
|
const mutability_ = (mutable_
|
|
748
748
|
? "let"
|
|
749
749
|
: "const");
|
|
750
|
-
const valueCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, definition_.value_, async_);
|
|
750
|
+
const valueCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, definition_.value_, async_, false);
|
|
751
751
|
const assignmentCode_ = (((!mutable_) || (valueCode_ !== "(void 0)"))
|
|
752
752
|
? (" = " + valueCode_)
|
|
753
753
|
: "");
|
|
@@ -893,7 +893,7 @@ return (((((prefix_ + "function ") + ff_compiler_JsEmitter.escapeKeyword_(signat
|
|
|
893
893
|
|
|
894
894
|
export function JsEmitter_emitParameter(self_, parameter_, async_) {
|
|
895
895
|
const defaultValue_ = ff_core_Option.Option_else(ff_core_Option.Option_map(parameter_.default_, ((_w1) => {
|
|
896
|
-
return (" = " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_))
|
|
896
|
+
return (" = " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_, false))
|
|
897
897
|
})), (() => {
|
|
898
898
|
return ""
|
|
899
899
|
}));
|
|
@@ -924,7 +924,7 @@ return (((((((((("export function " + definition_.name_) + "(") + fields_) + ")
|
|
|
924
924
|
}
|
|
925
925
|
}
|
|
926
926
|
|
|
927
|
-
export function JsEmitter_emitTerm(self_, term_, async_) {
|
|
927
|
+
export function JsEmitter_emitTerm(self_, term_, async_, ignored_ = false) {
|
|
928
928
|
{
|
|
929
929
|
const _1 = term_;
|
|
930
930
|
if(_1.EString) {
|
|
@@ -1017,9 +1017,9 @@ const name_ = _1.name_;
|
|
|
1017
1017
|
const record_ = _1.record_;
|
|
1018
1018
|
const fields_ = _1.arguments_;
|
|
1019
1019
|
const fieldCode_ = ff_core_List.List_join(ff_core_List.List_map(fields_, ((f_) => {
|
|
1020
|
-
return ((ff_compiler_JsEmitter.escapeKeyword_(f_.name_) + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, f_.value_, async_))
|
|
1020
|
+
return ((ff_compiler_JsEmitter.escapeKeyword_(f_.name_) + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, f_.value_, async_, false))
|
|
1021
1021
|
})), ", ");
|
|
1022
|
-
return (((("{..." + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, record_, async_)) + ", ") + fieldCode_) + "}")
|
|
1022
|
+
return (((("{..." + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, record_, async_, false)) + ", ") + fieldCode_) + "}")
|
|
1023
1023
|
}
|
|
1024
1024
|
if(_1.EField) {
|
|
1025
1025
|
const at_ = _1.at_;
|
|
@@ -1027,9 +1027,9 @@ const newtype_ = _1.newtype_;
|
|
|
1027
1027
|
const record_ = _1.record_;
|
|
1028
1028
|
const field_ = _1.field_;
|
|
1029
1029
|
if(newtype_) {
|
|
1030
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, record_, async_)
|
|
1030
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, record_, async_, false)
|
|
1031
1031
|
} else {
|
|
1032
|
-
return ((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, record_, async_) + ".") + ff_compiler_JsEmitter.escapeKeyword_(field_))
|
|
1032
|
+
return ((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, record_, async_, false) + ".") + ff_compiler_JsEmitter.escapeKeyword_(field_))
|
|
1033
1033
|
}
|
|
1034
1034
|
return
|
|
1035
1035
|
}
|
|
@@ -1108,7 +1108,7 @@ const await_ = (async_ && ff_compiler_JsEmitter.effectTypeIsAsync_(effect_));
|
|
|
1108
1108
|
const c_ = (await_
|
|
1109
1109
|
? ", $task"
|
|
1110
1110
|
: "");
|
|
1111
|
-
const call_ = ((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, function_, async_)) + ")(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_)) + c_) + ")");
|
|
1111
|
+
const call_ = ((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, function_, async_, false)) + ")(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_, false)) + c_) + ")");
|
|
1112
1112
|
if(await_) {
|
|
1113
1113
|
return (("(await " + call_) + ")")
|
|
1114
1114
|
} else {
|
|
@@ -1116,6 +1116,18 @@ return call_
|
|
|
1116
1116
|
}
|
|
1117
1117
|
return
|
|
1118
1118
|
}
|
|
1119
|
+
{
|
|
1120
|
+
const _guard1 = ff_compiler_JsEmitter.JsEmitter_emitAssignment(self_, term_, async_);
|
|
1121
|
+
if(_guard1.Some) {
|
|
1122
|
+
const code_ = _guard1.value_;
|
|
1123
|
+
if(ignored_) {
|
|
1124
|
+
return code_
|
|
1125
|
+
} else {
|
|
1126
|
+
return (("(" + code_) + ", void 0)")
|
|
1127
|
+
}
|
|
1128
|
+
return
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1119
1131
|
if(_1.ECall && _1.target_.StaticCall) {
|
|
1120
1132
|
const at_ = _1.at_;
|
|
1121
1133
|
const name_ = _1.target_.name_;
|
|
@@ -1204,12 +1216,12 @@ return
|
|
|
1204
1216
|
if(_1.length >= 1 && _1[0].first_.EVariant && _1[0].first_.name_ === "ff:core/Bool.True") {
|
|
1205
1217
|
const elseBody_ = _1[0].second_;
|
|
1206
1218
|
const list_ = _1.slice(1);
|
|
1207
|
-
return (("(" + ff_core_List.List_foldLeft(list_, ff_compiler_JsEmitter.
|
|
1219
|
+
return (("(" + ff_core_List.List_foldLeft(list_, ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, elseBody_, async_, false), ((_1, _2) => {
|
|
1208
1220
|
{
|
|
1209
1221
|
const otherwise_ = _1;
|
|
1210
1222
|
const condition_ = _2.first_;
|
|
1211
1223
|
const body_ = _2.second_;
|
|
1212
|
-
return ((((ff_compiler_JsEmitter.
|
|
1224
|
+
return ((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_, false) + "\n? ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_, false)) + "\n: ") + otherwise_)
|
|
1213
1225
|
}
|
|
1214
1226
|
}))) + ")")
|
|
1215
1227
|
return
|
|
@@ -1221,7 +1233,7 @@ return (("(" + ff_core_List.List_foldLeft(list_, "ff_core_Option.None()", ((_1,
|
|
|
1221
1233
|
const otherwise_ = _1;
|
|
1222
1234
|
const condition_ = _2.first_;
|
|
1223
1235
|
const body_ = _2.second_;
|
|
1224
|
-
return ((((ff_compiler_JsEmitter.
|
|
1236
|
+
return ((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_, false) + "\n? ff_core_Option.Some(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_, false)) + ")\n: ") + otherwise_)
|
|
1225
1237
|
}
|
|
1226
1238
|
}))) + ")")
|
|
1227
1239
|
return
|
|
@@ -1240,7 +1252,7 @@ const await_ = (async_ && ff_compiler_JsEmitter.effectTypeIsAsync_(effect_));
|
|
|
1240
1252
|
if((!ff_core_List.List_isEmpty(dictionaries_))) {
|
|
1241
1253
|
ff_compiler_JsEmitter.fail_(at_, "Internal error: Dictionaries in lambda call")
|
|
1242
1254
|
};
|
|
1243
|
-
const functionCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, function_, async_);
|
|
1255
|
+
const functionCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, function_, async_, false);
|
|
1244
1256
|
const emittedArguments_ = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
1245
1257
|
return ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, _w1, async_)
|
|
1246
1258
|
}));
|
|
@@ -1262,7 +1274,7 @@ if(ff_core_List.List_isEmpty(fields_)) {
|
|
|
1262
1274
|
return "{}"
|
|
1263
1275
|
} else {
|
|
1264
1276
|
const list_ = ff_core_List.List_map(fields_, ((f_) => {
|
|
1265
|
-
return ((ff_compiler_JsEmitter.escapeKeyword_(f_.name_) + ": ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, f_.value_, async_))
|
|
1277
|
+
return ((ff_compiler_JsEmitter.escapeKeyword_(f_.name_) + ": ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, f_.value_, async_, false))
|
|
1266
1278
|
}));
|
|
1267
1279
|
return (("{\n" + ff_core_List.List_join(list_, ",\n")) + "\n}")
|
|
1268
1280
|
}
|
|
@@ -1276,6 +1288,30 @@ ff_compiler_JsEmitter.fail_(at_, "Unbound wildcard")
|
|
|
1276
1288
|
};
|
|
1277
1289
|
return ("_w" + index_)
|
|
1278
1290
|
}
|
|
1291
|
+
if(_1.ESequential && _1.before_.ESequential && _1.before_.before_.ESequential) {
|
|
1292
|
+
const before1_ = _1.before_.before_.before_;
|
|
1293
|
+
const before2_ = _1.before_.before_.after_;
|
|
1294
|
+
const before3_ = _1.before_.after_;
|
|
1295
|
+
const after_ = _1.after_;
|
|
1296
|
+
if((((ff_compiler_JsEmitter.safeCommable_(before1_) && ff_compiler_JsEmitter.safeCommable_(before2_)) && ff_compiler_JsEmitter.safeCommable_(before3_)) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
1297
|
+
return (((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, before1_, async_, true)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, before2_, async_, true)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, before3_, async_, true)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, after_, async_, ignored_)) + ")")
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
if(_1.ESequential && _1.before_.ESequential) {
|
|
1301
|
+
const before1_ = _1.before_.before_;
|
|
1302
|
+
const before2_ = _1.before_.after_;
|
|
1303
|
+
const after_ = _1.after_;
|
|
1304
|
+
if(((ff_compiler_JsEmitter.safeCommable_(before1_) && ff_compiler_JsEmitter.safeCommable_(before2_)) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
1305
|
+
return (((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, before1_, async_, true)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, before2_, async_, true)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, after_, async_, ignored_)) + ")")
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
if(_1.ESequential) {
|
|
1309
|
+
const before_ = _1.before_;
|
|
1310
|
+
const after_ = _1.after_;
|
|
1311
|
+
if((ff_compiler_JsEmitter.safeCommable_(before_) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
1312
|
+
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, before_, async_, true)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, after_, async_, ignored_)) + ")")
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1279
1315
|
if(async_) {
|
|
1280
1316
|
return (("(await (async function() {\n" + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, term_, true, false, async_)) + "\n})())")
|
|
1281
1317
|
}
|
|
@@ -1297,7 +1333,7 @@ return (dot_ + s_)
|
|
|
1297
1333
|
}
|
|
1298
1334
|
}
|
|
1299
1335
|
{
|
|
1300
|
-
return (("[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, term_, async_)) + "]")
|
|
1336
|
+
return (("[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, term_, async_, false)) + "]")
|
|
1301
1337
|
}
|
|
1302
1338
|
}
|
|
1303
1339
|
}
|
|
@@ -1356,21 +1392,6 @@ const before_ = _1.before_;
|
|
|
1356
1392
|
const after_ = _1.after_;
|
|
1357
1393
|
return ((ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before_, false, false, async_) + ";\n") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, after_, last_, break_, async_))
|
|
1358
1394
|
}
|
|
1359
|
-
if(_1.EAssign) {
|
|
1360
|
-
const at_ = _1.at_;
|
|
1361
|
-
const operator_ = _1.operator_;
|
|
1362
|
-
const name_ = _1.variable_;
|
|
1363
|
-
const value_ = _1.value_;
|
|
1364
|
-
return ((((ff_compiler_JsEmitter.escapeKeyword_(name_) + " ") + operator_) + "= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_))
|
|
1365
|
-
}
|
|
1366
|
-
if(_1.EAssignField) {
|
|
1367
|
-
const at_ = _1.at_;
|
|
1368
|
-
const operator_ = _1.operator_;
|
|
1369
|
-
const record_ = _1.record_;
|
|
1370
|
-
const field_ = _1.field_;
|
|
1371
|
-
const value_ = _1.value_;
|
|
1372
|
-
return ((((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, record_, async_) + ".") + ff_compiler_JsEmitter.escapeKeyword_(field_)) + " ") + operator_) + "= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_))
|
|
1373
|
-
}
|
|
1374
1395
|
if(_1.ECall && _1.target_.StaticCall && _1.target_.tailCall_) {
|
|
1375
1396
|
const at_ = _1.at_;
|
|
1376
1397
|
const name_ = _1.target_.name_;
|
|
@@ -1382,7 +1403,7 @@ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Sy
|
|
|
1382
1403
|
};
|
|
1383
1404
|
self_.tailCallUsed_ = true;
|
|
1384
1405
|
const pair_ = ff_core_List.List_unzip(ff_core_List.List_collect(ff_core_List.List_map(arguments_, ((a_) => {
|
|
1385
|
-
return ff_core_Option.Some(ff_core_Pair.Pair((((("const " + ff_compiler_JsEmitter.escapeKeyword_((ff_core_Option.Option_grab(a_.name_) + "_r"))) + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a_.value_, async_)) + ";"), ((ff_compiler_JsEmitter.escapeKeyword_(ff_core_Option.Option_grab(a_.name_)) + " = ") + ff_compiler_JsEmitter.escapeKeyword_((ff_core_Option.Option_grab(a_.name_) + "_r")))))
|
|
1406
|
+
return ff_core_Option.Some(ff_core_Pair.Pair((((("const " + ff_compiler_JsEmitter.escapeKeyword_((ff_core_Option.Option_grab(a_.name_) + "_r"))) + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a_.value_, async_, false)) + ";"), ((ff_compiler_JsEmitter.escapeKeyword_(ff_core_Option.Option_grab(a_.name_)) + " = ") + ff_compiler_JsEmitter.escapeKeyword_((ff_core_Option.Option_grab(a_.name_) + "_r")))))
|
|
1386
1407
|
})), ((_w1) => {
|
|
1387
1408
|
return _w1
|
|
1388
1409
|
})));
|
|
@@ -1408,7 +1429,7 @@ const cases_ = _1.function_.lambda_.cases_;
|
|
|
1408
1429
|
ff_compiler_Patterns.convertAndCheck_(self_.otherModules_, cases_);
|
|
1409
1430
|
return (((((((((!last_) && (!break_))
|
|
1410
1431
|
? "do "
|
|
1411
|
-
: "") + "{\nconst _1 = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_)) + ";\n") + ff_core_List.List_join(ff_core_List.List_map(ff_core_List.List_pairs(cases_), ((_1) => {
|
|
1432
|
+
: "") + "{\nconst _1 = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_, false)) + ";\n") + ff_core_List.List_join(ff_core_List.List_map(ff_core_List.List_pairs(cases_), ((_1) => {
|
|
1412
1433
|
{
|
|
1413
1434
|
const i_ = _1.first_;
|
|
1414
1435
|
const c_ = _1.second_;
|
|
@@ -1421,15 +1442,22 @@ return ff_compiler_JsEmitter.JsEmitter_emitCase(self_, ["_1"], c_, [], [], true,
|
|
|
1421
1442
|
return
|
|
1422
1443
|
}
|
|
1423
1444
|
{
|
|
1445
|
+
const _guard1 = ff_compiler_JsEmitter.JsEmitter_emitAssignment(self_, term_, async_);
|
|
1446
|
+
if(_guard1.Some) {
|
|
1447
|
+
const code_ = _guard1.value_;
|
|
1448
|
+
return code_
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
{
|
|
1424
1452
|
{
|
|
1425
1453
|
const _1 = ff_compiler_JsEmitter.detectIfElse_(term_);
|
|
1426
1454
|
if(_1.length === 0) {
|
|
1427
1455
|
if(break_) {
|
|
1428
|
-
return (("if(!" + ff_compiler_JsEmitter.
|
|
1456
|
+
return (("if(!" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, term_, async_, false)) + ") break")
|
|
1429
1457
|
} else if(last_) {
|
|
1430
|
-
return ("return " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, term_, async_))
|
|
1458
|
+
return ("return " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, term_, async_, false))
|
|
1431
1459
|
} else {
|
|
1432
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, term_, async_)
|
|
1460
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, term_, async_, true)
|
|
1433
1461
|
}
|
|
1434
1462
|
return
|
|
1435
1463
|
}
|
|
@@ -1442,7 +1470,7 @@ return ff_core_List.List_foldLeft(list_, initial_, ((_1, _2) => {
|
|
|
1442
1470
|
const otherwise_ = _1;
|
|
1443
1471
|
const condition_ = _2.first_;
|
|
1444
1472
|
const body_ = _2.second_;
|
|
1445
|
-
return ((((("if(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_)) + ") {\n") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, body_, last_, break_, async_)) + "\n} else ") + otherwise_)
|
|
1473
|
+
return ((((("if(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_, false)) + ") {\n") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, body_, last_, break_, async_)) + "\n} else ") + otherwise_)
|
|
1446
1474
|
}
|
|
1447
1475
|
}))
|
|
1448
1476
|
return
|
|
@@ -1455,7 +1483,7 @@ return ff_core_List.List_foldLeft(list_, "{}", ((_1, _2) => {
|
|
|
1455
1483
|
const otherwise_ = _1;
|
|
1456
1484
|
const condition_ = _2.first_;
|
|
1457
1485
|
const body_ = _2.second_;
|
|
1458
|
-
return ((((("if(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_)) + ") {\n") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, body_, last_, break_, async_)) + "\n} else ") + otherwise_)
|
|
1486
|
+
return ((((("if(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_, false)) + ") {\n") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, body_, last_, break_, async_)) + "\n} else ") + otherwise_)
|
|
1459
1487
|
}
|
|
1460
1488
|
}))
|
|
1461
1489
|
return
|
|
@@ -1468,7 +1496,7 @@ return ff_core_List.List_foldLeft(list_, "return ff_core_Option.None()", ((_1, _
|
|
|
1468
1496
|
const otherwise_ = _1;
|
|
1469
1497
|
const condition_ = _2.first_;
|
|
1470
1498
|
const body_ = _2.second_;
|
|
1471
|
-
return (((((("if(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_)) + ") {\n") + "return ff_core_Option.Some(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_)) + ")\n} else ") + otherwise_)
|
|
1499
|
+
return (((((("if(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_, false)) + ") {\n") + "return ff_core_Option.Some(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_, false)) + ")\n} else ") + otherwise_)
|
|
1472
1500
|
}
|
|
1473
1501
|
}))
|
|
1474
1502
|
return
|
|
@@ -1479,6 +1507,172 @@ return
|
|
|
1479
1507
|
}
|
|
1480
1508
|
}
|
|
1481
1509
|
|
|
1510
|
+
export function JsEmitter_emitAssignment(self_, term_, async_) {
|
|
1511
|
+
const self_a = self_;
|
|
1512
|
+
const term_a = term_;
|
|
1513
|
+
const async_a = async_;
|
|
1514
|
+
if(term_a.ECall && term_a.target_.StaticCall) {
|
|
1515
|
+
const at_ = term_a.at_;
|
|
1516
|
+
const name_ = term_a.target_.name_;
|
|
1517
|
+
const arguments_ = term_a.arguments_;
|
|
1518
|
+
const dictionaries_ = term_a.dictionaries_;
|
|
1519
|
+
{
|
|
1520
|
+
const _1 = name_;
|
|
1521
|
+
if(_1 === "ff:core/JsValue.JsValue_set") {
|
|
1522
|
+
const _guard1 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
1523
|
+
return _w1.value_
|
|
1524
|
+
}));
|
|
1525
|
+
if(_guard1.length === 3) {
|
|
1526
|
+
const e1_ = _guard1[0];
|
|
1527
|
+
const e2_ = _guard1[1];
|
|
1528
|
+
const e3_ = _guard1[2];
|
|
1529
|
+
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")) + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_, false)))
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
if(_1 === "ff:core/JsValue.JsValue_increment") {
|
|
1533
|
+
const _guard1 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
1534
|
+
return _w1.value_
|
|
1535
|
+
}));
|
|
1536
|
+
if(_guard1.length === 3) {
|
|
1537
|
+
const e1_ = _guard1[0];
|
|
1538
|
+
const e2_ = _guard1[1];
|
|
1539
|
+
const e3_ = _guard1[2];
|
|
1540
|
+
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")) + " += ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_, false)))
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
if(_1 === "ff:core/JsValue.JsValue_decrement") {
|
|
1544
|
+
const _guard1 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
1545
|
+
return _w1.value_
|
|
1546
|
+
}));
|
|
1547
|
+
if(_guard1.length === 3) {
|
|
1548
|
+
const e1_ = _guard1[0];
|
|
1549
|
+
const e2_ = _guard1[1];
|
|
1550
|
+
const e3_ = _guard1[2];
|
|
1551
|
+
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")) + " -= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_, false)))
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
if(_1 === "ff:core/JsSystem.JsSystem_set") {
|
|
1555
|
+
const _guard3 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
1556
|
+
return _w1.value_
|
|
1557
|
+
}));
|
|
1558
|
+
if(_guard3.length === 3 && _guard3[1].EString) {
|
|
1559
|
+
const e1_ = _guard3[0];
|
|
1560
|
+
const q_ = _guard3[1].value_;
|
|
1561
|
+
const e3_ = _guard3[2];
|
|
1562
|
+
const _guard2 = ff_compiler_JsEmitter.noSideEffects_(e1_);
|
|
1563
|
+
if(_guard2) {
|
|
1564
|
+
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
1565
|
+
if(_guard1.Some) {
|
|
1566
|
+
const s_ = _guard1.value_;
|
|
1567
|
+
return ff_core_Option.Some(((s_ + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_, false)))
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
if(_1 === "ff:core/JsSystem.JsSystem_increment") {
|
|
1573
|
+
const _guard3 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
1574
|
+
return _w1.value_
|
|
1575
|
+
}));
|
|
1576
|
+
if(_guard3.length === 3 && _guard3[1].EString) {
|
|
1577
|
+
const e1_ = _guard3[0];
|
|
1578
|
+
const q_ = _guard3[1].value_;
|
|
1579
|
+
const e3_ = _guard3[2];
|
|
1580
|
+
const _guard2 = ff_compiler_JsEmitter.noSideEffects_(e1_);
|
|
1581
|
+
if(_guard2) {
|
|
1582
|
+
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
1583
|
+
if(_guard1.Some) {
|
|
1584
|
+
const s_ = _guard1.value_;
|
|
1585
|
+
return ff_core_Option.Some(((s_ + " += ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_, false)))
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
if(_1 === "ff:core/JsSystem.JsSystem_decrement") {
|
|
1591
|
+
const _guard3 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
1592
|
+
return _w1.value_
|
|
1593
|
+
}));
|
|
1594
|
+
if(_guard3.length === 3 && _guard3[1].EString) {
|
|
1595
|
+
const e1_ = _guard3[0];
|
|
1596
|
+
const q_ = _guard3[1].value_;
|
|
1597
|
+
const e3_ = _guard3[2];
|
|
1598
|
+
const _guard2 = ff_compiler_JsEmitter.noSideEffects_(e1_);
|
|
1599
|
+
if(_guard2) {
|
|
1600
|
+
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
1601
|
+
if(_guard1.Some) {
|
|
1602
|
+
const s_ = _guard1.value_;
|
|
1603
|
+
return ff_core_Option.Some(((s_ + " -= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_, false)))
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
if(_1 === "ff:core/Js.set") {
|
|
1609
|
+
const _guard2 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
1610
|
+
return _w1.value_
|
|
1611
|
+
}));
|
|
1612
|
+
if(_guard2.length === 2 && _guard2[0].EString) {
|
|
1613
|
+
const q_ = _guard2[0].value_;
|
|
1614
|
+
const e2_ = _guard2[1];
|
|
1615
|
+
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
1616
|
+
if(_guard1.Some) {
|
|
1617
|
+
const s_ = _guard1.value_;
|
|
1618
|
+
return ff_core_Option.Some(((s_ + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)))
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
if(_1 === "ff:core/Js.increment") {
|
|
1623
|
+
const _guard2 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
1624
|
+
return _w1.value_
|
|
1625
|
+
}));
|
|
1626
|
+
if(_guard2.length === 2 && _guard2[0].EString) {
|
|
1627
|
+
const q_ = _guard2[0].value_;
|
|
1628
|
+
const e2_ = _guard2[1];
|
|
1629
|
+
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
1630
|
+
if(_guard1.Some) {
|
|
1631
|
+
const s_ = _guard1.value_;
|
|
1632
|
+
return ff_core_Option.Some(((s_ + " += ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)))
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
if(_1 === "ff:core/Js.decrement") {
|
|
1637
|
+
const _guard2 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
1638
|
+
return _w1.value_
|
|
1639
|
+
}));
|
|
1640
|
+
if(_guard2.length === 2 && _guard2[0].EString) {
|
|
1641
|
+
const q_ = _guard2[0].value_;
|
|
1642
|
+
const e2_ = _guard2[1];
|
|
1643
|
+
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
1644
|
+
if(_guard1.Some) {
|
|
1645
|
+
const s_ = _guard1.value_;
|
|
1646
|
+
return ff_core_Option.Some(((s_ + " -= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)))
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
{
|
|
1651
|
+
return ff_core_Option.None()
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
return
|
|
1655
|
+
}
|
|
1656
|
+
if(term_a.EAssign) {
|
|
1657
|
+
const at_ = term_a.at_;
|
|
1658
|
+
const operator_ = term_a.operator_;
|
|
1659
|
+
const name_ = term_a.variable_;
|
|
1660
|
+
const value_ = term_a.value_;
|
|
1661
|
+
return ff_core_Option.Some(((((ff_compiler_JsEmitter.escapeKeyword_(name_) + " ") + operator_) + "= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_, false)))
|
|
1662
|
+
}
|
|
1663
|
+
if(term_a.EAssignField) {
|
|
1664
|
+
const at_ = term_a.at_;
|
|
1665
|
+
const operator_ = term_a.operator_;
|
|
1666
|
+
const record_ = term_a.record_;
|
|
1667
|
+
const field_ = term_a.field_;
|
|
1668
|
+
const value_ = term_a.value_;
|
|
1669
|
+
return ff_core_Option.Some(((((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, record_, async_, false) + ".") + ff_compiler_JsEmitter.escapeKeyword_(field_)) + " ") + operator_) + "= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_, false)))
|
|
1670
|
+
}
|
|
1671
|
+
{
|
|
1672
|
+
return ff_core_Option.None()
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1482
1676
|
export function JsEmitter_emitSpecialCall(self_, term_, async_, name_, arguments_, dictionaries_) {
|
|
1483
1677
|
{
|
|
1484
1678
|
const _1 = name_;
|
|
@@ -1489,7 +1683,7 @@ if(_guard2) {
|
|
|
1489
1683
|
const _guard1 = arguments_;
|
|
1490
1684
|
if(_guard1.length === 1) {
|
|
1491
1685
|
const value_ = _guard1[0];
|
|
1492
|
-
return ff_core_Option.Some(((("(" + operator_) + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_)) + ")"))
|
|
1686
|
+
return ff_core_Option.Some(((("(" + operator_) + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_, false)) + ")"))
|
|
1493
1687
|
}
|
|
1494
1688
|
}
|
|
1495
1689
|
}
|
|
@@ -1501,7 +1695,7 @@ const _guard1 = arguments_;
|
|
|
1501
1695
|
if(_guard1.length === 2) {
|
|
1502
1696
|
const left_ = _guard1[0];
|
|
1503
1697
|
const right_ = _guard1[1];
|
|
1504
|
-
return ff_core_Option.Some((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_)) + " ") + operator_) + " ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_)) + ")"))
|
|
1698
|
+
return ff_core_Option.Some((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_, false)) + " ") + operator_) + " ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_, false)) + ")"))
|
|
1505
1699
|
}
|
|
1506
1700
|
}
|
|
1507
1701
|
}
|
|
@@ -1511,8 +1705,8 @@ if(_guard2.length === 2) {
|
|
|
1511
1705
|
const e1_ = _guard2[0];
|
|
1512
1706
|
const e2_ = _guard2[1];
|
|
1513
1707
|
if((ff_compiler_JsEmitter.noSideEffects_(e1_) && ff_compiler_JsEmitter.noSideEffects_(e2_))) {
|
|
1514
|
-
const code1_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_);
|
|
1515
|
-
const code2_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_);
|
|
1708
|
+
const code1_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false);
|
|
1709
|
+
const code2_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false);
|
|
1516
1710
|
return ff_core_Option.Some(((((((((("(" + code1_) + "[") + code2_) + "] ?? ") + "ff_core_List.List_grab(") + code1_) + ", ") + code2_) + "))"))
|
|
1517
1711
|
}
|
|
1518
1712
|
}
|
|
@@ -1523,8 +1717,8 @@ if(_guard2.length === 2) {
|
|
|
1523
1717
|
const e1_ = _guard2[0];
|
|
1524
1718
|
const e2_ = _guard2[1];
|
|
1525
1719
|
if((ff_compiler_JsEmitter.noSideEffects_(e1_) && ff_compiler_JsEmitter.noSideEffects_(e2_))) {
|
|
1526
|
-
const code1_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_);
|
|
1527
|
-
const code2_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_);
|
|
1720
|
+
const code1_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false);
|
|
1721
|
+
const code2_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false);
|
|
1528
1722
|
return ff_core_Option.Some(((((((((("(" + code1_) + ".array[") + code2_) + "] ?? ") + "ff_core_Array.Array_grab(") + code1_) + ", ") + code2_) + "))"))
|
|
1529
1723
|
}
|
|
1530
1724
|
}
|
|
@@ -1533,21 +1727,21 @@ if(_1 === "ff:core/List.List_size") {
|
|
|
1533
1727
|
const _guard1 = arguments_;
|
|
1534
1728
|
if(_guard1.length === 1) {
|
|
1535
1729
|
const e_ = _guard1[0];
|
|
1536
|
-
return ff_core_Option.Some((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_) + ".length"))
|
|
1730
|
+
return ff_core_Option.Some((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false) + ".length"))
|
|
1537
1731
|
}
|
|
1538
1732
|
}
|
|
1539
1733
|
if(_1 === "ff:core/Array.Array_size") {
|
|
1540
1734
|
const _guard1 = arguments_;
|
|
1541
1735
|
if(_guard1.length === 1) {
|
|
1542
1736
|
const e_ = _guard1[0];
|
|
1543
|
-
return ff_core_Option.Some((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_) + ".array.length"))
|
|
1737
|
+
return ff_core_Option.Some((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false) + ".array.length"))
|
|
1544
1738
|
}
|
|
1545
1739
|
}
|
|
1546
1740
|
if(_1 === "ff:core/String.String_size") {
|
|
1547
1741
|
const _guard1 = arguments_;
|
|
1548
1742
|
if(_guard1.length === 1) {
|
|
1549
1743
|
const e_ = _guard1[0];
|
|
1550
|
-
return ff_core_Option.Some((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_) + ".length"))
|
|
1744
|
+
return ff_core_Option.Some((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false) + ".length"))
|
|
1551
1745
|
}
|
|
1552
1746
|
}
|
|
1553
1747
|
if(_1 === "ff:core/Equal.equals") {
|
|
@@ -1559,7 +1753,7 @@ const _guard2 = dictionaries_;
|
|
|
1559
1753
|
if(_guard2.length === 1 && _guard2[0].dictionaries_.length === 0) {
|
|
1560
1754
|
const typeName_ = _guard2[0].typeName_;
|
|
1561
1755
|
if((ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String) || (typeName_ === "ff:core/Ordering.Ordering"))) {
|
|
1562
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_)) + " === ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_)) + ")"))
|
|
1756
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_, false)) + " === ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_, false)) + ")"))
|
|
1563
1757
|
}
|
|
1564
1758
|
}
|
|
1565
1759
|
}
|
|
@@ -1573,7 +1767,7 @@ const _guard2 = dictionaries_;
|
|
|
1573
1767
|
if(_guard2.length === 1 && _guard2[0].dictionaries_.length === 0) {
|
|
1574
1768
|
const typeName_ = _guard2[0].typeName_;
|
|
1575
1769
|
if((ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String) || (typeName_ === "ff:core/Ordering.Ordering"))) {
|
|
1576
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_)) + " !== ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_)) + ")"))
|
|
1770
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_, false)) + " !== ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_, false)) + ")"))
|
|
1577
1771
|
}
|
|
1578
1772
|
}
|
|
1579
1773
|
}
|
|
@@ -1587,7 +1781,7 @@ const _guard2 = dictionaries_;
|
|
|
1587
1781
|
if(_guard2.length === 1 && _guard2[0].dictionaries_.length === 0) {
|
|
1588
1782
|
const typeName_ = _guard2[0].typeName_;
|
|
1589
1783
|
if(ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)) {
|
|
1590
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_)) + " < ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_)) + ")"))
|
|
1784
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_, false)) + " < ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_, false)) + ")"))
|
|
1591
1785
|
}
|
|
1592
1786
|
}
|
|
1593
1787
|
}
|
|
@@ -1601,7 +1795,7 @@ const _guard2 = dictionaries_;
|
|
|
1601
1795
|
if(_guard2.length === 1 && _guard2[0].dictionaries_.length === 0) {
|
|
1602
1796
|
const typeName_ = _guard2[0].typeName_;
|
|
1603
1797
|
if(ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)) {
|
|
1604
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_)) + " >= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_)) + ")"))
|
|
1798
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_, false)) + " >= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_, false)) + ")"))
|
|
1605
1799
|
}
|
|
1606
1800
|
}
|
|
1607
1801
|
}
|
|
@@ -1615,7 +1809,7 @@ const _guard2 = dictionaries_;
|
|
|
1615
1809
|
if(_guard2.length === 1 && _guard2[0].dictionaries_.length === 0) {
|
|
1616
1810
|
const typeName_ = _guard2[0].typeName_;
|
|
1617
1811
|
if(ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)) {
|
|
1618
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_)) + " > ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_)) + ")"))
|
|
1812
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_, false)) + " > ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_, false)) + ")"))
|
|
1619
1813
|
}
|
|
1620
1814
|
}
|
|
1621
1815
|
}
|
|
@@ -1629,7 +1823,7 @@ const _guard2 = dictionaries_;
|
|
|
1629
1823
|
if(_guard2.length === 1 && _guard2[0].dictionaries_.length === 0) {
|
|
1630
1824
|
const typeName_ = _guard2[0].typeName_;
|
|
1631
1825
|
if(ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)) {
|
|
1632
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_)) + " <= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_)) + ")"))
|
|
1826
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_, false)) + " <= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_, false)) + ")"))
|
|
1633
1827
|
}
|
|
1634
1828
|
}
|
|
1635
1829
|
}
|
|
@@ -1656,7 +1850,7 @@ const newAsync_ = (self_.emittingAsync_ && ff_compiler_JsEmitter.effectTypeIsAsy
|
|
|
1656
1850
|
const await_ = (newAsync_
|
|
1657
1851
|
? "await "
|
|
1658
1852
|
: "");
|
|
1659
|
-
return ff_core_Option.Some(((((((((((((((((((await_ + "((() => {\n") + "const size = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, 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") + "})())"))
|
|
1853
|
+
return ff_core_Option.Some(((((((((((((((((((await_ + "((() => {\n") + "const size = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, size_, async_, false)) + ";\n") + "const result = [];\n") + "for(let ") + n_) + " = 0; ") + n_) + " < size; ") + n_) + "++) {\n") + "result.push(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, newAsync_, false)) + ");\n") + "}\n") + "return result;\n") + "})())"))
|
|
1660
1854
|
}
|
|
1661
1855
|
}
|
|
1662
1856
|
}
|
|
@@ -1697,7 +1891,7 @@ if(_1 === "ff:core/Js.dynamicImport") {
|
|
|
1697
1891
|
const _guard1 = arguments_;
|
|
1698
1892
|
if(_guard1.length === 1) {
|
|
1699
1893
|
const url_ = _guard1[0];
|
|
1700
|
-
return ff_core_Option.Some((("import(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, url_, async_)) + ")"))
|
|
1894
|
+
return ff_core_Option.Some((("import(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, url_, async_, false)) + ")"))
|
|
1701
1895
|
}
|
|
1702
1896
|
}
|
|
1703
1897
|
if(_1 === "ff:core/Js.await") {
|
|
@@ -1705,9 +1899,9 @@ const _guard1 = arguments_;
|
|
|
1705
1899
|
if(_guard1.length === 1) {
|
|
1706
1900
|
const body_ = _guard1[0];
|
|
1707
1901
|
if(async_) {
|
|
1708
|
-
return ff_core_Option.Some((("(await " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_)) + ")"))
|
|
1902
|
+
return ff_core_Option.Some((("(await " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_, false)) + ")"))
|
|
1709
1903
|
} else {
|
|
1710
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_))
|
|
1904
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_, false))
|
|
1711
1905
|
}
|
|
1712
1906
|
return
|
|
1713
1907
|
}
|
|
@@ -1783,7 +1977,7 @@ if(_1 === "ff:core/Js.setController") {
|
|
|
1783
1977
|
const _guard1 = arguments_;
|
|
1784
1978
|
if(_guard1.length === 1) {
|
|
1785
1979
|
const a_ = _guard1[0];
|
|
1786
|
-
return ff_core_Option.Some((("($task.controller_ = " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a_, async_)) + ")"))
|
|
1980
|
+
return ff_core_Option.Some((("($task.controller_ = " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a_, async_, false)) + ")"))
|
|
1787
1981
|
}
|
|
1788
1982
|
}
|
|
1789
1983
|
if(_1 === "ff:core/Js.inAsync") {
|
|
@@ -1814,14 +2008,14 @@ if(_1 === "ff:core/Js.value") {
|
|
|
1814
2008
|
const _guard1 = arguments_;
|
|
1815
2009
|
if(_guard1.length === 1) {
|
|
1816
2010
|
const e_ = _guard1[0];
|
|
1817
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_))
|
|
2011
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false))
|
|
1818
2012
|
}
|
|
1819
2013
|
}
|
|
1820
2014
|
if(_1 === "ff:core/Js.fromValue") {
|
|
1821
2015
|
const _guard1 = arguments_;
|
|
1822
2016
|
if(_guard1.length === 1) {
|
|
1823
2017
|
const e_ = _guard1[0];
|
|
1824
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_))
|
|
2018
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false))
|
|
1825
2019
|
}
|
|
1826
2020
|
}
|
|
1827
2021
|
if(_1 === "ff:core/Js.rawIdentifier") {
|
|
@@ -1836,7 +2030,7 @@ const _guard1 = arguments_;
|
|
|
1836
2030
|
if(_guard1.length === 2 && _guard1[0].EString) {
|
|
1837
2031
|
const op_ = _guard1[0].value_;
|
|
1838
2032
|
const a1_ = _guard1[1];
|
|
1839
|
-
return ff_core_Option.Some(((("(" + ff_core_String.String_replace(op_, "\"", "")) + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_, async_)) + ")"))
|
|
2033
|
+
return ff_core_Option.Some(((("(" + ff_core_String.String_replace(op_, "\"", "")) + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_, async_, false)) + ")"))
|
|
1840
2034
|
}
|
|
1841
2035
|
}
|
|
1842
2036
|
if(_1 === "ff:core/Js.binaryOperator") {
|
|
@@ -1845,7 +2039,7 @@ if(_guard1.length === 3 && _guard1[0].EString) {
|
|
|
1845
2039
|
const op_ = _guard1[0].value_;
|
|
1846
2040
|
const a1_ = _guard1[1];
|
|
1847
2041
|
const a2_ = _guard1[2];
|
|
1848
|
-
return ff_core_Option.Some((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_, async_)) + " ") + ff_core_String.String_replace(op_, "\"", "")) + " ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_, async_)) + ")"))
|
|
2042
|
+
return ff_core_Option.Some((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_, async_, false)) + " ") + ff_core_String.String_replace(op_, "\"", "")) + " ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_, async_, false)) + ")"))
|
|
1849
2043
|
}
|
|
1850
2044
|
}
|
|
1851
2045
|
if(_1 === "ff:core/Js.shortCircuitingOperator") {
|
|
@@ -1854,21 +2048,21 @@ if(_guard1.length === 3 && _guard1[0].EString) {
|
|
|
1854
2048
|
const op_ = _guard1[0].value_;
|
|
1855
2049
|
const a1_ = _guard1[1];
|
|
1856
2050
|
const a2_ = _guard1[2];
|
|
1857
|
-
return ff_core_Option.Some((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_, async_)) + " ") + ff_core_String.String_replace(op_, "\"", "")) + " ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, ff_compiler_JsEmitter.invokeImmediately_(a2_), async_)) + ")"))
|
|
2051
|
+
return ff_core_Option.Some((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_, async_, false)) + " ") + ff_core_String.String_replace(op_, "\"", "")) + " ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, ff_compiler_JsEmitter.invokeImmediately_(a2_), async_, false)) + ")"))
|
|
1858
2052
|
}
|
|
1859
2053
|
}
|
|
1860
2054
|
if(_1 === "ff:core/JsValue.JsValue_spreadToArray") {
|
|
1861
2055
|
const _guard1 = arguments_;
|
|
1862
2056
|
if(_guard1.length === 1) {
|
|
1863
2057
|
const e1_ = _guard1[0];
|
|
1864
|
-
return ff_core_Option.Some((("[..." + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + "]"))
|
|
2058
|
+
return ff_core_Option.Some((("[..." + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + "]"))
|
|
1865
2059
|
}
|
|
1866
2060
|
}
|
|
1867
2061
|
if(_1 === "ff:core/JsValue.JsValue_typeof") {
|
|
1868
2062
|
const _guard1 = arguments_;
|
|
1869
2063
|
if(_guard1.length === 1) {
|
|
1870
2064
|
const e_ = _guard1[0];
|
|
1871
|
-
return ff_core_Option.Some((("(typeof " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_)) + ")"))
|
|
2065
|
+
return ff_core_Option.Some((("(typeof " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false)) + ")"))
|
|
1872
2066
|
}
|
|
1873
2067
|
}
|
|
1874
2068
|
if(_1 === "ff:core/JsValue.JsValue_instanceof") {
|
|
@@ -1876,7 +2070,7 @@ const _guard1 = arguments_;
|
|
|
1876
2070
|
if(_guard1.length === 2) {
|
|
1877
2071
|
const e1_ = _guard1[0];
|
|
1878
2072
|
const e2_ = _guard1[1];
|
|
1879
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + " instanceof ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)) + ")"))
|
|
2073
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + " instanceof ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)) + ")"))
|
|
1880
2074
|
}
|
|
1881
2075
|
}
|
|
1882
2076
|
if(_1 === "ff:core/JsValue.JsValue_get") {
|
|
@@ -1884,7 +2078,7 @@ const _guard1 = arguments_;
|
|
|
1884
2078
|
if(_guard1.length === 2) {
|
|
1885
2079
|
const e1_ = _guard1[0];
|
|
1886
2080
|
const e2_ = _guard1[1];
|
|
1887
|
-
return ff_core_Option.Some((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")))
|
|
2081
|
+
return ff_core_Option.Some((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")))
|
|
1888
2082
|
}
|
|
1889
2083
|
}
|
|
1890
2084
|
if(_1 === "ff:core/JsValue.JsValue_equals") {
|
|
@@ -1892,7 +2086,7 @@ const _guard1 = arguments_;
|
|
|
1892
2086
|
if(_guard1.length === 2) {
|
|
1893
2087
|
const e1_ = _guard1[0];
|
|
1894
2088
|
const e2_ = _guard1[1];
|
|
1895
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + " === ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)) + ")"))
|
|
2089
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + " === ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)) + ")"))
|
|
1896
2090
|
}
|
|
1897
2091
|
}
|
|
1898
2092
|
if(_1 === "ff:core/JsValue.JsValue_notEquals") {
|
|
@@ -1900,7 +2094,7 @@ const _guard1 = arguments_;
|
|
|
1900
2094
|
if(_guard1.length === 2) {
|
|
1901
2095
|
const e1_ = _guard1[0];
|
|
1902
2096
|
const e2_ = _guard1[1];
|
|
1903
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + " !== ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)) + ")"))
|
|
2097
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + " !== ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)) + ")"))
|
|
1904
2098
|
}
|
|
1905
2099
|
}
|
|
1906
2100
|
if(_1 === "ff:core/Int.Int_bitAnd") {
|
|
@@ -1908,7 +2102,7 @@ const _guard1 = arguments_;
|
|
|
1908
2102
|
if(_guard1.length === 2) {
|
|
1909
2103
|
const e1_ = _guard1[0];
|
|
1910
2104
|
const e2_ = _guard1[1];
|
|
1911
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + " & ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)) + ")"))
|
|
2105
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + " & ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)) + ")"))
|
|
1912
2106
|
}
|
|
1913
2107
|
}
|
|
1914
2108
|
if(_1 === "ff:core/Int.Int_bitRightUnsigned") {
|
|
@@ -1916,7 +2110,7 @@ const _guard1 = arguments_;
|
|
|
1916
2110
|
if(_guard1.length === 2) {
|
|
1917
2111
|
const e1_ = _guard1[0];
|
|
1918
2112
|
const e2_ = _guard1[1];
|
|
1919
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + " >>> ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)) + ")"))
|
|
2113
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + " >>> ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)) + ")"))
|
|
1920
2114
|
}
|
|
1921
2115
|
}
|
|
1922
2116
|
if(_1 === "ff:core/Int.Int_bitRight") {
|
|
@@ -1924,7 +2118,7 @@ const _guard1 = arguments_;
|
|
|
1924
2118
|
if(_guard1.length === 2) {
|
|
1925
2119
|
const e1_ = _guard1[0];
|
|
1926
2120
|
const e2_ = _guard1[1];
|
|
1927
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + " >> ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)) + ")"))
|
|
2121
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + " >> ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)) + ")"))
|
|
1928
2122
|
}
|
|
1929
2123
|
}
|
|
1930
2124
|
{
|
|
@@ -1942,9 +2136,9 @@ const e1_ = _guard1[0];
|
|
|
1942
2136
|
const e2_ = _guard1[1];
|
|
1943
2137
|
const es_ = _guard1.slice(2);
|
|
1944
2138
|
const argumentCode_ = ff_core_List.List_join(ff_core_List.List_map(es_, ((_w1) => {
|
|
1945
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_)
|
|
2139
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_, false)
|
|
1946
2140
|
})), ", ");
|
|
1947
|
-
return ff_core_Option.Some(((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")) + "(") + argumentCode_) + ")"))
|
|
2141
|
+
return ff_core_Option.Some(((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")) + "(") + argumentCode_) + ")"))
|
|
1948
2142
|
}
|
|
1949
2143
|
}
|
|
1950
2144
|
}
|
|
@@ -1963,9 +2157,9 @@ if(_guard1.length >= 1) {
|
|
|
1963
2157
|
const e1_ = _guard1[0];
|
|
1964
2158
|
const es_ = _guard1.slice(1);
|
|
1965
2159
|
const argumentCode_ = ff_core_List.List_join(ff_core_List.List_map(es_, ((_w1) => {
|
|
1966
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_)
|
|
2160
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_, false)
|
|
1967
2161
|
})), ", ");
|
|
1968
|
-
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_) + "(") + argumentCode_) + ")"))
|
|
2162
|
+
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false) + "(") + argumentCode_) + ")"))
|
|
1969
2163
|
}
|
|
1970
2164
|
}
|
|
1971
2165
|
}
|
|
@@ -1984,9 +2178,9 @@ if(_guard1.length >= 1) {
|
|
|
1984
2178
|
const e1_ = _guard1[0];
|
|
1985
2179
|
const es_ = _guard1.slice(1);
|
|
1986
2180
|
const argumentCode_ = ff_core_List.List_join(ff_core_List.List_map(es_, ((_w1) => {
|
|
1987
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_)
|
|
2181
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_, false)
|
|
1988
2182
|
})), ", ");
|
|
1989
|
-
return ff_core_Option.Some(((((("(new " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + "(") + argumentCode_) + ")") + ")"))
|
|
2183
|
+
return ff_core_Option.Some(((((("(new " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + "(") + argumentCode_) + ")") + ")"))
|
|
1990
2184
|
}
|
|
1991
2185
|
}
|
|
1992
2186
|
}
|
|
@@ -2014,14 +2208,14 @@ if(_guard2 && ff_core_List.List_all(as_, ((_w1) => {
|
|
|
2014
2208
|
return ff_compiler_JsEmitter.noSideEffects_(_w1.value_)
|
|
2015
2209
|
}))) {
|
|
2016
2210
|
return (("{" + ff_core_List.List_join(ff_core_List.List_map(fields_, ((p_) => {
|
|
2017
|
-
return ((ff_compiler_JsEmitter.JsEmitter_emitField(self_, p_.first_, async_, "") + ": ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, p_.second_, async_))
|
|
2211
|
+
return ((ff_compiler_JsEmitter.JsEmitter_emitField(self_, p_.first_, async_, "") + ": ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, p_.second_, async_, false))
|
|
2018
2212
|
})), ", ")) + "}")
|
|
2019
2213
|
return
|
|
2020
2214
|
}
|
|
2021
2215
|
}
|
|
2022
2216
|
{
|
|
2023
|
-
return (((("{..." + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_)) + ", ") + ff_core_List.List_join(ff_core_List.List_map(fields_, ((p_) => {
|
|
2024
|
-
return ((ff_compiler_JsEmitter.JsEmitter_emitField(self_, p_.first_, async_, "") + ": ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, p_.second_, async_))
|
|
2217
|
+
return (((("{..." + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false)) + ", ") + ff_core_List.List_join(ff_core_List.List_map(fields_, ((p_) => {
|
|
2218
|
+
return ((ff_compiler_JsEmitter.JsEmitter_emitField(self_, p_.first_, async_, "") + ": ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, p_.second_, async_, false))
|
|
2025
2219
|
})), ", ")) + "}")
|
|
2026
2220
|
return
|
|
2027
2221
|
}
|
|
@@ -2047,10 +2241,10 @@ const q_ = _guard2[1].value_;
|
|
|
2047
2241
|
const es_ = _guard2.slice(2);
|
|
2048
2242
|
if(ff_compiler_JsEmitter.noSideEffects_(e1_)) {
|
|
2049
2243
|
const argumentCode_ = ff_core_List.List_join(ff_core_List.List_map(es_, ((_w1) => {
|
|
2050
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_)
|
|
2244
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_, false)
|
|
2051
2245
|
})), ", ");
|
|
2052
2246
|
return ff_core_Option.Some((((ff_core_Option.Option_else(ff_compiler_JsEmitter.safeBare_(q_), (() => {
|
|
2053
|
-
return (("globalThis[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)) + "]")
|
|
2247
|
+
return (("globalThis[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)) + "]")
|
|
2054
2248
|
})) + "(") + argumentCode_) + ")"))
|
|
2055
2249
|
return
|
|
2056
2250
|
}
|
|
@@ -2077,7 +2271,7 @@ const _guard2 = term_;
|
|
|
2077
2271
|
if(_guard2.ECall) {
|
|
2078
2272
|
const call_ = _guard2;
|
|
2079
2273
|
if((!ff_compiler_JsEmitter.effectTypeIsAsync_(call_.effect_))) {
|
|
2080
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_))
|
|
2274
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false))
|
|
2081
2275
|
}
|
|
2082
2276
|
}
|
|
2083
2277
|
}
|
|
@@ -2093,7 +2287,7 @@ const e2_ = _guard2[1];
|
|
|
2093
2287
|
const q_ = _guard2[1].value_;
|
|
2094
2288
|
if(ff_compiler_JsEmitter.noSideEffects_(e1_)) {
|
|
2095
2289
|
return ff_core_Option.Some(ff_core_Option.Option_else(ff_compiler_JsEmitter.safeBare_(q_), (() => {
|
|
2096
|
-
return (("globalThis[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)) + "]")
|
|
2290
|
+
return (("globalThis[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)) + "]")
|
|
2097
2291
|
})))
|
|
2098
2292
|
return
|
|
2099
2293
|
}
|
|
@@ -2150,10 +2344,10 @@ const e1_ = _guard1[0];
|
|
|
2150
2344
|
const q_ = _guard1[0].value_;
|
|
2151
2345
|
const es_ = _guard1.slice(1);
|
|
2152
2346
|
const argumentCode_ = ff_core_List.List_join(ff_core_List.List_map(es_, ((_w1) => {
|
|
2153
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_)
|
|
2347
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_, false)
|
|
2154
2348
|
})), ", ");
|
|
2155
2349
|
return ff_core_Option.Some((((ff_core_Option.Option_else(ff_compiler_JsEmitter.safeBare_(q_), (() => {
|
|
2156
|
-
return (("globalThis[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + "]")
|
|
2350
|
+
return (("globalThis[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + "]")
|
|
2157
2351
|
})) + "(") + argumentCode_) + ")"))
|
|
2158
2352
|
return
|
|
2159
2353
|
}
|
|
@@ -2182,9 +2376,9 @@ return ("a_" + _w1)
|
|
|
2182
2376
|
const taskCode_ = ((argumentCode_ === "")
|
|
2183
2377
|
? "$task"
|
|
2184
2378
|
: ", $task");
|
|
2185
|
-
return ff_core_Option.Some(((((((("(async (" + argumentCode_) + ") => await ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + "(") + argumentCode_) + taskCode_) + "))"))
|
|
2379
|
+
return ff_core_Option.Some(((((((("(async (" + argumentCode_) + ") => await ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + "(") + argumentCode_) + taskCode_) + "))"))
|
|
2186
2380
|
} else {
|
|
2187
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_))
|
|
2381
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false))
|
|
2188
2382
|
}
|
|
2189
2383
|
return
|
|
2190
2384
|
}
|
|
@@ -2198,7 +2392,7 @@ if(_guard1.length === 1 && _guard1[0].EString) {
|
|
|
2198
2392
|
const e1_ = _guard1[0];
|
|
2199
2393
|
const q_ = _guard1[0].value_;
|
|
2200
2394
|
return ff_core_Option.Some(ff_core_Option.Option_else(ff_compiler_JsEmitter.safeBare_(q_), (() => {
|
|
2201
|
-
return (("globalThis[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + "]")
|
|
2395
|
+
return (("globalThis[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + "]")
|
|
2202
2396
|
})))
|
|
2203
2397
|
return
|
|
2204
2398
|
}
|
|
@@ -2252,35 +2446,35 @@ if(_1 === "ff:core/Json.string") {
|
|
|
2252
2446
|
const _guard1 = arguments_;
|
|
2253
2447
|
if(_guard1.length === 1) {
|
|
2254
2448
|
const e_ = _guard1[0];
|
|
2255
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_))
|
|
2449
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false))
|
|
2256
2450
|
}
|
|
2257
2451
|
}
|
|
2258
2452
|
if(_1 === "ff:core/Json.int") {
|
|
2259
2453
|
const _guard1 = arguments_;
|
|
2260
2454
|
if(_guard1.length === 1) {
|
|
2261
2455
|
const e_ = _guard1[0];
|
|
2262
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_))
|
|
2456
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false))
|
|
2263
2457
|
}
|
|
2264
2458
|
}
|
|
2265
2459
|
if(_1 === "ff:core/Json.float") {
|
|
2266
2460
|
const _guard1 = arguments_;
|
|
2267
2461
|
if(_guard1.length === 1) {
|
|
2268
2462
|
const e_ = _guard1[0];
|
|
2269
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_))
|
|
2463
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false))
|
|
2270
2464
|
}
|
|
2271
2465
|
}
|
|
2272
2466
|
if(_1 === "ff:core/Json.bool") {
|
|
2273
2467
|
const _guard1 = arguments_;
|
|
2274
2468
|
if(_guard1.length === 1) {
|
|
2275
2469
|
const e_ = _guard1[0];
|
|
2276
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_))
|
|
2470
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false))
|
|
2277
2471
|
}
|
|
2278
2472
|
}
|
|
2279
2473
|
if(_1 === "ff:core/Json.array") {
|
|
2280
2474
|
const _guard1 = arguments_;
|
|
2281
2475
|
if(_guard1.length === 1) {
|
|
2282
2476
|
const e_ = _guard1[0];
|
|
2283
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_))
|
|
2477
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false))
|
|
2284
2478
|
}
|
|
2285
2479
|
}
|
|
2286
2480
|
if(_1 === "ff:core/Json.null") {
|
|
@@ -2311,7 +2505,7 @@ const _guard1 = arguments_;
|
|
|
2311
2505
|
if(_guard1.length === 2) {
|
|
2312
2506
|
const condition_ = _guard1[0];
|
|
2313
2507
|
const body_ = _guard1[1];
|
|
2314
|
-
return ff_core_Option.Some((((("while(" + ff_compiler_JsEmitter.
|
|
2508
|
+
return ff_core_Option.Some((((("while(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, ff_compiler_JsEmitter.invokeImmediately_(condition_), async_, false)) + ") {\n") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, ff_compiler_JsEmitter.invokeImmediately_(body_), false, false, async_)) + "\n}"))
|
|
2315
2509
|
}
|
|
2316
2510
|
}
|
|
2317
2511
|
if(_1 === "ff:core/Core.doWhile") {
|
|
@@ -2331,7 +2525,7 @@ if(_guard1.length === 2 && _guard1[1].ELambda && _guard1[1].lambda_.cases_.lengt
|
|
|
2331
2525
|
const list_ = _guard1[0];
|
|
2332
2526
|
const name_ = _guard1[1].lambda_.cases_[0].patterns_[0].name_;
|
|
2333
2527
|
const body_ = _guard1[1].lambda_.cases_[0].body_;
|
|
2334
|
-
return ff_core_Option.Some(((((("{\nconst if_o = " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, list_, async_)) + "\nif(if_o.Some) {\n") + ff_core_Option.Option_else(ff_core_Option.Option_map(name_, ((_w1) => {
|
|
2528
|
+
return ff_core_Option.Some(((((("{\nconst if_o = " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, list_, async_, false)) + "\nif(if_o.Some) {\n") + ff_core_Option.Option_else(ff_core_Option.Option_map(name_, ((_w1) => {
|
|
2335
2529
|
return (("const " + ff_compiler_JsEmitter.escapeKeyword_(_w1)) + " = if_o.value_;\n")
|
|
2336
2530
|
})), (() => {
|
|
2337
2531
|
return ""
|
|
@@ -2351,8 +2545,8 @@ const end_ = _guard2[0].arguments_[1];
|
|
|
2351
2545
|
const name_ = _guard2[1].lambda_.cases_[0].patterns_[0].name_;
|
|
2352
2546
|
const body_ = _guard2[1].lambda_.cases_[0].body_;
|
|
2353
2547
|
if(((r_ === "ff:core/Int.Int_until") || (r_ === "ff:core/Int.Int_to"))) {
|
|
2354
|
-
const startCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, start_.value_, async_);
|
|
2355
|
-
const endCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, end_.value_, async_);
|
|
2548
|
+
const startCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, start_.value_, async_, false);
|
|
2549
|
+
const endCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, end_.value_, async_, false);
|
|
2356
2550
|
const op_ = ((r_ === "ff:core/Int.Int_until")
|
|
2357
2551
|
? "<"
|
|
2358
2552
|
: "<=");
|
|
@@ -2378,8 +2572,8 @@ const end_ = _guard2[0].arguments_[0].value_.arguments_[1];
|
|
|
2378
2572
|
const name_ = _guard2[1].lambda_.cases_[0].patterns_[0].name_;
|
|
2379
2573
|
const body_ = _guard2[1].lambda_.cases_[0].body_;
|
|
2380
2574
|
if(((r_ === "ff:core/Int.Int_until") || (r_ === "ff:core/Int.Int_to"))) {
|
|
2381
|
-
const startCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, start_.value_, async_);
|
|
2382
|
-
const endCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, end_.value_, async_);
|
|
2575
|
+
const startCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, start_.value_, async_, false);
|
|
2576
|
+
const endCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, end_.value_, async_, false);
|
|
2383
2577
|
const delta_ = ((r_ === "ff:core/Int.Int_until")
|
|
2384
2578
|
? " - 1"
|
|
2385
2579
|
: "");
|
|
@@ -2481,7 +2675,7 @@ const _guard1 = arguments_;
|
|
|
2481
2675
|
if(_guard1.length === 2) {
|
|
2482
2676
|
const array_ = _guard1[0];
|
|
2483
2677
|
const value_ = _guard1[1];
|
|
2484
|
-
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, array_, async_) + ".array.push(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_)) + ")"))
|
|
2678
|
+
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, array_, async_, false) + ".array.push(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_, false)) + ")"))
|
|
2485
2679
|
}
|
|
2486
2680
|
}
|
|
2487
2681
|
if(_1 === "ff:core/Core.if") {
|
|
@@ -2489,8 +2683,8 @@ const _guard1 = arguments_;
|
|
|
2489
2683
|
if(_guard1.length === 2) {
|
|
2490
2684
|
const condition_ = _guard1[0];
|
|
2491
2685
|
const body_ = _guard1[1];
|
|
2492
|
-
return ff_core_Option.Some(((("if(" + ff_compiler_JsEmitter.
|
|
2493
|
-
? (("return ff_core_Option.Some(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, ff_compiler_JsEmitter.invokeImmediately_(body_), async_)) + ")\n} else return ff_core_Option.None()")
|
|
2686
|
+
return ff_core_Option.Some(((("if(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_, false)) + ") {\n") + (last_
|
|
2687
|
+
? (("return ff_core_Option.Some(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, ff_compiler_JsEmitter.invokeImmediately_(body_), async_, false)) + ")\n} else return ff_core_Option.None()")
|
|
2494
2688
|
: (ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, ff_compiler_JsEmitter.invokeImmediately_(body_), false, false, async_) + "\n}"))))
|
|
2495
2689
|
return
|
|
2496
2690
|
}
|
|
@@ -2546,185 +2740,74 @@ const c_ = _guard2;
|
|
|
2546
2740
|
const _guard1 = c_.arguments_;
|
|
2547
2741
|
if(_guard1.length === 1) {
|
|
2548
2742
|
const argument_ = _guard1[0];
|
|
2549
|
-
return ff_core_Option.Some(("throw " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, argument_.value_, async_)))
|
|
2743
|
+
return ff_core_Option.Some(("throw " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, argument_.value_, async_, false)))
|
|
2550
2744
|
}
|
|
2551
2745
|
}
|
|
2552
2746
|
}
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
if(_guard1.length === 3) {
|
|
2556
|
-
const e1_ = _guard1[0];
|
|
2557
|
-
const e2_ = _guard1[1];
|
|
2558
|
-
const e3_ = _guard1[2];
|
|
2559
|
-
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")) + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_)))
|
|
2560
|
-
}
|
|
2747
|
+
{
|
|
2748
|
+
return ff_core_Option.None()
|
|
2561
2749
|
}
|
|
2562
|
-
if(_1 === "ff:core/JsValue.JsValue_increment") {
|
|
2563
|
-
const _guard1 = arguments_;
|
|
2564
|
-
if(_guard1.length === 3) {
|
|
2565
|
-
const e1_ = _guard1[0];
|
|
2566
|
-
const e2_ = _guard1[1];
|
|
2567
|
-
const e3_ = _guard1[2];
|
|
2568
|
-
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")) + " += ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_)))
|
|
2569
2750
|
}
|
|
2570
2751
|
}
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
const
|
|
2576
|
-
|
|
2577
|
-
|
|
2752
|
+
|
|
2753
|
+
export function JsEmitter_emitLightFusion(self_, listName_, list_, async_) {
|
|
2754
|
+
let start_ = "0";
|
|
2755
|
+
let end_ = (listName_ + ".length");
|
|
2756
|
+
const listCode_ = (((_1) => {
|
|
2757
|
+
if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/List.List_dropFirst" && _1.arguments_.length === 2) {
|
|
2758
|
+
const a1_ = _1.arguments_[0];
|
|
2759
|
+
const a2_ = _1.arguments_[1];
|
|
2760
|
+
start_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_.value_, async_, false);
|
|
2761
|
+
if((!ff_core_String.String_all(start_, ((_w1) => {
|
|
2762
|
+
return ff_core_Char.Char_isAsciiDigit(_w1)
|
|
2763
|
+
})))) {
|
|
2764
|
+
start_ = (("Math.max(" + start_) + ", 0)")
|
|
2765
|
+
};
|
|
2766
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_.value_, async_, false)
|
|
2578
2767
|
}
|
|
2768
|
+
if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/List.List_dropLast" && _1.arguments_.length === 2) {
|
|
2769
|
+
const a1_ = _1.arguments_[0];
|
|
2770
|
+
const a2_ = _1.arguments_[1];
|
|
2771
|
+
const count_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_.value_, async_, false);
|
|
2772
|
+
if((!ff_core_String.String_all(count_, ((_w1) => {
|
|
2773
|
+
return ff_core_Char.Char_isAsciiDigit(_w1)
|
|
2774
|
+
})))) {
|
|
2775
|
+
end_ = (((end_ + " - Math.max(") + count_) + ", 0)")
|
|
2776
|
+
} else {
|
|
2777
|
+
end_ = ((end_ + " - ") + count_)
|
|
2778
|
+
};
|
|
2779
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_.value_, async_, false)
|
|
2579
2780
|
}
|
|
2580
|
-
if(_1 === "ff:core/
|
|
2581
|
-
const
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
return ff_core_Option.Some(((s_ + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_)))
|
|
2781
|
+
if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/List.List_takeFirst" && _1.arguments_.length === 2) {
|
|
2782
|
+
const a1_ = _1.arguments_[0];
|
|
2783
|
+
const a2_ = _1.arguments_[1];
|
|
2784
|
+
end_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_.value_, async_, false);
|
|
2785
|
+
if((!ff_core_String.String_all(end_, ((_w1) => {
|
|
2786
|
+
return ff_core_Char.Char_isAsciiDigit(_w1)
|
|
2787
|
+
})))) {
|
|
2788
|
+
end_ = (("Math.max(" + end_) + ", 0)")
|
|
2789
|
+
};
|
|
2790
|
+
end_ = (((("Math.min(" + end_) + ", ") + listName_) + ".length)");
|
|
2791
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_.value_, async_, false)
|
|
2592
2792
|
}
|
|
2793
|
+
if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/List.List_takeLast" && _1.arguments_.length === 2) {
|
|
2794
|
+
const a1_ = _1.arguments_[0];
|
|
2795
|
+
const a2_ = _1.arguments_[1];
|
|
2796
|
+
const count_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_.value_, async_, false);
|
|
2797
|
+
if((!ff_core_String.String_all(count_, ((_w1) => {
|
|
2798
|
+
return ff_core_Char.Char_isAsciiDigit(_w1)
|
|
2799
|
+
})))) {
|
|
2800
|
+
start_ = (((("Math.max(" + listName_) + ".length - Math.max(") + count_) + ", 0), 0)")
|
|
2801
|
+
} else {
|
|
2802
|
+
start_ = (((("Math.max(" + listName_) + ".length - ") + count_) + ", 0)")
|
|
2803
|
+
};
|
|
2804
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_.value_, async_, false)
|
|
2593
2805
|
}
|
|
2806
|
+
{
|
|
2807
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, list_, async_, false)
|
|
2594
2808
|
}
|
|
2595
|
-
}
|
|
2596
|
-
|
|
2597
|
-
const _guard3 = arguments_;
|
|
2598
|
-
if(_guard3.length === 3 && _guard3[1].EString) {
|
|
2599
|
-
const e1_ = _guard3[0];
|
|
2600
|
-
const q_ = _guard3[1].value_;
|
|
2601
|
-
const e3_ = _guard3[2];
|
|
2602
|
-
const _guard2 = ff_compiler_JsEmitter.noSideEffects_(e1_);
|
|
2603
|
-
if(_guard2) {
|
|
2604
|
-
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
2605
|
-
if(_guard1.Some) {
|
|
2606
|
-
const s_ = _guard1.value_;
|
|
2607
|
-
return ff_core_Option.Some(((s_ + " += ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_)))
|
|
2608
|
-
}
|
|
2609
|
-
}
|
|
2610
|
-
}
|
|
2611
|
-
}
|
|
2612
|
-
if(_1 === "ff:core/JsSystem.JsSystem_decrement") {
|
|
2613
|
-
const _guard3 = arguments_;
|
|
2614
|
-
if(_guard3.length === 3 && _guard3[1].EString) {
|
|
2615
|
-
const e1_ = _guard3[0];
|
|
2616
|
-
const q_ = _guard3[1].value_;
|
|
2617
|
-
const e3_ = _guard3[2];
|
|
2618
|
-
const _guard2 = ff_compiler_JsEmitter.noSideEffects_(e1_);
|
|
2619
|
-
if(_guard2) {
|
|
2620
|
-
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
2621
|
-
if(_guard1.Some) {
|
|
2622
|
-
const s_ = _guard1.value_;
|
|
2623
|
-
return ff_core_Option.Some(((s_ + " -= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_)))
|
|
2624
|
-
}
|
|
2625
|
-
}
|
|
2626
|
-
}
|
|
2627
|
-
}
|
|
2628
|
-
if(_1 === "ff:core/Js.set") {
|
|
2629
|
-
const _guard2 = arguments_;
|
|
2630
|
-
if(_guard2.length === 2 && _guard2[0].EString) {
|
|
2631
|
-
const q_ = _guard2[0].value_;
|
|
2632
|
-
const e2_ = _guard2[1];
|
|
2633
|
-
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
2634
|
-
if(_guard1.Some) {
|
|
2635
|
-
const s_ = _guard1.value_;
|
|
2636
|
-
return ff_core_Option.Some(((s_ + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)))
|
|
2637
|
-
}
|
|
2638
|
-
}
|
|
2639
|
-
}
|
|
2640
|
-
if(_1 === "ff:core/Js.increment") {
|
|
2641
|
-
const _guard2 = arguments_;
|
|
2642
|
-
if(_guard2.length === 2 && _guard2[0].EString) {
|
|
2643
|
-
const q_ = _guard2[0].value_;
|
|
2644
|
-
const e2_ = _guard2[1];
|
|
2645
|
-
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
2646
|
-
if(_guard1.Some) {
|
|
2647
|
-
const s_ = _guard1.value_;
|
|
2648
|
-
return ff_core_Option.Some(((s_ + " += ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)))
|
|
2649
|
-
}
|
|
2650
|
-
}
|
|
2651
|
-
}
|
|
2652
|
-
if(_1 === "ff:core/Js.decrement") {
|
|
2653
|
-
const _guard2 = arguments_;
|
|
2654
|
-
if(_guard2.length === 2 && _guard2[0].EString) {
|
|
2655
|
-
const q_ = _guard2[0].value_;
|
|
2656
|
-
const e2_ = _guard2[1];
|
|
2657
|
-
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
2658
|
-
if(_guard1.Some) {
|
|
2659
|
-
const s_ = _guard1.value_;
|
|
2660
|
-
return ff_core_Option.Some(((s_ + " -= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)))
|
|
2661
|
-
}
|
|
2662
|
-
}
|
|
2663
|
-
}
|
|
2664
|
-
{
|
|
2665
|
-
return ff_core_Option.None()
|
|
2666
|
-
}
|
|
2667
|
-
}
|
|
2668
|
-
}
|
|
2669
|
-
|
|
2670
|
-
export function JsEmitter_emitLightFusion(self_, listName_, list_, async_) {
|
|
2671
|
-
let start_ = "0";
|
|
2672
|
-
let end_ = (listName_ + ".length");
|
|
2673
|
-
const listCode_ = (((_1) => {
|
|
2674
|
-
if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/List.List_dropFirst" && _1.arguments_.length === 2) {
|
|
2675
|
-
const a1_ = _1.arguments_[0];
|
|
2676
|
-
const a2_ = _1.arguments_[1];
|
|
2677
|
-
start_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_.value_, async_);
|
|
2678
|
-
if((!ff_core_String.String_all(start_, ((_w1) => {
|
|
2679
|
-
return ff_core_Char.Char_isAsciiDigit(_w1)
|
|
2680
|
-
})))) {
|
|
2681
|
-
start_ = (("Math.max(" + start_) + ", 0)")
|
|
2682
|
-
};
|
|
2683
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_.value_, async_)
|
|
2684
|
-
}
|
|
2685
|
-
if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/List.List_dropLast" && _1.arguments_.length === 2) {
|
|
2686
|
-
const a1_ = _1.arguments_[0];
|
|
2687
|
-
const a2_ = _1.arguments_[1];
|
|
2688
|
-
const count_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_.value_, async_);
|
|
2689
|
-
if((!ff_core_String.String_all(count_, ((_w1) => {
|
|
2690
|
-
return ff_core_Char.Char_isAsciiDigit(_w1)
|
|
2691
|
-
})))) {
|
|
2692
|
-
end_ = (((end_ + " - Math.max(") + count_) + ", 0)")
|
|
2693
|
-
} else {
|
|
2694
|
-
end_ = ((end_ + " - ") + count_)
|
|
2695
|
-
};
|
|
2696
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_.value_, async_)
|
|
2697
|
-
}
|
|
2698
|
-
if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/List.List_takeFirst" && _1.arguments_.length === 2) {
|
|
2699
|
-
const a1_ = _1.arguments_[0];
|
|
2700
|
-
const a2_ = _1.arguments_[1];
|
|
2701
|
-
end_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_.value_, async_);
|
|
2702
|
-
if((!ff_core_String.String_all(end_, ((_w1) => {
|
|
2703
|
-
return ff_core_Char.Char_isAsciiDigit(_w1)
|
|
2704
|
-
})))) {
|
|
2705
|
-
end_ = (("Math.max(" + end_) + ", 0)")
|
|
2706
|
-
};
|
|
2707
|
-
end_ = (((("Math.min(" + end_) + ", ") + listName_) + ".length)");
|
|
2708
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_.value_, async_)
|
|
2709
|
-
}
|
|
2710
|
-
if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/List.List_takeLast" && _1.arguments_.length === 2) {
|
|
2711
|
-
const a1_ = _1.arguments_[0];
|
|
2712
|
-
const a2_ = _1.arguments_[1];
|
|
2713
|
-
const count_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_.value_, async_);
|
|
2714
|
-
if((!ff_core_String.String_all(count_, ((_w1) => {
|
|
2715
|
-
return ff_core_Char.Char_isAsciiDigit(_w1)
|
|
2716
|
-
})))) {
|
|
2717
|
-
start_ = (((("Math.max(" + listName_) + ".length - Math.max(") + count_) + ", 0), 0)")
|
|
2718
|
-
} else {
|
|
2719
|
-
start_ = (((("Math.max(" + listName_) + ".length - ") + count_) + ", 0)")
|
|
2720
|
-
};
|
|
2721
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_.value_, async_)
|
|
2722
|
-
}
|
|
2723
|
-
{
|
|
2724
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, list_, async_)
|
|
2725
|
-
}
|
|
2726
|
-
}))(list_);
|
|
2727
|
-
return ff_core_Pair.Pair(listCode_, ff_core_Pair.Pair(start_, end_))
|
|
2809
|
+
}))(list_);
|
|
2810
|
+
return ff_core_Pair.Pair(listCode_, ff_core_Pair.Pair(start_, end_))
|
|
2728
2811
|
}
|
|
2729
2812
|
|
|
2730
2813
|
export function JsEmitter_emitTryCatchFinally(self_, term_, last_, async_) {
|
|
@@ -2833,7 +2916,7 @@ if(ff_core_List.List_isEmpty(variables_)) {
|
|
|
2833
2916
|
const newCase_ = (((_c) => {
|
|
2834
2917
|
return ff_compiler_Syntax.MatchCase(_c.at_, [], [], _c.body_)
|
|
2835
2918
|
}))(matchCase_);
|
|
2836
|
-
return ff_compiler_JsEmitter.JsEmitter_emitCase(self_, [], newCase_, [...conditions_, ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_)], [], jump_, last_, break_, lastCase_, async_)
|
|
2919
|
+
return ff_compiler_JsEmitter.JsEmitter_emitCase(self_, [], newCase_, [...conditions_, ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false)], [], jump_, last_, break_, lastCase_, async_)
|
|
2837
2920
|
}
|
|
2838
2921
|
}
|
|
2839
2922
|
if(_1.first_.length === 0 && _1.second_.length === 1 && _1.second_[0].pattern_.PVariant && _1.second_[0].pattern_.name_ === "ff:core/Bool.True") {
|
|
@@ -2841,7 +2924,7 @@ const e_ = _1.second_[0].term_;
|
|
|
2841
2924
|
const newCase_ = (((_c) => {
|
|
2842
2925
|
return ff_compiler_Syntax.MatchCase(_c.at_, [], [], _c.body_)
|
|
2843
2926
|
}))(matchCase_);
|
|
2844
|
-
const code_ = ff_compiler_JsEmitter.JsEmitter_emitCase(self_, [], newCase_, [ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_)], [], jump_, last_, break_, lastCase_, async_);
|
|
2927
|
+
const code_ = ff_compiler_JsEmitter.JsEmitter_emitCase(self_, [], newCase_, [ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false)], [], jump_, last_, break_, lastCase_, async_);
|
|
2845
2928
|
return emitWrapper_(code_)
|
|
2846
2929
|
}
|
|
2847
2930
|
if(_1.first_.length === 0 && _1.second_.length >= 1) {
|
|
@@ -2851,7 +2934,7 @@ const guardName_ = ("_guard" + (guards_.length + 1));
|
|
|
2851
2934
|
const newCase_ = (((_c) => {
|
|
2852
2935
|
return ff_compiler_Syntax.MatchCase(_c.at_, [guard_.pattern_], guards_, _c.body_)
|
|
2853
2936
|
}))(matchCase_);
|
|
2854
|
-
const code_ = ((((("const " + guardName_) + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, guard_.term_, async_)) + ";\n") + ff_compiler_JsEmitter.JsEmitter_emitCase(self_, [guardName_], newCase_, [], [], jump_, last_, break_, lastCase_, async_));
|
|
2937
|
+
const code_ = ((((("const " + guardName_) + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, guard_.term_, async_, false)) + ";\n") + ff_compiler_JsEmitter.JsEmitter_emitCase(self_, [guardName_], newCase_, [], [], jump_, last_, break_, lastCase_, async_));
|
|
2855
2938
|
return emitWrapper_(code_)
|
|
2856
2939
|
}
|
|
2857
2940
|
{
|
|
@@ -3006,11 +3089,11 @@ export function JsEmitter_emitList(self_, items_, async_) {
|
|
|
3006
3089
|
return (("[" + ff_core_List.List_join(ff_core_List.List_map(items_, ((_1) => {
|
|
3007
3090
|
if(!_1.second_) {
|
|
3008
3091
|
const item_ = _1.first_;
|
|
3009
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, item_, async_)
|
|
3092
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, item_, async_, false)
|
|
3010
3093
|
}
|
|
3011
3094
|
{
|
|
3012
3095
|
const item_ = _1.first_;
|
|
3013
|
-
return ("..." + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, item_, async_))
|
|
3096
|
+
return ("..." + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, item_, async_, false))
|
|
3014
3097
|
}
|
|
3015
3098
|
})), ", ")) + "]")
|
|
3016
3099
|
}
|
|
@@ -3076,40 +3159,7 @@ return (((((((((("\"" + self_.moduleName_) + ":") + callAt_.line_) + ":") + call
|
|
|
3076
3159
|
}
|
|
3077
3160
|
{
|
|
3078
3161
|
const value_ = _1;
|
|
3079
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_)
|
|
3080
|
-
}
|
|
3081
|
-
}
|
|
3082
|
-
}
|
|
3083
|
-
|
|
3084
|
-
export function JsEmitter_emitComma(self_, term_, async_) {
|
|
3085
|
-
{
|
|
3086
|
-
const _1 = term_;
|
|
3087
|
-
if(_1.ESequential && _1.before_.ESequential && _1.before_.before_.ESequential) {
|
|
3088
|
-
const before1_ = _1.before_.before_.before_;
|
|
3089
|
-
const before2_ = _1.before_.before_.after_;
|
|
3090
|
-
const before3_ = _1.before_.after_;
|
|
3091
|
-
const after_ = _1.after_;
|
|
3092
|
-
if((((ff_compiler_JsEmitter.safeCommable_(before1_) && ff_compiler_JsEmitter.safeCommable_(before2_)) && ff_compiler_JsEmitter.safeCommable_(before3_)) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
3093
|
-
return (((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before1_, false, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before2_, false, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before3_, false, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, after_, async_)) + ")")
|
|
3094
|
-
}
|
|
3095
|
-
}
|
|
3096
|
-
if(_1.ESequential && _1.before_.ESequential) {
|
|
3097
|
-
const before1_ = _1.before_.before_;
|
|
3098
|
-
const before2_ = _1.before_.after_;
|
|
3099
|
-
const after_ = _1.after_;
|
|
3100
|
-
if(((ff_compiler_JsEmitter.safeCommable_(before1_) && ff_compiler_JsEmitter.safeCommable_(before2_)) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
3101
|
-
return (((((("(" + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before1_, false, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before2_, false, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, after_, async_)) + ")")
|
|
3102
|
-
}
|
|
3103
|
-
}
|
|
3104
|
-
if(_1.ESequential) {
|
|
3105
|
-
const before_ = _1.before_;
|
|
3106
|
-
const after_ = _1.after_;
|
|
3107
|
-
if((ff_compiler_JsEmitter.safeCommable_(before_) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
3108
|
-
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before_, false, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, after_, async_)) + ")")
|
|
3109
|
-
}
|
|
3110
|
-
}
|
|
3111
|
-
{
|
|
3112
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, term_, async_)
|
|
3162
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_, false)
|
|
3113
3163
|
}
|
|
3114
3164
|
}
|
|
3115
3165
|
}
|
|
@@ -3223,7 +3273,7 @@ export async function JsEmitter_emitLetDefinition$(self_, definition_, mutable_,
|
|
|
3223
3273
|
const mutability_ = (mutable_
|
|
3224
3274
|
? "let"
|
|
3225
3275
|
: "const");
|
|
3226
|
-
const valueCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, definition_.value_, async_);
|
|
3276
|
+
const valueCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, definition_.value_, async_, false);
|
|
3227
3277
|
const assignmentCode_ = (((!mutable_) || (valueCode_ !== "(void 0)"))
|
|
3228
3278
|
? (" = " + valueCode_)
|
|
3229
3279
|
: "");
|
|
@@ -3369,7 +3419,7 @@ return (((((prefix_ + "function ") + ff_compiler_JsEmitter.escapeKeyword_(signat
|
|
|
3369
3419
|
|
|
3370
3420
|
export async function JsEmitter_emitParameter$(self_, parameter_, async_, $task) {
|
|
3371
3421
|
const defaultValue_ = ff_core_Option.Option_else(ff_core_Option.Option_map(parameter_.default_, ((_w1) => {
|
|
3372
|
-
return (" = " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_))
|
|
3422
|
+
return (" = " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_, false))
|
|
3373
3423
|
})), (() => {
|
|
3374
3424
|
return ""
|
|
3375
3425
|
}));
|
|
@@ -3400,7 +3450,7 @@ return (((((((((("export function " + definition_.name_) + "(") + fields_) + ")
|
|
|
3400
3450
|
}
|
|
3401
3451
|
}
|
|
3402
3452
|
|
|
3403
|
-
export async function JsEmitter_emitTerm$(self_, term_, async_, $task) {
|
|
3453
|
+
export async function JsEmitter_emitTerm$(self_, term_, async_, ignored_ = false, $task) {
|
|
3404
3454
|
{
|
|
3405
3455
|
const _1 = term_;
|
|
3406
3456
|
if(_1.EString) {
|
|
@@ -3493,9 +3543,9 @@ const name_ = _1.name_;
|
|
|
3493
3543
|
const record_ = _1.record_;
|
|
3494
3544
|
const fields_ = _1.arguments_;
|
|
3495
3545
|
const fieldCode_ = ff_core_List.List_join(ff_core_List.List_map(fields_, ((f_) => {
|
|
3496
|
-
return ((ff_compiler_JsEmitter.escapeKeyword_(f_.name_) + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, f_.value_, async_))
|
|
3546
|
+
return ((ff_compiler_JsEmitter.escapeKeyword_(f_.name_) + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, f_.value_, async_, false))
|
|
3497
3547
|
})), ", ");
|
|
3498
|
-
return (((("{..." + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, record_, async_)) + ", ") + fieldCode_) + "}")
|
|
3548
|
+
return (((("{..." + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, record_, async_, false)) + ", ") + fieldCode_) + "}")
|
|
3499
3549
|
}
|
|
3500
3550
|
if(_1.EField) {
|
|
3501
3551
|
const at_ = _1.at_;
|
|
@@ -3503,9 +3553,9 @@ const newtype_ = _1.newtype_;
|
|
|
3503
3553
|
const record_ = _1.record_;
|
|
3504
3554
|
const field_ = _1.field_;
|
|
3505
3555
|
if(newtype_) {
|
|
3506
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, record_, async_)
|
|
3556
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, record_, async_, false)
|
|
3507
3557
|
} else {
|
|
3508
|
-
return ((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, record_, async_) + ".") + ff_compiler_JsEmitter.escapeKeyword_(field_))
|
|
3558
|
+
return ((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, record_, async_, false) + ".") + ff_compiler_JsEmitter.escapeKeyword_(field_))
|
|
3509
3559
|
}
|
|
3510
3560
|
return
|
|
3511
3561
|
}
|
|
@@ -3584,7 +3634,7 @@ const await_ = (async_ && ff_compiler_JsEmitter.effectTypeIsAsync_(effect_));
|
|
|
3584
3634
|
const c_ = (await_
|
|
3585
3635
|
? ", $task"
|
|
3586
3636
|
: "");
|
|
3587
|
-
const call_ = ((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, function_, async_)) + ")(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_)) + c_) + ")");
|
|
3637
|
+
const call_ = ((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, function_, async_, false)) + ")(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_, false)) + c_) + ")");
|
|
3588
3638
|
if(await_) {
|
|
3589
3639
|
return (("(await " + call_) + ")")
|
|
3590
3640
|
} else {
|
|
@@ -3592,6 +3642,18 @@ return call_
|
|
|
3592
3642
|
}
|
|
3593
3643
|
return
|
|
3594
3644
|
}
|
|
3645
|
+
{
|
|
3646
|
+
const _guard1 = ff_compiler_JsEmitter.JsEmitter_emitAssignment(self_, term_, async_);
|
|
3647
|
+
if(_guard1.Some) {
|
|
3648
|
+
const code_ = _guard1.value_;
|
|
3649
|
+
if(ignored_) {
|
|
3650
|
+
return code_
|
|
3651
|
+
} else {
|
|
3652
|
+
return (("(" + code_) + ", void 0)")
|
|
3653
|
+
}
|
|
3654
|
+
return
|
|
3655
|
+
}
|
|
3656
|
+
}
|
|
3595
3657
|
if(_1.ECall && _1.target_.StaticCall) {
|
|
3596
3658
|
const at_ = _1.at_;
|
|
3597
3659
|
const name_ = _1.target_.name_;
|
|
@@ -3680,12 +3742,12 @@ return
|
|
|
3680
3742
|
if(_1.length >= 1 && _1[0].first_.EVariant && _1[0].first_.name_ === "ff:core/Bool.True") {
|
|
3681
3743
|
const elseBody_ = _1[0].second_;
|
|
3682
3744
|
const list_ = _1.slice(1);
|
|
3683
|
-
return (("(" + ff_core_List.List_foldLeft(list_, ff_compiler_JsEmitter.
|
|
3745
|
+
return (("(" + ff_core_List.List_foldLeft(list_, ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, elseBody_, async_, false), ((_1, _2) => {
|
|
3684
3746
|
{
|
|
3685
3747
|
const otherwise_ = _1;
|
|
3686
3748
|
const condition_ = _2.first_;
|
|
3687
3749
|
const body_ = _2.second_;
|
|
3688
|
-
return ((((ff_compiler_JsEmitter.
|
|
3750
|
+
return ((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_, false) + "\n? ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_, false)) + "\n: ") + otherwise_)
|
|
3689
3751
|
}
|
|
3690
3752
|
}))) + ")")
|
|
3691
3753
|
return
|
|
@@ -3697,7 +3759,7 @@ return (("(" + ff_core_List.List_foldLeft(list_, "ff_core_Option.None()", ((_1,
|
|
|
3697
3759
|
const otherwise_ = _1;
|
|
3698
3760
|
const condition_ = _2.first_;
|
|
3699
3761
|
const body_ = _2.second_;
|
|
3700
|
-
return ((((ff_compiler_JsEmitter.
|
|
3762
|
+
return ((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_, false) + "\n? ff_core_Option.Some(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_, false)) + ")\n: ") + otherwise_)
|
|
3701
3763
|
}
|
|
3702
3764
|
}))) + ")")
|
|
3703
3765
|
return
|
|
@@ -3716,7 +3778,7 @@ const await_ = (async_ && ff_compiler_JsEmitter.effectTypeIsAsync_(effect_));
|
|
|
3716
3778
|
if((!ff_core_List.List_isEmpty(dictionaries_))) {
|
|
3717
3779
|
ff_compiler_JsEmitter.fail_(at_, "Internal error: Dictionaries in lambda call")
|
|
3718
3780
|
};
|
|
3719
|
-
const functionCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, function_, async_);
|
|
3781
|
+
const functionCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, function_, async_, false);
|
|
3720
3782
|
const emittedArguments_ = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
3721
3783
|
return ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, _w1, async_)
|
|
3722
3784
|
}));
|
|
@@ -3738,7 +3800,7 @@ if(ff_core_List.List_isEmpty(fields_)) {
|
|
|
3738
3800
|
return "{}"
|
|
3739
3801
|
} else {
|
|
3740
3802
|
const list_ = ff_core_List.List_map(fields_, ((f_) => {
|
|
3741
|
-
return ((ff_compiler_JsEmitter.escapeKeyword_(f_.name_) + ": ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, f_.value_, async_))
|
|
3803
|
+
return ((ff_compiler_JsEmitter.escapeKeyword_(f_.name_) + ": ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, f_.value_, async_, false))
|
|
3742
3804
|
}));
|
|
3743
3805
|
return (("{\n" + ff_core_List.List_join(list_, ",\n")) + "\n}")
|
|
3744
3806
|
}
|
|
@@ -3752,6 +3814,30 @@ ff_compiler_JsEmitter.fail_(at_, "Unbound wildcard")
|
|
|
3752
3814
|
};
|
|
3753
3815
|
return ("_w" + index_)
|
|
3754
3816
|
}
|
|
3817
|
+
if(_1.ESequential && _1.before_.ESequential && _1.before_.before_.ESequential) {
|
|
3818
|
+
const before1_ = _1.before_.before_.before_;
|
|
3819
|
+
const before2_ = _1.before_.before_.after_;
|
|
3820
|
+
const before3_ = _1.before_.after_;
|
|
3821
|
+
const after_ = _1.after_;
|
|
3822
|
+
if((((ff_compiler_JsEmitter.safeCommable_(before1_) && ff_compiler_JsEmitter.safeCommable_(before2_)) && ff_compiler_JsEmitter.safeCommable_(before3_)) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
3823
|
+
return (((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, before1_, async_, true)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, before2_, async_, true)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, before3_, async_, true)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, after_, async_, ignored_)) + ")")
|
|
3824
|
+
}
|
|
3825
|
+
}
|
|
3826
|
+
if(_1.ESequential && _1.before_.ESequential) {
|
|
3827
|
+
const before1_ = _1.before_.before_;
|
|
3828
|
+
const before2_ = _1.before_.after_;
|
|
3829
|
+
const after_ = _1.after_;
|
|
3830
|
+
if(((ff_compiler_JsEmitter.safeCommable_(before1_) && ff_compiler_JsEmitter.safeCommable_(before2_)) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
3831
|
+
return (((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, before1_, async_, true)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, before2_, async_, true)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, after_, async_, ignored_)) + ")")
|
|
3832
|
+
}
|
|
3833
|
+
}
|
|
3834
|
+
if(_1.ESequential) {
|
|
3835
|
+
const before_ = _1.before_;
|
|
3836
|
+
const after_ = _1.after_;
|
|
3837
|
+
if((ff_compiler_JsEmitter.safeCommable_(before_) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
3838
|
+
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, before_, async_, true)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, after_, async_, ignored_)) + ")")
|
|
3839
|
+
}
|
|
3840
|
+
}
|
|
3755
3841
|
if(async_) {
|
|
3756
3842
|
return (("(await (async function() {\n" + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, term_, true, false, async_)) + "\n})())")
|
|
3757
3843
|
}
|
|
@@ -3773,7 +3859,7 @@ return (dot_ + s_)
|
|
|
3773
3859
|
}
|
|
3774
3860
|
}
|
|
3775
3861
|
{
|
|
3776
|
-
return (("[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, term_, async_)) + "]")
|
|
3862
|
+
return (("[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, term_, async_, false)) + "]")
|
|
3777
3863
|
}
|
|
3778
3864
|
}
|
|
3779
3865
|
}
|
|
@@ -3832,21 +3918,6 @@ const before_ = _1.before_;
|
|
|
3832
3918
|
const after_ = _1.after_;
|
|
3833
3919
|
return ((ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before_, false, false, async_) + ";\n") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, after_, last_, break_, async_))
|
|
3834
3920
|
}
|
|
3835
|
-
if(_1.EAssign) {
|
|
3836
|
-
const at_ = _1.at_;
|
|
3837
|
-
const operator_ = _1.operator_;
|
|
3838
|
-
const name_ = _1.variable_;
|
|
3839
|
-
const value_ = _1.value_;
|
|
3840
|
-
return ((((ff_compiler_JsEmitter.escapeKeyword_(name_) + " ") + operator_) + "= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_))
|
|
3841
|
-
}
|
|
3842
|
-
if(_1.EAssignField) {
|
|
3843
|
-
const at_ = _1.at_;
|
|
3844
|
-
const operator_ = _1.operator_;
|
|
3845
|
-
const record_ = _1.record_;
|
|
3846
|
-
const field_ = _1.field_;
|
|
3847
|
-
const value_ = _1.value_;
|
|
3848
|
-
return ((((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, record_, async_) + ".") + ff_compiler_JsEmitter.escapeKeyword_(field_)) + " ") + operator_) + "= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_))
|
|
3849
|
-
}
|
|
3850
3921
|
if(_1.ECall && _1.target_.StaticCall && _1.target_.tailCall_) {
|
|
3851
3922
|
const at_ = _1.at_;
|
|
3852
3923
|
const name_ = _1.target_.name_;
|
|
@@ -3858,7 +3929,7 @@ throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Sy
|
|
|
3858
3929
|
};
|
|
3859
3930
|
self_.tailCallUsed_ = true;
|
|
3860
3931
|
const pair_ = ff_core_List.List_unzip(ff_core_List.List_collect(ff_core_List.List_map(arguments_, ((a_) => {
|
|
3861
|
-
return ff_core_Option.Some(ff_core_Pair.Pair((((("const " + ff_compiler_JsEmitter.escapeKeyword_((ff_core_Option.Option_grab(a_.name_) + "_r"))) + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a_.value_, async_)) + ";"), ((ff_compiler_JsEmitter.escapeKeyword_(ff_core_Option.Option_grab(a_.name_)) + " = ") + ff_compiler_JsEmitter.escapeKeyword_((ff_core_Option.Option_grab(a_.name_) + "_r")))))
|
|
3932
|
+
return ff_core_Option.Some(ff_core_Pair.Pair((((("const " + ff_compiler_JsEmitter.escapeKeyword_((ff_core_Option.Option_grab(a_.name_) + "_r"))) + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a_.value_, async_, false)) + ";"), ((ff_compiler_JsEmitter.escapeKeyword_(ff_core_Option.Option_grab(a_.name_)) + " = ") + ff_compiler_JsEmitter.escapeKeyword_((ff_core_Option.Option_grab(a_.name_) + "_r")))))
|
|
3862
3933
|
})), ((_w1) => {
|
|
3863
3934
|
return _w1
|
|
3864
3935
|
})));
|
|
@@ -3884,7 +3955,7 @@ const cases_ = _1.function_.lambda_.cases_;
|
|
|
3884
3955
|
ff_compiler_Patterns.convertAndCheck_(self_.otherModules_, cases_);
|
|
3885
3956
|
return (((((((((!last_) && (!break_))
|
|
3886
3957
|
? "do "
|
|
3887
|
-
: "") + "{\nconst _1 = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_)) + ";\n") + ff_core_List.List_join(ff_core_List.List_map(ff_core_List.List_pairs(cases_), ((_1) => {
|
|
3958
|
+
: "") + "{\nconst _1 = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_, false)) + ";\n") + ff_core_List.List_join(ff_core_List.List_map(ff_core_List.List_pairs(cases_), ((_1) => {
|
|
3888
3959
|
{
|
|
3889
3960
|
const i_ = _1.first_;
|
|
3890
3961
|
const c_ = _1.second_;
|
|
@@ -3897,15 +3968,22 @@ return ff_compiler_JsEmitter.JsEmitter_emitCase(self_, ["_1"], c_, [], [], true,
|
|
|
3897
3968
|
return
|
|
3898
3969
|
}
|
|
3899
3970
|
{
|
|
3971
|
+
const _guard1 = ff_compiler_JsEmitter.JsEmitter_emitAssignment(self_, term_, async_);
|
|
3972
|
+
if(_guard1.Some) {
|
|
3973
|
+
const code_ = _guard1.value_;
|
|
3974
|
+
return code_
|
|
3975
|
+
}
|
|
3976
|
+
}
|
|
3977
|
+
{
|
|
3900
3978
|
{
|
|
3901
3979
|
const _1 = ff_compiler_JsEmitter.detectIfElse_(term_);
|
|
3902
3980
|
if(_1.length === 0) {
|
|
3903
3981
|
if(break_) {
|
|
3904
|
-
return (("if(!" + ff_compiler_JsEmitter.
|
|
3982
|
+
return (("if(!" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, term_, async_, false)) + ") break")
|
|
3905
3983
|
} else if(last_) {
|
|
3906
|
-
return ("return " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, term_, async_))
|
|
3984
|
+
return ("return " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, term_, async_, false))
|
|
3907
3985
|
} else {
|
|
3908
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, term_, async_)
|
|
3986
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, term_, async_, true)
|
|
3909
3987
|
}
|
|
3910
3988
|
return
|
|
3911
3989
|
}
|
|
@@ -3918,7 +3996,7 @@ return ff_core_List.List_foldLeft(list_, initial_, ((_1, _2) => {
|
|
|
3918
3996
|
const otherwise_ = _1;
|
|
3919
3997
|
const condition_ = _2.first_;
|
|
3920
3998
|
const body_ = _2.second_;
|
|
3921
|
-
return ((((("if(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_)) + ") {\n") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, body_, last_, break_, async_)) + "\n} else ") + otherwise_)
|
|
3999
|
+
return ((((("if(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_, false)) + ") {\n") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, body_, last_, break_, async_)) + "\n} else ") + otherwise_)
|
|
3922
4000
|
}
|
|
3923
4001
|
}))
|
|
3924
4002
|
return
|
|
@@ -3931,7 +4009,7 @@ return ff_core_List.List_foldLeft(list_, "{}", ((_1, _2) => {
|
|
|
3931
4009
|
const otherwise_ = _1;
|
|
3932
4010
|
const condition_ = _2.first_;
|
|
3933
4011
|
const body_ = _2.second_;
|
|
3934
|
-
return ((((("if(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_)) + ") {\n") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, body_, last_, break_, async_)) + "\n} else ") + otherwise_)
|
|
4012
|
+
return ((((("if(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_, false)) + ") {\n") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, body_, last_, break_, async_)) + "\n} else ") + otherwise_)
|
|
3935
4013
|
}
|
|
3936
4014
|
}))
|
|
3937
4015
|
return
|
|
@@ -3944,7 +4022,7 @@ return ff_core_List.List_foldLeft(list_, "return ff_core_Option.None()", ((_1, _
|
|
|
3944
4022
|
const otherwise_ = _1;
|
|
3945
4023
|
const condition_ = _2.first_;
|
|
3946
4024
|
const body_ = _2.second_;
|
|
3947
|
-
return (((((("if(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_)) + ") {\n") + "return ff_core_Option.Some(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_)) + ")\n} else ") + otherwise_)
|
|
4025
|
+
return (((((("if(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_, false)) + ") {\n") + "return ff_core_Option.Some(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_, false)) + ")\n} else ") + otherwise_)
|
|
3948
4026
|
}
|
|
3949
4027
|
}))
|
|
3950
4028
|
return
|
|
@@ -3955,6 +4033,172 @@ return
|
|
|
3955
4033
|
}
|
|
3956
4034
|
}
|
|
3957
4035
|
|
|
4036
|
+
export async function JsEmitter_emitAssignment$(self_, term_, async_, $task) {
|
|
4037
|
+
const self_a = self_;
|
|
4038
|
+
const term_a = term_;
|
|
4039
|
+
const async_a = async_;
|
|
4040
|
+
if(term_a.ECall && term_a.target_.StaticCall) {
|
|
4041
|
+
const at_ = term_a.at_;
|
|
4042
|
+
const name_ = term_a.target_.name_;
|
|
4043
|
+
const arguments_ = term_a.arguments_;
|
|
4044
|
+
const dictionaries_ = term_a.dictionaries_;
|
|
4045
|
+
{
|
|
4046
|
+
const _1 = name_;
|
|
4047
|
+
if(_1 === "ff:core/JsValue.JsValue_set") {
|
|
4048
|
+
const _guard1 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
4049
|
+
return _w1.value_
|
|
4050
|
+
}));
|
|
4051
|
+
if(_guard1.length === 3) {
|
|
4052
|
+
const e1_ = _guard1[0];
|
|
4053
|
+
const e2_ = _guard1[1];
|
|
4054
|
+
const e3_ = _guard1[2];
|
|
4055
|
+
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")) + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_, false)))
|
|
4056
|
+
}
|
|
4057
|
+
}
|
|
4058
|
+
if(_1 === "ff:core/JsValue.JsValue_increment") {
|
|
4059
|
+
const _guard1 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
4060
|
+
return _w1.value_
|
|
4061
|
+
}));
|
|
4062
|
+
if(_guard1.length === 3) {
|
|
4063
|
+
const e1_ = _guard1[0];
|
|
4064
|
+
const e2_ = _guard1[1];
|
|
4065
|
+
const e3_ = _guard1[2];
|
|
4066
|
+
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")) + " += ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_, false)))
|
|
4067
|
+
}
|
|
4068
|
+
}
|
|
4069
|
+
if(_1 === "ff:core/JsValue.JsValue_decrement") {
|
|
4070
|
+
const _guard1 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
4071
|
+
return _w1.value_
|
|
4072
|
+
}));
|
|
4073
|
+
if(_guard1.length === 3) {
|
|
4074
|
+
const e1_ = _guard1[0];
|
|
4075
|
+
const e2_ = _guard1[1];
|
|
4076
|
+
const e3_ = _guard1[2];
|
|
4077
|
+
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")) + " -= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_, false)))
|
|
4078
|
+
}
|
|
4079
|
+
}
|
|
4080
|
+
if(_1 === "ff:core/JsSystem.JsSystem_set") {
|
|
4081
|
+
const _guard3 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
4082
|
+
return _w1.value_
|
|
4083
|
+
}));
|
|
4084
|
+
if(_guard3.length === 3 && _guard3[1].EString) {
|
|
4085
|
+
const e1_ = _guard3[0];
|
|
4086
|
+
const q_ = _guard3[1].value_;
|
|
4087
|
+
const e3_ = _guard3[2];
|
|
4088
|
+
const _guard2 = ff_compiler_JsEmitter.noSideEffects_(e1_);
|
|
4089
|
+
if(_guard2) {
|
|
4090
|
+
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
4091
|
+
if(_guard1.Some) {
|
|
4092
|
+
const s_ = _guard1.value_;
|
|
4093
|
+
return ff_core_Option.Some(((s_ + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_, false)))
|
|
4094
|
+
}
|
|
4095
|
+
}
|
|
4096
|
+
}
|
|
4097
|
+
}
|
|
4098
|
+
if(_1 === "ff:core/JsSystem.JsSystem_increment") {
|
|
4099
|
+
const _guard3 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
4100
|
+
return _w1.value_
|
|
4101
|
+
}));
|
|
4102
|
+
if(_guard3.length === 3 && _guard3[1].EString) {
|
|
4103
|
+
const e1_ = _guard3[0];
|
|
4104
|
+
const q_ = _guard3[1].value_;
|
|
4105
|
+
const e3_ = _guard3[2];
|
|
4106
|
+
const _guard2 = ff_compiler_JsEmitter.noSideEffects_(e1_);
|
|
4107
|
+
if(_guard2) {
|
|
4108
|
+
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
4109
|
+
if(_guard1.Some) {
|
|
4110
|
+
const s_ = _guard1.value_;
|
|
4111
|
+
return ff_core_Option.Some(((s_ + " += ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_, false)))
|
|
4112
|
+
}
|
|
4113
|
+
}
|
|
4114
|
+
}
|
|
4115
|
+
}
|
|
4116
|
+
if(_1 === "ff:core/JsSystem.JsSystem_decrement") {
|
|
4117
|
+
const _guard3 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
4118
|
+
return _w1.value_
|
|
4119
|
+
}));
|
|
4120
|
+
if(_guard3.length === 3 && _guard3[1].EString) {
|
|
4121
|
+
const e1_ = _guard3[0];
|
|
4122
|
+
const q_ = _guard3[1].value_;
|
|
4123
|
+
const e3_ = _guard3[2];
|
|
4124
|
+
const _guard2 = ff_compiler_JsEmitter.noSideEffects_(e1_);
|
|
4125
|
+
if(_guard2) {
|
|
4126
|
+
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
4127
|
+
if(_guard1.Some) {
|
|
4128
|
+
const s_ = _guard1.value_;
|
|
4129
|
+
return ff_core_Option.Some(((s_ + " -= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_, false)))
|
|
4130
|
+
}
|
|
4131
|
+
}
|
|
4132
|
+
}
|
|
4133
|
+
}
|
|
4134
|
+
if(_1 === "ff:core/Js.set") {
|
|
4135
|
+
const _guard2 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
4136
|
+
return _w1.value_
|
|
4137
|
+
}));
|
|
4138
|
+
if(_guard2.length === 2 && _guard2[0].EString) {
|
|
4139
|
+
const q_ = _guard2[0].value_;
|
|
4140
|
+
const e2_ = _guard2[1];
|
|
4141
|
+
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
4142
|
+
if(_guard1.Some) {
|
|
4143
|
+
const s_ = _guard1.value_;
|
|
4144
|
+
return ff_core_Option.Some(((s_ + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)))
|
|
4145
|
+
}
|
|
4146
|
+
}
|
|
4147
|
+
}
|
|
4148
|
+
if(_1 === "ff:core/Js.increment") {
|
|
4149
|
+
const _guard2 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
4150
|
+
return _w1.value_
|
|
4151
|
+
}));
|
|
4152
|
+
if(_guard2.length === 2 && _guard2[0].EString) {
|
|
4153
|
+
const q_ = _guard2[0].value_;
|
|
4154
|
+
const e2_ = _guard2[1];
|
|
4155
|
+
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
4156
|
+
if(_guard1.Some) {
|
|
4157
|
+
const s_ = _guard1.value_;
|
|
4158
|
+
return ff_core_Option.Some(((s_ + " += ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)))
|
|
4159
|
+
}
|
|
4160
|
+
}
|
|
4161
|
+
}
|
|
4162
|
+
if(_1 === "ff:core/Js.decrement") {
|
|
4163
|
+
const _guard2 = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
4164
|
+
return _w1.value_
|
|
4165
|
+
}));
|
|
4166
|
+
if(_guard2.length === 2 && _guard2[0].EString) {
|
|
4167
|
+
const q_ = _guard2[0].value_;
|
|
4168
|
+
const e2_ = _guard2[1];
|
|
4169
|
+
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
4170
|
+
if(_guard1.Some) {
|
|
4171
|
+
const s_ = _guard1.value_;
|
|
4172
|
+
return ff_core_Option.Some(((s_ + " -= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)))
|
|
4173
|
+
}
|
|
4174
|
+
}
|
|
4175
|
+
}
|
|
4176
|
+
{
|
|
4177
|
+
return ff_core_Option.None()
|
|
4178
|
+
}
|
|
4179
|
+
}
|
|
4180
|
+
return
|
|
4181
|
+
}
|
|
4182
|
+
if(term_a.EAssign) {
|
|
4183
|
+
const at_ = term_a.at_;
|
|
4184
|
+
const operator_ = term_a.operator_;
|
|
4185
|
+
const name_ = term_a.variable_;
|
|
4186
|
+
const value_ = term_a.value_;
|
|
4187
|
+
return ff_core_Option.Some(((((ff_compiler_JsEmitter.escapeKeyword_(name_) + " ") + operator_) + "= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_, false)))
|
|
4188
|
+
}
|
|
4189
|
+
if(term_a.EAssignField) {
|
|
4190
|
+
const at_ = term_a.at_;
|
|
4191
|
+
const operator_ = term_a.operator_;
|
|
4192
|
+
const record_ = term_a.record_;
|
|
4193
|
+
const field_ = term_a.field_;
|
|
4194
|
+
const value_ = term_a.value_;
|
|
4195
|
+
return ff_core_Option.Some(((((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, record_, async_, false) + ".") + ff_compiler_JsEmitter.escapeKeyword_(field_)) + " ") + operator_) + "= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_, false)))
|
|
4196
|
+
}
|
|
4197
|
+
{
|
|
4198
|
+
return ff_core_Option.None()
|
|
4199
|
+
}
|
|
4200
|
+
}
|
|
4201
|
+
|
|
3958
4202
|
export async function JsEmitter_emitSpecialCall$(self_, term_, async_, name_, arguments_, dictionaries_, $task) {
|
|
3959
4203
|
{
|
|
3960
4204
|
const _1 = name_;
|
|
@@ -3965,7 +4209,7 @@ if(_guard2) {
|
|
|
3965
4209
|
const _guard1 = arguments_;
|
|
3966
4210
|
if(_guard1.length === 1) {
|
|
3967
4211
|
const value_ = _guard1[0];
|
|
3968
|
-
return ff_core_Option.Some(((("(" + operator_) + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_)) + ")"))
|
|
4212
|
+
return ff_core_Option.Some(((("(" + operator_) + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_, false)) + ")"))
|
|
3969
4213
|
}
|
|
3970
4214
|
}
|
|
3971
4215
|
}
|
|
@@ -3977,7 +4221,7 @@ const _guard1 = arguments_;
|
|
|
3977
4221
|
if(_guard1.length === 2) {
|
|
3978
4222
|
const left_ = _guard1[0];
|
|
3979
4223
|
const right_ = _guard1[1];
|
|
3980
|
-
return ff_core_Option.Some((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_)) + " ") + operator_) + " ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_)) + ")"))
|
|
4224
|
+
return ff_core_Option.Some((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_, false)) + " ") + operator_) + " ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_, false)) + ")"))
|
|
3981
4225
|
}
|
|
3982
4226
|
}
|
|
3983
4227
|
}
|
|
@@ -3987,8 +4231,8 @@ if(_guard2.length === 2) {
|
|
|
3987
4231
|
const e1_ = _guard2[0];
|
|
3988
4232
|
const e2_ = _guard2[1];
|
|
3989
4233
|
if((ff_compiler_JsEmitter.noSideEffects_(e1_) && ff_compiler_JsEmitter.noSideEffects_(e2_))) {
|
|
3990
|
-
const code1_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_);
|
|
3991
|
-
const code2_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_);
|
|
4234
|
+
const code1_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false);
|
|
4235
|
+
const code2_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false);
|
|
3992
4236
|
return ff_core_Option.Some(((((((((("(" + code1_) + "[") + code2_) + "] ?? ") + "ff_core_List.List_grab(") + code1_) + ", ") + code2_) + "))"))
|
|
3993
4237
|
}
|
|
3994
4238
|
}
|
|
@@ -3999,8 +4243,8 @@ if(_guard2.length === 2) {
|
|
|
3999
4243
|
const e1_ = _guard2[0];
|
|
4000
4244
|
const e2_ = _guard2[1];
|
|
4001
4245
|
if((ff_compiler_JsEmitter.noSideEffects_(e1_) && ff_compiler_JsEmitter.noSideEffects_(e2_))) {
|
|
4002
|
-
const code1_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_);
|
|
4003
|
-
const code2_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_);
|
|
4246
|
+
const code1_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false);
|
|
4247
|
+
const code2_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false);
|
|
4004
4248
|
return ff_core_Option.Some(((((((((("(" + code1_) + ".array[") + code2_) + "] ?? ") + "ff_core_Array.Array_grab(") + code1_) + ", ") + code2_) + "))"))
|
|
4005
4249
|
}
|
|
4006
4250
|
}
|
|
@@ -4009,21 +4253,21 @@ if(_1 === "ff:core/List.List_size") {
|
|
|
4009
4253
|
const _guard1 = arguments_;
|
|
4010
4254
|
if(_guard1.length === 1) {
|
|
4011
4255
|
const e_ = _guard1[0];
|
|
4012
|
-
return ff_core_Option.Some((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_) + ".length"))
|
|
4256
|
+
return ff_core_Option.Some((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false) + ".length"))
|
|
4013
4257
|
}
|
|
4014
4258
|
}
|
|
4015
4259
|
if(_1 === "ff:core/Array.Array_size") {
|
|
4016
4260
|
const _guard1 = arguments_;
|
|
4017
4261
|
if(_guard1.length === 1) {
|
|
4018
4262
|
const e_ = _guard1[0];
|
|
4019
|
-
return ff_core_Option.Some((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_) + ".array.length"))
|
|
4263
|
+
return ff_core_Option.Some((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false) + ".array.length"))
|
|
4020
4264
|
}
|
|
4021
4265
|
}
|
|
4022
4266
|
if(_1 === "ff:core/String.String_size") {
|
|
4023
4267
|
const _guard1 = arguments_;
|
|
4024
4268
|
if(_guard1.length === 1) {
|
|
4025
4269
|
const e_ = _guard1[0];
|
|
4026
|
-
return ff_core_Option.Some((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_) + ".length"))
|
|
4270
|
+
return ff_core_Option.Some((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false) + ".length"))
|
|
4027
4271
|
}
|
|
4028
4272
|
}
|
|
4029
4273
|
if(_1 === "ff:core/Equal.equals") {
|
|
@@ -4035,7 +4279,7 @@ const _guard2 = dictionaries_;
|
|
|
4035
4279
|
if(_guard2.length === 1 && _guard2[0].dictionaries_.length === 0) {
|
|
4036
4280
|
const typeName_ = _guard2[0].typeName_;
|
|
4037
4281
|
if((ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String) || (typeName_ === "ff:core/Ordering.Ordering"))) {
|
|
4038
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_)) + " === ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_)) + ")"))
|
|
4282
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_, false)) + " === ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_, false)) + ")"))
|
|
4039
4283
|
}
|
|
4040
4284
|
}
|
|
4041
4285
|
}
|
|
@@ -4049,7 +4293,7 @@ const _guard2 = dictionaries_;
|
|
|
4049
4293
|
if(_guard2.length === 1 && _guard2[0].dictionaries_.length === 0) {
|
|
4050
4294
|
const typeName_ = _guard2[0].typeName_;
|
|
4051
4295
|
if((ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String) || (typeName_ === "ff:core/Ordering.Ordering"))) {
|
|
4052
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_)) + " !== ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_)) + ")"))
|
|
4296
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_, false)) + " !== ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_, false)) + ")"))
|
|
4053
4297
|
}
|
|
4054
4298
|
}
|
|
4055
4299
|
}
|
|
@@ -4063,7 +4307,7 @@ const _guard2 = dictionaries_;
|
|
|
4063
4307
|
if(_guard2.length === 1 && _guard2[0].dictionaries_.length === 0) {
|
|
4064
4308
|
const typeName_ = _guard2[0].typeName_;
|
|
4065
4309
|
if(ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)) {
|
|
4066
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_)) + " < ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_)) + ")"))
|
|
4310
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_, false)) + " < ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_, false)) + ")"))
|
|
4067
4311
|
}
|
|
4068
4312
|
}
|
|
4069
4313
|
}
|
|
@@ -4077,7 +4321,7 @@ const _guard2 = dictionaries_;
|
|
|
4077
4321
|
if(_guard2.length === 1 && _guard2[0].dictionaries_.length === 0) {
|
|
4078
4322
|
const typeName_ = _guard2[0].typeName_;
|
|
4079
4323
|
if(ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)) {
|
|
4080
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_)) + " >= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_)) + ")"))
|
|
4324
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_, false)) + " >= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_, false)) + ")"))
|
|
4081
4325
|
}
|
|
4082
4326
|
}
|
|
4083
4327
|
}
|
|
@@ -4091,7 +4335,7 @@ const _guard2 = dictionaries_;
|
|
|
4091
4335
|
if(_guard2.length === 1 && _guard2[0].dictionaries_.length === 0) {
|
|
4092
4336
|
const typeName_ = _guard2[0].typeName_;
|
|
4093
4337
|
if(ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)) {
|
|
4094
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_)) + " > ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_)) + ")"))
|
|
4338
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_, false)) + " > ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_, false)) + ")"))
|
|
4095
4339
|
}
|
|
4096
4340
|
}
|
|
4097
4341
|
}
|
|
@@ -4105,7 +4349,7 @@ const _guard2 = dictionaries_;
|
|
|
4105
4349
|
if(_guard2.length === 1 && _guard2[0].dictionaries_.length === 0) {
|
|
4106
4350
|
const typeName_ = _guard2[0].typeName_;
|
|
4107
4351
|
if(ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String)) {
|
|
4108
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_)) + " <= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_)) + ")"))
|
|
4352
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, left_, async_, false)) + " <= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, right_, async_, false)) + ")"))
|
|
4109
4353
|
}
|
|
4110
4354
|
}
|
|
4111
4355
|
}
|
|
@@ -4132,7 +4376,7 @@ const newAsync_ = (self_.emittingAsync_ && ff_compiler_JsEmitter.effectTypeIsAsy
|
|
|
4132
4376
|
const await_ = (newAsync_
|
|
4133
4377
|
? "await "
|
|
4134
4378
|
: "");
|
|
4135
|
-
return ff_core_Option.Some(((((((((((((((((((await_ + "((() => {\n") + "const size = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, 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") + "})())"))
|
|
4379
|
+
return ff_core_Option.Some(((((((((((((((((((await_ + "((() => {\n") + "const size = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, size_, async_, false)) + ";\n") + "const result = [];\n") + "for(let ") + n_) + " = 0; ") + n_) + " < size; ") + n_) + "++) {\n") + "result.push(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, newAsync_, false)) + ");\n") + "}\n") + "return result;\n") + "})())"))
|
|
4136
4380
|
}
|
|
4137
4381
|
}
|
|
4138
4382
|
}
|
|
@@ -4173,7 +4417,7 @@ if(_1 === "ff:core/Js.dynamicImport") {
|
|
|
4173
4417
|
const _guard1 = arguments_;
|
|
4174
4418
|
if(_guard1.length === 1) {
|
|
4175
4419
|
const url_ = _guard1[0];
|
|
4176
|
-
return ff_core_Option.Some((("import(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, url_, async_)) + ")"))
|
|
4420
|
+
return ff_core_Option.Some((("import(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, url_, async_, false)) + ")"))
|
|
4177
4421
|
}
|
|
4178
4422
|
}
|
|
4179
4423
|
if(_1 === "ff:core/Js.await") {
|
|
@@ -4181,9 +4425,9 @@ const _guard1 = arguments_;
|
|
|
4181
4425
|
if(_guard1.length === 1) {
|
|
4182
4426
|
const body_ = _guard1[0];
|
|
4183
4427
|
if(async_) {
|
|
4184
|
-
return ff_core_Option.Some((("(await " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_)) + ")"))
|
|
4428
|
+
return ff_core_Option.Some((("(await " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_, false)) + ")"))
|
|
4185
4429
|
} else {
|
|
4186
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_))
|
|
4430
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_, false))
|
|
4187
4431
|
}
|
|
4188
4432
|
return
|
|
4189
4433
|
}
|
|
@@ -4259,7 +4503,7 @@ if(_1 === "ff:core/Js.setController") {
|
|
|
4259
4503
|
const _guard1 = arguments_;
|
|
4260
4504
|
if(_guard1.length === 1) {
|
|
4261
4505
|
const a_ = _guard1[0];
|
|
4262
|
-
return ff_core_Option.Some((("($task.controller_ = " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a_, async_)) + ")"))
|
|
4506
|
+
return ff_core_Option.Some((("($task.controller_ = " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a_, async_, false)) + ")"))
|
|
4263
4507
|
}
|
|
4264
4508
|
}
|
|
4265
4509
|
if(_1 === "ff:core/Js.inAsync") {
|
|
@@ -4290,14 +4534,14 @@ if(_1 === "ff:core/Js.value") {
|
|
|
4290
4534
|
const _guard1 = arguments_;
|
|
4291
4535
|
if(_guard1.length === 1) {
|
|
4292
4536
|
const e_ = _guard1[0];
|
|
4293
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_))
|
|
4537
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false))
|
|
4294
4538
|
}
|
|
4295
4539
|
}
|
|
4296
4540
|
if(_1 === "ff:core/Js.fromValue") {
|
|
4297
4541
|
const _guard1 = arguments_;
|
|
4298
4542
|
if(_guard1.length === 1) {
|
|
4299
4543
|
const e_ = _guard1[0];
|
|
4300
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_))
|
|
4544
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false))
|
|
4301
4545
|
}
|
|
4302
4546
|
}
|
|
4303
4547
|
if(_1 === "ff:core/Js.rawIdentifier") {
|
|
@@ -4312,7 +4556,7 @@ const _guard1 = arguments_;
|
|
|
4312
4556
|
if(_guard1.length === 2 && _guard1[0].EString) {
|
|
4313
4557
|
const op_ = _guard1[0].value_;
|
|
4314
4558
|
const a1_ = _guard1[1];
|
|
4315
|
-
return ff_core_Option.Some(((("(" + ff_core_String.String_replace(op_, "\"", "")) + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_, async_)) + ")"))
|
|
4559
|
+
return ff_core_Option.Some(((("(" + ff_core_String.String_replace(op_, "\"", "")) + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_, async_, false)) + ")"))
|
|
4316
4560
|
}
|
|
4317
4561
|
}
|
|
4318
4562
|
if(_1 === "ff:core/Js.binaryOperator") {
|
|
@@ -4321,7 +4565,7 @@ if(_guard1.length === 3 && _guard1[0].EString) {
|
|
|
4321
4565
|
const op_ = _guard1[0].value_;
|
|
4322
4566
|
const a1_ = _guard1[1];
|
|
4323
4567
|
const a2_ = _guard1[2];
|
|
4324
|
-
return ff_core_Option.Some((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_, async_)) + " ") + ff_core_String.String_replace(op_, "\"", "")) + " ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_, async_)) + ")"))
|
|
4568
|
+
return ff_core_Option.Some((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_, async_, false)) + " ") + ff_core_String.String_replace(op_, "\"", "")) + " ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_, async_, false)) + ")"))
|
|
4325
4569
|
}
|
|
4326
4570
|
}
|
|
4327
4571
|
if(_1 === "ff:core/Js.shortCircuitingOperator") {
|
|
@@ -4330,21 +4574,21 @@ if(_guard1.length === 3 && _guard1[0].EString) {
|
|
|
4330
4574
|
const op_ = _guard1[0].value_;
|
|
4331
4575
|
const a1_ = _guard1[1];
|
|
4332
4576
|
const a2_ = _guard1[2];
|
|
4333
|
-
return ff_core_Option.Some((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_, async_)) + " ") + ff_core_String.String_replace(op_, "\"", "")) + " ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, ff_compiler_JsEmitter.invokeImmediately_(a2_), async_)) + ")"))
|
|
4577
|
+
return ff_core_Option.Some((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_, async_, false)) + " ") + ff_core_String.String_replace(op_, "\"", "")) + " ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, ff_compiler_JsEmitter.invokeImmediately_(a2_), async_, false)) + ")"))
|
|
4334
4578
|
}
|
|
4335
4579
|
}
|
|
4336
4580
|
if(_1 === "ff:core/JsValue.JsValue_spreadToArray") {
|
|
4337
4581
|
const _guard1 = arguments_;
|
|
4338
4582
|
if(_guard1.length === 1) {
|
|
4339
4583
|
const e1_ = _guard1[0];
|
|
4340
|
-
return ff_core_Option.Some((("[..." + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + "]"))
|
|
4584
|
+
return ff_core_Option.Some((("[..." + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + "]"))
|
|
4341
4585
|
}
|
|
4342
4586
|
}
|
|
4343
4587
|
if(_1 === "ff:core/JsValue.JsValue_typeof") {
|
|
4344
4588
|
const _guard1 = arguments_;
|
|
4345
4589
|
if(_guard1.length === 1) {
|
|
4346
4590
|
const e_ = _guard1[0];
|
|
4347
|
-
return ff_core_Option.Some((("(typeof " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_)) + ")"))
|
|
4591
|
+
return ff_core_Option.Some((("(typeof " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false)) + ")"))
|
|
4348
4592
|
}
|
|
4349
4593
|
}
|
|
4350
4594
|
if(_1 === "ff:core/JsValue.JsValue_instanceof") {
|
|
@@ -4352,7 +4596,7 @@ const _guard1 = arguments_;
|
|
|
4352
4596
|
if(_guard1.length === 2) {
|
|
4353
4597
|
const e1_ = _guard1[0];
|
|
4354
4598
|
const e2_ = _guard1[1];
|
|
4355
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + " instanceof ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)) + ")"))
|
|
4599
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + " instanceof ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)) + ")"))
|
|
4356
4600
|
}
|
|
4357
4601
|
}
|
|
4358
4602
|
if(_1 === "ff:core/JsValue.JsValue_get") {
|
|
@@ -4360,7 +4604,7 @@ const _guard1 = arguments_;
|
|
|
4360
4604
|
if(_guard1.length === 2) {
|
|
4361
4605
|
const e1_ = _guard1[0];
|
|
4362
4606
|
const e2_ = _guard1[1];
|
|
4363
|
-
return ff_core_Option.Some((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")))
|
|
4607
|
+
return ff_core_Option.Some((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")))
|
|
4364
4608
|
}
|
|
4365
4609
|
}
|
|
4366
4610
|
if(_1 === "ff:core/JsValue.JsValue_equals") {
|
|
@@ -4368,7 +4612,7 @@ const _guard1 = arguments_;
|
|
|
4368
4612
|
if(_guard1.length === 2) {
|
|
4369
4613
|
const e1_ = _guard1[0];
|
|
4370
4614
|
const e2_ = _guard1[1];
|
|
4371
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + " === ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)) + ")"))
|
|
4615
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + " === ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)) + ")"))
|
|
4372
4616
|
}
|
|
4373
4617
|
}
|
|
4374
4618
|
if(_1 === "ff:core/JsValue.JsValue_notEquals") {
|
|
@@ -4376,7 +4620,7 @@ const _guard1 = arguments_;
|
|
|
4376
4620
|
if(_guard1.length === 2) {
|
|
4377
4621
|
const e1_ = _guard1[0];
|
|
4378
4622
|
const e2_ = _guard1[1];
|
|
4379
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + " !== ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)) + ")"))
|
|
4623
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + " !== ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)) + ")"))
|
|
4380
4624
|
}
|
|
4381
4625
|
}
|
|
4382
4626
|
if(_1 === "ff:core/Int.Int_bitAnd") {
|
|
@@ -4384,7 +4628,7 @@ const _guard1 = arguments_;
|
|
|
4384
4628
|
if(_guard1.length === 2) {
|
|
4385
4629
|
const e1_ = _guard1[0];
|
|
4386
4630
|
const e2_ = _guard1[1];
|
|
4387
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + " & ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)) + ")"))
|
|
4631
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + " & ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)) + ")"))
|
|
4388
4632
|
}
|
|
4389
4633
|
}
|
|
4390
4634
|
if(_1 === "ff:core/Int.Int_bitRightUnsigned") {
|
|
@@ -4392,7 +4636,7 @@ const _guard1 = arguments_;
|
|
|
4392
4636
|
if(_guard1.length === 2) {
|
|
4393
4637
|
const e1_ = _guard1[0];
|
|
4394
4638
|
const e2_ = _guard1[1];
|
|
4395
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + " >>> ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)) + ")"))
|
|
4639
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + " >>> ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)) + ")"))
|
|
4396
4640
|
}
|
|
4397
4641
|
}
|
|
4398
4642
|
if(_1 === "ff:core/Int.Int_bitRight") {
|
|
@@ -4400,7 +4644,7 @@ const _guard1 = arguments_;
|
|
|
4400
4644
|
if(_guard1.length === 2) {
|
|
4401
4645
|
const e1_ = _guard1[0];
|
|
4402
4646
|
const e2_ = _guard1[1];
|
|
4403
|
-
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + " >> ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)) + ")"))
|
|
4647
|
+
return ff_core_Option.Some((((("(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + " >> ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)) + ")"))
|
|
4404
4648
|
}
|
|
4405
4649
|
}
|
|
4406
4650
|
{
|
|
@@ -4418,9 +4662,9 @@ const e1_ = _guard1[0];
|
|
|
4418
4662
|
const e2_ = _guard1[1];
|
|
4419
4663
|
const es_ = _guard1.slice(2);
|
|
4420
4664
|
const argumentCode_ = ff_core_List.List_join(ff_core_List.List_map(es_, ((_w1) => {
|
|
4421
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_)
|
|
4665
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_, false)
|
|
4422
4666
|
})), ", ");
|
|
4423
|
-
return ff_core_Option.Some(((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")) + "(") + argumentCode_) + ")"))
|
|
4667
|
+
return ff_core_Option.Some(((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")) + "(") + argumentCode_) + ")"))
|
|
4424
4668
|
}
|
|
4425
4669
|
}
|
|
4426
4670
|
}
|
|
@@ -4439,9 +4683,9 @@ if(_guard1.length >= 1) {
|
|
|
4439
4683
|
const e1_ = _guard1[0];
|
|
4440
4684
|
const es_ = _guard1.slice(1);
|
|
4441
4685
|
const argumentCode_ = ff_core_List.List_join(ff_core_List.List_map(es_, ((_w1) => {
|
|
4442
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_)
|
|
4686
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_, false)
|
|
4443
4687
|
})), ", ");
|
|
4444
|
-
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_) + "(") + argumentCode_) + ")"))
|
|
4688
|
+
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false) + "(") + argumentCode_) + ")"))
|
|
4445
4689
|
}
|
|
4446
4690
|
}
|
|
4447
4691
|
}
|
|
@@ -4460,9 +4704,9 @@ if(_guard1.length >= 1) {
|
|
|
4460
4704
|
const e1_ = _guard1[0];
|
|
4461
4705
|
const es_ = _guard1.slice(1);
|
|
4462
4706
|
const argumentCode_ = ff_core_List.List_join(ff_core_List.List_map(es_, ((_w1) => {
|
|
4463
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_)
|
|
4707
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_, false)
|
|
4464
4708
|
})), ", ");
|
|
4465
|
-
return ff_core_Option.Some(((((("(new " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + "(") + argumentCode_) + ")") + ")"))
|
|
4709
|
+
return ff_core_Option.Some(((((("(new " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + "(") + argumentCode_) + ")") + ")"))
|
|
4466
4710
|
}
|
|
4467
4711
|
}
|
|
4468
4712
|
}
|
|
@@ -4490,14 +4734,14 @@ if(_guard2 && ff_core_List.List_all(as_, ((_w1) => {
|
|
|
4490
4734
|
return ff_compiler_JsEmitter.noSideEffects_(_w1.value_)
|
|
4491
4735
|
}))) {
|
|
4492
4736
|
return (("{" + ff_core_List.List_join(ff_core_List.List_map(fields_, ((p_) => {
|
|
4493
|
-
return ((ff_compiler_JsEmitter.JsEmitter_emitField(self_, p_.first_, async_, "") + ": ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, p_.second_, async_))
|
|
4737
|
+
return ((ff_compiler_JsEmitter.JsEmitter_emitField(self_, p_.first_, async_, "") + ": ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, p_.second_, async_, false))
|
|
4494
4738
|
})), ", ")) + "}")
|
|
4495
4739
|
return
|
|
4496
4740
|
}
|
|
4497
4741
|
}
|
|
4498
4742
|
{
|
|
4499
|
-
return (((("{..." + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_)) + ", ") + ff_core_List.List_join(ff_core_List.List_map(fields_, ((p_) => {
|
|
4500
|
-
return ((ff_compiler_JsEmitter.JsEmitter_emitField(self_, p_.first_, async_, "") + ": ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, p_.second_, async_))
|
|
4743
|
+
return (((("{..." + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false)) + ", ") + ff_core_List.List_join(ff_core_List.List_map(fields_, ((p_) => {
|
|
4744
|
+
return ((ff_compiler_JsEmitter.JsEmitter_emitField(self_, p_.first_, async_, "") + ": ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, p_.second_, async_, false))
|
|
4501
4745
|
})), ", ")) + "}")
|
|
4502
4746
|
return
|
|
4503
4747
|
}
|
|
@@ -4523,10 +4767,10 @@ const q_ = _guard2[1].value_;
|
|
|
4523
4767
|
const es_ = _guard2.slice(2);
|
|
4524
4768
|
if(ff_compiler_JsEmitter.noSideEffects_(e1_)) {
|
|
4525
4769
|
const argumentCode_ = ff_core_List.List_join(ff_core_List.List_map(es_, ((_w1) => {
|
|
4526
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_)
|
|
4770
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_, false)
|
|
4527
4771
|
})), ", ");
|
|
4528
4772
|
return ff_core_Option.Some((((ff_core_Option.Option_else(ff_compiler_JsEmitter.safeBare_(q_), (() => {
|
|
4529
|
-
return (("globalThis[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)) + "]")
|
|
4773
|
+
return (("globalThis[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)) + "]")
|
|
4530
4774
|
})) + "(") + argumentCode_) + ")"))
|
|
4531
4775
|
return
|
|
4532
4776
|
}
|
|
@@ -4553,7 +4797,7 @@ const _guard2 = term_;
|
|
|
4553
4797
|
if(_guard2.ECall) {
|
|
4554
4798
|
const call_ = _guard2;
|
|
4555
4799
|
if((!ff_compiler_JsEmitter.effectTypeIsAsync_(call_.effect_))) {
|
|
4556
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_))
|
|
4800
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false))
|
|
4557
4801
|
}
|
|
4558
4802
|
}
|
|
4559
4803
|
}
|
|
@@ -4569,7 +4813,7 @@ const e2_ = _guard2[1];
|
|
|
4569
4813
|
const q_ = _guard2[1].value_;
|
|
4570
4814
|
if(ff_compiler_JsEmitter.noSideEffects_(e1_)) {
|
|
4571
4815
|
return ff_core_Option.Some(ff_core_Option.Option_else(ff_compiler_JsEmitter.safeBare_(q_), (() => {
|
|
4572
|
-
return (("globalThis[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)) + "]")
|
|
4816
|
+
return (("globalThis[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_, false)) + "]")
|
|
4573
4817
|
})))
|
|
4574
4818
|
return
|
|
4575
4819
|
}
|
|
@@ -4626,10 +4870,10 @@ const e1_ = _guard1[0];
|
|
|
4626
4870
|
const q_ = _guard1[0].value_;
|
|
4627
4871
|
const es_ = _guard1.slice(1);
|
|
4628
4872
|
const argumentCode_ = ff_core_List.List_join(ff_core_List.List_map(es_, ((_w1) => {
|
|
4629
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_)
|
|
4873
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, _w1, async_, false)
|
|
4630
4874
|
})), ", ");
|
|
4631
4875
|
return ff_core_Option.Some((((ff_core_Option.Option_else(ff_compiler_JsEmitter.safeBare_(q_), (() => {
|
|
4632
|
-
return (("globalThis[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + "]")
|
|
4876
|
+
return (("globalThis[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + "]")
|
|
4633
4877
|
})) + "(") + argumentCode_) + ")"))
|
|
4634
4878
|
return
|
|
4635
4879
|
}
|
|
@@ -4658,9 +4902,9 @@ return ("a_" + _w1)
|
|
|
4658
4902
|
const taskCode_ = ((argumentCode_ === "")
|
|
4659
4903
|
? "$task"
|
|
4660
4904
|
: ", $task");
|
|
4661
|
-
return ff_core_Option.Some(((((((("(async (" + argumentCode_) + ") => await ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + "(") + argumentCode_) + taskCode_) + "))"))
|
|
4905
|
+
return ff_core_Option.Some(((((((("(async (" + argumentCode_) + ") => await ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + "(") + argumentCode_) + taskCode_) + "))"))
|
|
4662
4906
|
} else {
|
|
4663
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_))
|
|
4907
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false))
|
|
4664
4908
|
}
|
|
4665
4909
|
return
|
|
4666
4910
|
}
|
|
@@ -4674,7 +4918,7 @@ if(_guard1.length === 1 && _guard1[0].EString) {
|
|
|
4674
4918
|
const e1_ = _guard1[0];
|
|
4675
4919
|
const q_ = _guard1[0].value_;
|
|
4676
4920
|
return ff_core_Option.Some(ff_core_Option.Option_else(ff_compiler_JsEmitter.safeBare_(q_), (() => {
|
|
4677
|
-
return (("globalThis[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_)) + "]")
|
|
4921
|
+
return (("globalThis[" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_, false)) + "]")
|
|
4678
4922
|
})))
|
|
4679
4923
|
return
|
|
4680
4924
|
}
|
|
@@ -4728,35 +4972,35 @@ if(_1 === "ff:core/Json.string") {
|
|
|
4728
4972
|
const _guard1 = arguments_;
|
|
4729
4973
|
if(_guard1.length === 1) {
|
|
4730
4974
|
const e_ = _guard1[0];
|
|
4731
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_))
|
|
4975
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false))
|
|
4732
4976
|
}
|
|
4733
4977
|
}
|
|
4734
4978
|
if(_1 === "ff:core/Json.int") {
|
|
4735
4979
|
const _guard1 = arguments_;
|
|
4736
4980
|
if(_guard1.length === 1) {
|
|
4737
4981
|
const e_ = _guard1[0];
|
|
4738
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_))
|
|
4982
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false))
|
|
4739
4983
|
}
|
|
4740
4984
|
}
|
|
4741
4985
|
if(_1 === "ff:core/Json.float") {
|
|
4742
4986
|
const _guard1 = arguments_;
|
|
4743
4987
|
if(_guard1.length === 1) {
|
|
4744
4988
|
const e_ = _guard1[0];
|
|
4745
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_))
|
|
4989
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false))
|
|
4746
4990
|
}
|
|
4747
4991
|
}
|
|
4748
4992
|
if(_1 === "ff:core/Json.bool") {
|
|
4749
4993
|
const _guard1 = arguments_;
|
|
4750
4994
|
if(_guard1.length === 1) {
|
|
4751
4995
|
const e_ = _guard1[0];
|
|
4752
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_))
|
|
4996
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false))
|
|
4753
4997
|
}
|
|
4754
4998
|
}
|
|
4755
4999
|
if(_1 === "ff:core/Json.array") {
|
|
4756
5000
|
const _guard1 = arguments_;
|
|
4757
5001
|
if(_guard1.length === 1) {
|
|
4758
5002
|
const e_ = _guard1[0];
|
|
4759
|
-
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_))
|
|
5003
|
+
return ff_core_Option.Some(ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false))
|
|
4760
5004
|
}
|
|
4761
5005
|
}
|
|
4762
5006
|
if(_1 === "ff:core/Json.null") {
|
|
@@ -4787,7 +5031,7 @@ const _guard1 = arguments_;
|
|
|
4787
5031
|
if(_guard1.length === 2) {
|
|
4788
5032
|
const condition_ = _guard1[0];
|
|
4789
5033
|
const body_ = _guard1[1];
|
|
4790
|
-
return ff_core_Option.Some((((("while(" + ff_compiler_JsEmitter.
|
|
5034
|
+
return ff_core_Option.Some((((("while(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, ff_compiler_JsEmitter.invokeImmediately_(condition_), async_, false)) + ") {\n") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, ff_compiler_JsEmitter.invokeImmediately_(body_), false, false, async_)) + "\n}"))
|
|
4791
5035
|
}
|
|
4792
5036
|
}
|
|
4793
5037
|
if(_1 === "ff:core/Core.doWhile") {
|
|
@@ -4807,7 +5051,7 @@ if(_guard1.length === 2 && _guard1[1].ELambda && _guard1[1].lambda_.cases_.lengt
|
|
|
4807
5051
|
const list_ = _guard1[0];
|
|
4808
5052
|
const name_ = _guard1[1].lambda_.cases_[0].patterns_[0].name_;
|
|
4809
5053
|
const body_ = _guard1[1].lambda_.cases_[0].body_;
|
|
4810
|
-
return ff_core_Option.Some(((((("{\nconst if_o = " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, list_, async_)) + "\nif(if_o.Some) {\n") + ff_core_Option.Option_else(ff_core_Option.Option_map(name_, ((_w1) => {
|
|
5054
|
+
return ff_core_Option.Some(((((("{\nconst if_o = " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, list_, async_, false)) + "\nif(if_o.Some) {\n") + ff_core_Option.Option_else(ff_core_Option.Option_map(name_, ((_w1) => {
|
|
4811
5055
|
return (("const " + ff_compiler_JsEmitter.escapeKeyword_(_w1)) + " = if_o.value_;\n")
|
|
4812
5056
|
})), (() => {
|
|
4813
5057
|
return ""
|
|
@@ -4827,8 +5071,8 @@ const end_ = _guard2[0].arguments_[1];
|
|
|
4827
5071
|
const name_ = _guard2[1].lambda_.cases_[0].patterns_[0].name_;
|
|
4828
5072
|
const body_ = _guard2[1].lambda_.cases_[0].body_;
|
|
4829
5073
|
if(((r_ === "ff:core/Int.Int_until") || (r_ === "ff:core/Int.Int_to"))) {
|
|
4830
|
-
const startCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, start_.value_, async_);
|
|
4831
|
-
const endCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, end_.value_, async_);
|
|
5074
|
+
const startCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, start_.value_, async_, false);
|
|
5075
|
+
const endCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, end_.value_, async_, false);
|
|
4832
5076
|
const op_ = ((r_ === "ff:core/Int.Int_until")
|
|
4833
5077
|
? "<"
|
|
4834
5078
|
: "<=");
|
|
@@ -4854,8 +5098,8 @@ const end_ = _guard2[0].arguments_[0].value_.arguments_[1];
|
|
|
4854
5098
|
const name_ = _guard2[1].lambda_.cases_[0].patterns_[0].name_;
|
|
4855
5099
|
const body_ = _guard2[1].lambda_.cases_[0].body_;
|
|
4856
5100
|
if(((r_ === "ff:core/Int.Int_until") || (r_ === "ff:core/Int.Int_to"))) {
|
|
4857
|
-
const startCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, start_.value_, async_);
|
|
4858
|
-
const endCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, end_.value_, async_);
|
|
5101
|
+
const startCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, start_.value_, async_, false);
|
|
5102
|
+
const endCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, end_.value_, async_, false);
|
|
4859
5103
|
const delta_ = ((r_ === "ff:core/Int.Int_until")
|
|
4860
5104
|
? " - 1"
|
|
4861
5105
|
: "");
|
|
@@ -4957,7 +5201,7 @@ const _guard1 = arguments_;
|
|
|
4957
5201
|
if(_guard1.length === 2) {
|
|
4958
5202
|
const array_ = _guard1[0];
|
|
4959
5203
|
const value_ = _guard1[1];
|
|
4960
|
-
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, array_, async_) + ".array.push(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_)) + ")"))
|
|
5204
|
+
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, array_, async_, false) + ".array.push(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_, false)) + ")"))
|
|
4961
5205
|
}
|
|
4962
5206
|
}
|
|
4963
5207
|
if(_1 === "ff:core/Core.if") {
|
|
@@ -4965,8 +5209,8 @@ const _guard1 = arguments_;
|
|
|
4965
5209
|
if(_guard1.length === 2) {
|
|
4966
5210
|
const condition_ = _guard1[0];
|
|
4967
5211
|
const body_ = _guard1[1];
|
|
4968
|
-
return ff_core_Option.Some(((("if(" + ff_compiler_JsEmitter.
|
|
4969
|
-
? (("return ff_core_Option.Some(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, ff_compiler_JsEmitter.invokeImmediately_(body_), async_)) + ")\n} else return ff_core_Option.None()")
|
|
5212
|
+
return ff_core_Option.Some(((("if(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, condition_, async_, false)) + ") {\n") + (last_
|
|
5213
|
+
? (("return ff_core_Option.Some(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, ff_compiler_JsEmitter.invokeImmediately_(body_), async_, false)) + ")\n} else return ff_core_Option.None()")
|
|
4970
5214
|
: (ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, ff_compiler_JsEmitter.invokeImmediately_(body_), false, false, async_) + "\n}"))))
|
|
4971
5215
|
return
|
|
4972
5216
|
}
|
|
@@ -5022,118 +5266,7 @@ const c_ = _guard2;
|
|
|
5022
5266
|
const _guard1 = c_.arguments_;
|
|
5023
5267
|
if(_guard1.length === 1) {
|
|
5024
5268
|
const argument_ = _guard1[0];
|
|
5025
|
-
return ff_core_Option.Some(("throw " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, argument_.value_, async_)))
|
|
5026
|
-
}
|
|
5027
|
-
}
|
|
5028
|
-
}
|
|
5029
|
-
if(_1 === "ff:core/JsValue.JsValue_set") {
|
|
5030
|
-
const _guard1 = arguments_;
|
|
5031
|
-
if(_guard1.length === 3) {
|
|
5032
|
-
const e1_ = _guard1[0];
|
|
5033
|
-
const e2_ = _guard1[1];
|
|
5034
|
-
const e3_ = _guard1[2];
|
|
5035
|
-
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")) + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_)))
|
|
5036
|
-
}
|
|
5037
|
-
}
|
|
5038
|
-
if(_1 === "ff:core/JsValue.JsValue_increment") {
|
|
5039
|
-
const _guard1 = arguments_;
|
|
5040
|
-
if(_guard1.length === 3) {
|
|
5041
|
-
const e1_ = _guard1[0];
|
|
5042
|
-
const e2_ = _guard1[1];
|
|
5043
|
-
const e3_ = _guard1[2];
|
|
5044
|
-
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")) + " += ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_)))
|
|
5045
|
-
}
|
|
5046
|
-
}
|
|
5047
|
-
if(_1 === "ff:core/JsValue.JsValue_decrement") {
|
|
5048
|
-
const _guard1 = arguments_;
|
|
5049
|
-
if(_guard1.length === 3) {
|
|
5050
|
-
const e1_ = _guard1[0];
|
|
5051
|
-
const e2_ = _guard1[1];
|
|
5052
|
-
const e3_ = _guard1[2];
|
|
5053
|
-
return ff_core_Option.Some((((ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e1_, async_) + ff_compiler_JsEmitter.JsEmitter_emitField(self_, e2_, async_, ".")) + " -= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_)))
|
|
5054
|
-
}
|
|
5055
|
-
}
|
|
5056
|
-
if(_1 === "ff:core/JsSystem.JsSystem_set") {
|
|
5057
|
-
const _guard3 = arguments_;
|
|
5058
|
-
if(_guard3.length === 3 && _guard3[1].EString) {
|
|
5059
|
-
const e1_ = _guard3[0];
|
|
5060
|
-
const q_ = _guard3[1].value_;
|
|
5061
|
-
const e3_ = _guard3[2];
|
|
5062
|
-
const _guard2 = ff_compiler_JsEmitter.noSideEffects_(e1_);
|
|
5063
|
-
if(_guard2) {
|
|
5064
|
-
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
5065
|
-
if(_guard1.Some) {
|
|
5066
|
-
const s_ = _guard1.value_;
|
|
5067
|
-
return ff_core_Option.Some(((s_ + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_)))
|
|
5068
|
-
}
|
|
5069
|
-
}
|
|
5070
|
-
}
|
|
5071
|
-
}
|
|
5072
|
-
if(_1 === "ff:core/JsSystem.JsSystem_increment") {
|
|
5073
|
-
const _guard3 = arguments_;
|
|
5074
|
-
if(_guard3.length === 3 && _guard3[1].EString) {
|
|
5075
|
-
const e1_ = _guard3[0];
|
|
5076
|
-
const q_ = _guard3[1].value_;
|
|
5077
|
-
const e3_ = _guard3[2];
|
|
5078
|
-
const _guard2 = ff_compiler_JsEmitter.noSideEffects_(e1_);
|
|
5079
|
-
if(_guard2) {
|
|
5080
|
-
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
5081
|
-
if(_guard1.Some) {
|
|
5082
|
-
const s_ = _guard1.value_;
|
|
5083
|
-
return ff_core_Option.Some(((s_ + " += ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_)))
|
|
5084
|
-
}
|
|
5085
|
-
}
|
|
5086
|
-
}
|
|
5087
|
-
}
|
|
5088
|
-
if(_1 === "ff:core/JsSystem.JsSystem_decrement") {
|
|
5089
|
-
const _guard3 = arguments_;
|
|
5090
|
-
if(_guard3.length === 3 && _guard3[1].EString) {
|
|
5091
|
-
const e1_ = _guard3[0];
|
|
5092
|
-
const q_ = _guard3[1].value_;
|
|
5093
|
-
const e3_ = _guard3[2];
|
|
5094
|
-
const _guard2 = ff_compiler_JsEmitter.noSideEffects_(e1_);
|
|
5095
|
-
if(_guard2) {
|
|
5096
|
-
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
5097
|
-
if(_guard1.Some) {
|
|
5098
|
-
const s_ = _guard1.value_;
|
|
5099
|
-
return ff_core_Option.Some(((s_ + " -= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e3_, async_)))
|
|
5100
|
-
}
|
|
5101
|
-
}
|
|
5102
|
-
}
|
|
5103
|
-
}
|
|
5104
|
-
if(_1 === "ff:core/Js.set") {
|
|
5105
|
-
const _guard2 = arguments_;
|
|
5106
|
-
if(_guard2.length === 2 && _guard2[0].EString) {
|
|
5107
|
-
const q_ = _guard2[0].value_;
|
|
5108
|
-
const e2_ = _guard2[1];
|
|
5109
|
-
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
5110
|
-
if(_guard1.Some) {
|
|
5111
|
-
const s_ = _guard1.value_;
|
|
5112
|
-
return ff_core_Option.Some(((s_ + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)))
|
|
5113
|
-
}
|
|
5114
|
-
}
|
|
5115
|
-
}
|
|
5116
|
-
if(_1 === "ff:core/Js.increment") {
|
|
5117
|
-
const _guard2 = arguments_;
|
|
5118
|
-
if(_guard2.length === 2 && _guard2[0].EString) {
|
|
5119
|
-
const q_ = _guard2[0].value_;
|
|
5120
|
-
const e2_ = _guard2[1];
|
|
5121
|
-
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
5122
|
-
if(_guard1.Some) {
|
|
5123
|
-
const s_ = _guard1.value_;
|
|
5124
|
-
return ff_core_Option.Some(((s_ + " += ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)))
|
|
5125
|
-
}
|
|
5126
|
-
}
|
|
5127
|
-
}
|
|
5128
|
-
if(_1 === "ff:core/Js.decrement") {
|
|
5129
|
-
const _guard2 = arguments_;
|
|
5130
|
-
if(_guard2.length === 2 && _guard2[0].EString) {
|
|
5131
|
-
const q_ = _guard2[0].value_;
|
|
5132
|
-
const e2_ = _guard2[1];
|
|
5133
|
-
const _guard1 = ff_compiler_JsEmitter.safeBare_(q_);
|
|
5134
|
-
if(_guard1.Some) {
|
|
5135
|
-
const s_ = _guard1.value_;
|
|
5136
|
-
return ff_core_Option.Some(((s_ + " -= ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e2_, async_)))
|
|
5269
|
+
return ff_core_Option.Some(("throw " + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, argument_.value_, async_, false)))
|
|
5137
5270
|
}
|
|
5138
5271
|
}
|
|
5139
5272
|
}
|
|
@@ -5150,18 +5283,18 @@ const listCode_ = (((_1) => {
|
|
|
5150
5283
|
if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/List.List_dropFirst" && _1.arguments_.length === 2) {
|
|
5151
5284
|
const a1_ = _1.arguments_[0];
|
|
5152
5285
|
const a2_ = _1.arguments_[1];
|
|
5153
|
-
start_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_.value_, async_);
|
|
5286
|
+
start_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_.value_, async_, false);
|
|
5154
5287
|
if((!ff_core_String.String_all(start_, ((_w1) => {
|
|
5155
5288
|
return ff_core_Char.Char_isAsciiDigit(_w1)
|
|
5156
5289
|
})))) {
|
|
5157
5290
|
start_ = (("Math.max(" + start_) + ", 0)")
|
|
5158
5291
|
};
|
|
5159
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_.value_, async_)
|
|
5292
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_.value_, async_, false)
|
|
5160
5293
|
}
|
|
5161
5294
|
if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/List.List_dropLast" && _1.arguments_.length === 2) {
|
|
5162
5295
|
const a1_ = _1.arguments_[0];
|
|
5163
5296
|
const a2_ = _1.arguments_[1];
|
|
5164
|
-
const count_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_.value_, async_);
|
|
5297
|
+
const count_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_.value_, async_, false);
|
|
5165
5298
|
if((!ff_core_String.String_all(count_, ((_w1) => {
|
|
5166
5299
|
return ff_core_Char.Char_isAsciiDigit(_w1)
|
|
5167
5300
|
})))) {
|
|
@@ -5169,24 +5302,24 @@ end_ = (((end_ + " - Math.max(") + count_) + ", 0)")
|
|
|
5169
5302
|
} else {
|
|
5170
5303
|
end_ = ((end_ + " - ") + count_)
|
|
5171
5304
|
};
|
|
5172
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_.value_, async_)
|
|
5305
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_.value_, async_, false)
|
|
5173
5306
|
}
|
|
5174
5307
|
if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/List.List_takeFirst" && _1.arguments_.length === 2) {
|
|
5175
5308
|
const a1_ = _1.arguments_[0];
|
|
5176
5309
|
const a2_ = _1.arguments_[1];
|
|
5177
|
-
end_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_.value_, async_);
|
|
5310
|
+
end_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_.value_, async_, false);
|
|
5178
5311
|
if((!ff_core_String.String_all(end_, ((_w1) => {
|
|
5179
5312
|
return ff_core_Char.Char_isAsciiDigit(_w1)
|
|
5180
5313
|
})))) {
|
|
5181
5314
|
end_ = (("Math.max(" + end_) + ", 0)")
|
|
5182
5315
|
};
|
|
5183
5316
|
end_ = (((("Math.min(" + end_) + ", ") + listName_) + ".length)");
|
|
5184
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_.value_, async_)
|
|
5317
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_.value_, async_, false)
|
|
5185
5318
|
}
|
|
5186
5319
|
if(_1.ECall && _1.target_.StaticCall && _1.target_.name_ === "ff:core/List.List_takeLast" && _1.arguments_.length === 2) {
|
|
5187
5320
|
const a1_ = _1.arguments_[0];
|
|
5188
5321
|
const a2_ = _1.arguments_[1];
|
|
5189
|
-
const count_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_.value_, async_);
|
|
5322
|
+
const count_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a2_.value_, async_, false);
|
|
5190
5323
|
if((!ff_core_String.String_all(count_, ((_w1) => {
|
|
5191
5324
|
return ff_core_Char.Char_isAsciiDigit(_w1)
|
|
5192
5325
|
})))) {
|
|
@@ -5194,10 +5327,10 @@ start_ = (((("Math.max(" + listName_) + ".length - Math.max(") + count_) + ", 0)
|
|
|
5194
5327
|
} else {
|
|
5195
5328
|
start_ = (((("Math.max(" + listName_) + ".length - ") + count_) + ", 0)")
|
|
5196
5329
|
};
|
|
5197
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_.value_, async_)
|
|
5330
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, a1_.value_, async_, false)
|
|
5198
5331
|
}
|
|
5199
5332
|
{
|
|
5200
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, list_, async_)
|
|
5333
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, list_, async_, false)
|
|
5201
5334
|
}
|
|
5202
5335
|
}))(list_);
|
|
5203
5336
|
return ff_core_Pair.Pair(listCode_, ff_core_Pair.Pair(start_, end_))
|
|
@@ -5309,7 +5442,7 @@ if(ff_core_List.List_isEmpty(variables_)) {
|
|
|
5309
5442
|
const newCase_ = (((_c) => {
|
|
5310
5443
|
return ff_compiler_Syntax.MatchCase(_c.at_, [], [], _c.body_)
|
|
5311
5444
|
}))(matchCase_);
|
|
5312
|
-
return ff_compiler_JsEmitter.JsEmitter_emitCase(self_, [], newCase_, [...conditions_, ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_)], [], jump_, last_, break_, lastCase_, async_)
|
|
5445
|
+
return ff_compiler_JsEmitter.JsEmitter_emitCase(self_, [], newCase_, [...conditions_, ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false)], [], jump_, last_, break_, lastCase_, async_)
|
|
5313
5446
|
}
|
|
5314
5447
|
}
|
|
5315
5448
|
if(_1.first_.length === 0 && _1.second_.length === 1 && _1.second_[0].pattern_.PVariant && _1.second_[0].pattern_.name_ === "ff:core/Bool.True") {
|
|
@@ -5317,7 +5450,7 @@ const e_ = _1.second_[0].term_;
|
|
|
5317
5450
|
const newCase_ = (((_c) => {
|
|
5318
5451
|
return ff_compiler_Syntax.MatchCase(_c.at_, [], [], _c.body_)
|
|
5319
5452
|
}))(matchCase_);
|
|
5320
|
-
const code_ = ff_compiler_JsEmitter.JsEmitter_emitCase(self_, [], newCase_, [ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_)], [], jump_, last_, break_, lastCase_, async_);
|
|
5453
|
+
const code_ = ff_compiler_JsEmitter.JsEmitter_emitCase(self_, [], newCase_, [ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, e_, async_, false)], [], jump_, last_, break_, lastCase_, async_);
|
|
5321
5454
|
return emitWrapper_(code_)
|
|
5322
5455
|
}
|
|
5323
5456
|
if(_1.first_.length === 0 && _1.second_.length >= 1) {
|
|
@@ -5327,7 +5460,7 @@ const guardName_ = ("_guard" + (guards_.length + 1));
|
|
|
5327
5460
|
const newCase_ = (((_c) => {
|
|
5328
5461
|
return ff_compiler_Syntax.MatchCase(_c.at_, [guard_.pattern_], guards_, _c.body_)
|
|
5329
5462
|
}))(matchCase_);
|
|
5330
|
-
const code_ = ((((("const " + guardName_) + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, guard_.term_, async_)) + ";\n") + ff_compiler_JsEmitter.JsEmitter_emitCase(self_, [guardName_], newCase_, [], [], jump_, last_, break_, lastCase_, async_));
|
|
5463
|
+
const code_ = ((((("const " + guardName_) + " = ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, guard_.term_, async_, false)) + ";\n") + ff_compiler_JsEmitter.JsEmitter_emitCase(self_, [guardName_], newCase_, [], [], jump_, last_, break_, lastCase_, async_));
|
|
5331
5464
|
return emitWrapper_(code_)
|
|
5332
5465
|
}
|
|
5333
5466
|
{
|
|
@@ -5482,11 +5615,11 @@ export async function JsEmitter_emitList$(self_, items_, async_, $task) {
|
|
|
5482
5615
|
return (("[" + ff_core_List.List_join(ff_core_List.List_map(items_, ((_1) => {
|
|
5483
5616
|
if(!_1.second_) {
|
|
5484
5617
|
const item_ = _1.first_;
|
|
5485
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, item_, async_)
|
|
5618
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, item_, async_, false)
|
|
5486
5619
|
}
|
|
5487
5620
|
{
|
|
5488
5621
|
const item_ = _1.first_;
|
|
5489
|
-
return ("..." + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, item_, async_))
|
|
5622
|
+
return ("..." + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, item_, async_, false))
|
|
5490
5623
|
}
|
|
5491
5624
|
})), ", ")) + "]")
|
|
5492
5625
|
}
|
|
@@ -5552,40 +5685,7 @@ return (((((((((("\"" + self_.moduleName_) + ":") + callAt_.line_) + ":") + call
|
|
|
5552
5685
|
}
|
|
5553
5686
|
{
|
|
5554
5687
|
const value_ = _1;
|
|
5555
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_)
|
|
5556
|
-
}
|
|
5557
|
-
}
|
|
5558
|
-
}
|
|
5559
|
-
|
|
5560
|
-
export async function JsEmitter_emitComma$(self_, term_, async_, $task) {
|
|
5561
|
-
{
|
|
5562
|
-
const _1 = term_;
|
|
5563
|
-
if(_1.ESequential && _1.before_.ESequential && _1.before_.before_.ESequential) {
|
|
5564
|
-
const before1_ = _1.before_.before_.before_;
|
|
5565
|
-
const before2_ = _1.before_.before_.after_;
|
|
5566
|
-
const before3_ = _1.before_.after_;
|
|
5567
|
-
const after_ = _1.after_;
|
|
5568
|
-
if((((ff_compiler_JsEmitter.safeCommable_(before1_) && ff_compiler_JsEmitter.safeCommable_(before2_)) && ff_compiler_JsEmitter.safeCommable_(before3_)) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
5569
|
-
return (((((((("(" + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before1_, false, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before2_, false, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before3_, false, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, after_, async_)) + ")")
|
|
5570
|
-
}
|
|
5571
|
-
}
|
|
5572
|
-
if(_1.ESequential && _1.before_.ESequential) {
|
|
5573
|
-
const before1_ = _1.before_.before_;
|
|
5574
|
-
const before2_ = _1.before_.after_;
|
|
5575
|
-
const after_ = _1.after_;
|
|
5576
|
-
if(((ff_compiler_JsEmitter.safeCommable_(before1_) && ff_compiler_JsEmitter.safeCommable_(before2_)) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
5577
|
-
return (((((("(" + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before1_, false, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before2_, false, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, after_, async_)) + ")")
|
|
5578
|
-
}
|
|
5579
|
-
}
|
|
5580
|
-
if(_1.ESequential) {
|
|
5581
|
-
const before_ = _1.before_;
|
|
5582
|
-
const after_ = _1.after_;
|
|
5583
|
-
if((ff_compiler_JsEmitter.safeCommable_(before_) && ff_compiler_JsEmitter.safeCommable_(after_))) {
|
|
5584
|
-
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitStatements(self_, before_, false, false, async_)) + ", ") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, after_, async_)) + ")")
|
|
5585
|
-
}
|
|
5586
|
-
}
|
|
5587
|
-
{
|
|
5588
|
-
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, term_, async_)
|
|
5688
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_, false)
|
|
5589
5689
|
}
|
|
5590
5690
|
}
|
|
5591
5691
|
}
|