firefly-compiler 0.4.4 → 0.4.5
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/.hintrc +5 -0
- package/README.md +42 -61
- package/compiler/Compiler.ff +6 -2
- package/compiler/Deriver.ff +10 -0
- package/compiler/Environment.ff +2 -1
- package/compiler/JsEmitter.ff +29 -17
- package/compiler/Resolver.ff +1 -1
- package/core/.firefly/package.ff +1 -2
- package/core/Box.ff +7 -0
- package/core/BuildSystem.ff +5 -4
- package/core/Core.ff +4 -0
- package/core/JsValue.ff +22 -1
- package/core/Lock.ff +4 -4
- package/core/NodeSystem.ff +12 -3
- package/core/Path.ff +1 -1
- package/core/SourceLocation.ff +41 -0
- package/core/Stack.ff +6 -6
- package/core/StringMap.ff +3 -3
- package/lux/.firefly/package.ff +2 -0
- package/lux/Lux.ff +473 -0
- package/lux/LuxEvent.ff +116 -0
- package/lux/Main.ff +72 -0
- package/lux/Main2.ff +144 -0
- package/output/js/ff/compiler/Builder.mjs +4 -0
- package/output/js/ff/compiler/Compiler.mjs +11 -5
- package/output/js/ff/compiler/Dependencies.mjs +4 -0
- package/output/js/ff/compiler/Deriver.mjs +8 -4
- package/output/js/ff/compiler/Dictionaries.mjs +4 -0
- package/output/js/ff/compiler/Environment.mjs +12 -2
- package/output/js/ff/compiler/Inference.mjs +4 -0
- package/output/js/ff/compiler/JsEmitter.mjs +78 -40
- package/output/js/ff/compiler/JsImporter.mjs +4 -0
- package/output/js/ff/compiler/LspHook.mjs +4 -0
- package/output/js/ff/compiler/Main.mjs +28 -24
- package/output/js/ff/compiler/Parser.mjs +4 -0
- package/output/js/ff/compiler/Patterns.mjs +4 -0
- package/output/js/ff/compiler/Resolver.mjs +6 -2
- package/output/js/ff/compiler/Substitution.mjs +4 -0
- package/output/js/ff/compiler/Syntax.mjs +4 -0
- package/output/js/ff/compiler/Token.mjs +4 -0
- package/output/js/ff/compiler/Tokenizer.mjs +4 -0
- package/output/js/ff/compiler/Unification.mjs +4 -0
- package/output/js/ff/compiler/Wildcards.mjs +4 -0
- package/output/js/ff/compiler/Workspace.mjs +4 -0
- package/output/js/ff/core/Any.mjs +4 -0
- package/output/js/ff/core/Array.mjs +4 -0
- package/output/js/ff/core/AssetSystem.mjs +4 -0
- package/output/js/ff/core/Atomic.mjs +4 -0
- package/output/js/ff/core/Bool.mjs +12 -1
- package/output/js/ff/core/Box.mjs +112 -0
- package/output/js/ff/core/BrowserSystem.mjs +4 -0
- package/output/js/ff/core/Buffer.mjs +4 -0
- package/output/js/ff/core/BuildSystem.mjs +14 -8
- package/output/js/ff/core/Channel.mjs +4 -0
- package/output/js/ff/core/Char.mjs +4 -0
- package/output/js/ff/core/Core.mjs +12 -0
- package/output/js/ff/core/Duration.mjs +4 -0
- package/output/js/ff/core/Equal.mjs +4 -0
- package/output/js/ff/core/Error.mjs +4 -0
- package/output/js/ff/core/FileHandle.mjs +4 -0
- package/output/js/ff/core/Float.mjs +12 -1
- package/output/js/ff/core/HttpClient.mjs +4 -0
- package/output/js/ff/core/Instant.mjs +4 -0
- package/output/js/ff/core/Int.mjs +12 -1
- package/output/js/ff/core/IntMap.mjs +4 -0
- package/output/js/ff/core/JsSystem.mjs +4 -0
- package/output/js/ff/core/JsValue.mjs +50 -0
- package/output/js/ff/core/List.mjs +13 -0
- package/output/js/ff/core/Lock.mjs +11 -7
- package/output/js/ff/core/Log.mjs +4 -0
- package/output/js/ff/core/Map.mjs +4 -0
- package/output/js/ff/core/NodeSystem.mjs +33 -14
- package/output/js/ff/core/Nothing.mjs +4 -0
- package/output/js/ff/core/Option.mjs +13 -0
- package/output/js/ff/core/Ordering.mjs +4 -0
- package/output/js/ff/core/Pair.mjs +13 -0
- package/output/js/ff/core/Path.mjs +5 -1
- package/output/js/ff/core/RbMap.mjs +24 -20
- package/output/js/ff/core/Serializable.mjs +4 -0
- package/output/js/ff/core/Set.mjs +4 -0
- package/output/js/ff/core/Show.mjs +4 -0
- package/output/js/ff/core/SourceLocation.mjs +229 -0
- package/output/js/ff/core/Stack.mjs +10 -6
- package/output/js/ff/core/Stream.mjs +4 -0
- package/output/js/ff/core/String.mjs +12 -1
- package/output/js/ff/core/StringMap.mjs +5 -1
- package/output/js/ff/core/Task.mjs +4 -0
- package/output/js/ff/core/Try.mjs +4 -0
- package/output/js/ff/core/Unit.mjs +49 -1
- package/package.json +1 -1
|
@@ -18,6 +18,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
18
18
|
|
|
19
19
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
20
20
|
|
|
21
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
22
|
+
|
|
21
23
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
22
24
|
|
|
23
25
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -78,6 +80,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
78
80
|
|
|
79
81
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
80
82
|
|
|
83
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
84
|
+
|
|
81
85
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
82
86
|
|
|
83
87
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
@@ -93,8 +97,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
93
97
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
94
98
|
|
|
95
99
|
// type JsEmitter
|
|
96
|
-
export function JsEmitter(otherModules_, jsImporter_, emitTarget_, isMainModule_, compilerModulePath_, emittingAsync_, tailCallUsed_) {
|
|
97
|
-
return {otherModules_, jsImporter_, emitTarget_, isMainModule_, compilerModulePath_, emittingAsync_, tailCallUsed_};
|
|
100
|
+
export function JsEmitter(otherModules_, jsImporter_, emitTarget_, isMainModule_, compilerModulePath_, packagePair_, moduleName_, emittingAsync_, tailCallUsed_) {
|
|
101
|
+
return {otherModules_, jsImporter_, emitTarget_, isMainModule_, compilerModulePath_, packagePair_, moduleName_, emittingAsync_, tailCallUsed_};
|
|
98
102
|
}
|
|
99
103
|
|
|
100
104
|
// type EmitTarget
|
|
@@ -122,11 +126,11 @@ return {variantName_, newtype_, loneVariant_, arguments_};
|
|
|
122
126
|
|
|
123
127
|
export const primitiveTypes_ = ff_core_List.List_toSet(ff_core_List.Link("ff:core/Bool.Bool", ff_core_List.Link("ff:core/Char.Char", ff_core_List.Link("ff:core/Int.Int", ff_core_List.Link("ff:core/Float.Float", ff_core_List.Link("ff:core/String.String", ff_core_List.Empty()))))), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
124
128
|
|
|
125
|
-
export function make_(otherModules_, emitTarget_, isMainModule_, compilerModulePath_) {
|
|
129
|
+
export function make_(otherModules_, emitTarget_, isMainModule_, compilerModulePath_, packagePair_, moduleName_) {
|
|
126
130
|
return ff_compiler_JsEmitter.JsEmitter(ff_core_List.List_toMap(ff_core_List.List_map(otherModules_, ((m_) => {
|
|
127
131
|
const moduleName_ = ((ff_compiler_Syntax.PackagePair_groupName(m_.packagePair_, ":") + "/") + ff_core_String.String_dropLast(m_.file_, 3));
|
|
128
132
|
return ff_core_Pair.Pair(moduleName_, m_)
|
|
129
|
-
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_JsImporter.make_(), emitTarget_, isMainModule_, compilerModulePath_, false, false)
|
|
133
|
+
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_JsImporter.make_(), emitTarget_, isMainModule_, compilerModulePath_, packagePair_, moduleName_, false, false)
|
|
130
134
|
}
|
|
131
135
|
|
|
132
136
|
export function fail_(at_, message_) {
|
|
@@ -361,11 +365,11 @@ return
|
|
|
361
365
|
}
|
|
362
366
|
}
|
|
363
367
|
|
|
364
|
-
export async function make_$(otherModules_, emitTarget_, isMainModule_, compilerModulePath_, $task) {
|
|
368
|
+
export async function make_$(otherModules_, emitTarget_, isMainModule_, compilerModulePath_, packagePair_, moduleName_, $task) {
|
|
365
369
|
return ff_compiler_JsEmitter.JsEmitter(ff_core_List.List_toMap(ff_core_List.List_map(otherModules_, ((m_) => {
|
|
366
370
|
const moduleName_ = ((ff_compiler_Syntax.PackagePair_groupName(m_.packagePair_, ":") + "/") + ff_core_String.String_dropLast(m_.file_, 3));
|
|
367
371
|
return ff_core_Pair.Pair(moduleName_, m_)
|
|
368
|
-
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_JsImporter.make_(), emitTarget_, isMainModule_, compilerModulePath_, false, false)
|
|
372
|
+
})), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_JsImporter.make_(), emitTarget_, isMainModule_, compilerModulePath_, packagePair_, moduleName_, false, false)
|
|
369
373
|
}
|
|
370
374
|
|
|
371
375
|
export async function fail_$(at_, message_, $task) {
|
|
@@ -1054,7 +1058,7 @@ const at_ = _1.at_;
|
|
|
1054
1058
|
const name_ = _1.name_;
|
|
1055
1059
|
const arguments_ = _1.arguments_;
|
|
1056
1060
|
const argumentsString_ = ff_core_List.List_join(ff_core_List.List_map(ff_core_List.List_flatten(ff_core_Option.Option_toList(arguments_)), ((_w1) => {
|
|
1057
|
-
return ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, _w1, async_)
|
|
1061
|
+
return ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, _w1, async_)
|
|
1058
1062
|
})), ", ");
|
|
1059
1063
|
const newtype_ = ff_compiler_JsEmitter.JsEmitter_processVariant(self_, name_);
|
|
1060
1064
|
if(newtype_) {
|
|
@@ -1241,7 +1245,7 @@ const value_ = _1.arguments_.head_;
|
|
|
1241
1245
|
if(_1.arguments_.tail_.Empty) {
|
|
1242
1246
|
const _guard1 = (!ff_core_Char.Char_isAsciiLetter(ff_core_String.String_grabFirst(operator_)));
|
|
1243
1247
|
if(_guard1) {
|
|
1244
|
-
return ((("(" + operator_) + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, value_, async_)) + ")")
|
|
1248
|
+
return ((("(" + operator_) + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, value_, async_)) + ")")
|
|
1245
1249
|
return
|
|
1246
1250
|
}
|
|
1247
1251
|
}
|
|
@@ -1263,7 +1267,7 @@ const right_ = _1.arguments_.tail_.head_;
|
|
|
1263
1267
|
if(_1.arguments_.tail_.tail_.Empty) {
|
|
1264
1268
|
const _guard1 = (!ff_core_Char.Char_isAsciiLetter(ff_core_String.String_grabFirst(operator_)));
|
|
1265
1269
|
if(_guard1) {
|
|
1266
|
-
return (((((("(" + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, left_, async_)) + " ") + operator_) + " ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, right_, async_)) + ")")
|
|
1270
|
+
return (((((("(" + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, left_, async_)) + " ") + operator_) + " ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, right_, async_)) + ")")
|
|
1267
1271
|
return
|
|
1268
1272
|
}
|
|
1269
1273
|
}
|
|
@@ -1362,7 +1366,7 @@ if(_1.dictionaries_.head_.dictionaries_.Empty) {
|
|
|
1362
1366
|
if(_1.dictionaries_.tail_.Empty) {
|
|
1363
1367
|
const _guard1 = (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"));
|
|
1364
1368
|
if(_guard1) {
|
|
1365
|
-
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, left_, async_)) + " === ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, right_, async_)) + ")")
|
|
1369
|
+
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, left_, async_)) + " === ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, right_, async_)) + ")")
|
|
1366
1370
|
return
|
|
1367
1371
|
}
|
|
1368
1372
|
}
|
|
@@ -1391,7 +1395,7 @@ if(_1.dictionaries_.head_.dictionaries_.Empty) {
|
|
|
1391
1395
|
if(_1.dictionaries_.tail_.Empty) {
|
|
1392
1396
|
const _guard1 = (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"));
|
|
1393
1397
|
if(_guard1) {
|
|
1394
|
-
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, left_, async_)) + " !== ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, right_, async_)) + ")")
|
|
1398
|
+
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, left_, async_)) + " !== ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, right_, async_)) + ")")
|
|
1395
1399
|
return
|
|
1396
1400
|
}
|
|
1397
1401
|
}
|
|
@@ -1420,7 +1424,7 @@ if(_1.dictionaries_.head_.dictionaries_.Empty) {
|
|
|
1420
1424
|
if(_1.dictionaries_.tail_.Empty) {
|
|
1421
1425
|
const _guard1 = ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
1422
1426
|
if(_guard1) {
|
|
1423
|
-
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, left_, async_)) + " < ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, right_, async_)) + ")")
|
|
1427
|
+
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, left_, async_)) + " < ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, right_, async_)) + ")")
|
|
1424
1428
|
return
|
|
1425
1429
|
}
|
|
1426
1430
|
}
|
|
@@ -1449,7 +1453,7 @@ if(_1.dictionaries_.head_.dictionaries_.Empty) {
|
|
|
1449
1453
|
if(_1.dictionaries_.tail_.Empty) {
|
|
1450
1454
|
const _guard1 = ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
1451
1455
|
if(_guard1) {
|
|
1452
|
-
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, left_, async_)) + " >= ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, right_, async_)) + ")")
|
|
1456
|
+
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, left_, async_)) + " >= ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, right_, async_)) + ")")
|
|
1453
1457
|
return
|
|
1454
1458
|
}
|
|
1455
1459
|
}
|
|
@@ -1478,7 +1482,7 @@ if(_1.dictionaries_.head_.dictionaries_.Empty) {
|
|
|
1478
1482
|
if(_1.dictionaries_.tail_.Empty) {
|
|
1479
1483
|
const _guard1 = ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
1480
1484
|
if(_guard1) {
|
|
1481
|
-
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, left_, async_)) + " > ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, right_, async_)) + ")")
|
|
1485
|
+
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, left_, async_)) + " > ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, right_, async_)) + ")")
|
|
1482
1486
|
return
|
|
1483
1487
|
}
|
|
1484
1488
|
}
|
|
@@ -1507,7 +1511,7 @@ if(_1.dictionaries_.head_.dictionaries_.Empty) {
|
|
|
1507
1511
|
if(_1.dictionaries_.tail_.Empty) {
|
|
1508
1512
|
const _guard1 = ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
1509
1513
|
if(_guard1) {
|
|
1510
|
-
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, left_, async_)) + " <= ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, right_, async_)) + ")")
|
|
1514
|
+
return (((("(" + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, left_, async_)) + " <= ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, right_, async_)) + ")")
|
|
1511
1515
|
return
|
|
1512
1516
|
}
|
|
1513
1517
|
}
|
|
@@ -1548,7 +1552,7 @@ return ff_compiler_JsEmitter.escapeResolved_(_w1)
|
|
|
1548
1552
|
})), (() => {
|
|
1549
1553
|
return "i"
|
|
1550
1554
|
}));
|
|
1551
|
-
return ((((((((((((((((("((() => {\n" + "const size = ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, size_, async_)) + ";\n") + "const result = [];\n") + "for(let ") + n_) + " = 0; ") + n_) + " < size; ") + n_) + "++) {\n") + "result.push(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_)) + ");\n") + "}\n") + "return result;\n") + "})())")
|
|
1555
|
+
return ((((((((((((((((("((() => {\n" + "const size = ") + ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, size_, async_)) + ";\n") + "const result = [];\n") + "for(let ") + n_) + " = 0; ") + n_) + " < size; ") + n_) + "++) {\n") + "result.push(") + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_)) + ");\n") + "}\n") + "return result;\n") + "})())")
|
|
1552
1556
|
return
|
|
1553
1557
|
}
|
|
1554
1558
|
}
|
|
@@ -1588,7 +1592,7 @@ const n_ = (ff_compiler_JsEmitter.escapeKeyword_(ff_core_String.String_reverse(f
|
|
|
1588
1592
|
return (_w1 !== 46)
|
|
1589
1593
|
})))) + asyncSuffix_);
|
|
1590
1594
|
const emittedArguments_ = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
1591
|
-
return ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, _w1, async_)
|
|
1595
|
+
return ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, _w1, async_)
|
|
1592
1596
|
}));
|
|
1593
1597
|
const controller_ = (await_
|
|
1594
1598
|
? ff_core_List.Link("$task", ff_core_List.Empty())
|
|
@@ -1625,7 +1629,7 @@ const functionCode_ = (ff_compiler_JsEmitter.escapeResolved_(name_) + (await_
|
|
|
1625
1629
|
? "$"
|
|
1626
1630
|
: ""));
|
|
1627
1631
|
const emittedArguments_ = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
1628
|
-
return ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, _w1, async_)
|
|
1632
|
+
return ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, _w1, async_)
|
|
1629
1633
|
}));
|
|
1630
1634
|
const controller_ = (await_
|
|
1631
1635
|
? ff_core_List.Link("$task", ff_core_List.Empty())
|
|
@@ -1692,7 +1696,7 @@ ff_compiler_JsEmitter.fail_(at_, "Internal error: Dictionaries in lambda call")
|
|
|
1692
1696
|
};
|
|
1693
1697
|
const functionCode_ = ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, function_, async_);
|
|
1694
1698
|
const emittedArguments_ = ff_core_List.List_map(arguments_, ((_w1) => {
|
|
1695
|
-
return ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, _w1, async_)
|
|
1699
|
+
return ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, _w1, async_)
|
|
1696
1700
|
}));
|
|
1697
1701
|
const controller_ = (await_
|
|
1698
1702
|
? ff_core_List.Link("$task", ff_core_List.Empty())
|
|
@@ -1904,7 +1908,7 @@ const doWhileBody_ = _1.arguments_.head_.value_;
|
|
|
1904
1908
|
if(_1.arguments_.tail_.Empty) {
|
|
1905
1909
|
const _guard1 = ff_compiler_JsEmitter.invokeImmediately_(doWhileBody_);
|
|
1906
1910
|
const body_ = _guard1;
|
|
1907
|
-
return (("while(
|
|
1911
|
+
return (("while(" + ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, body_, async_)) + ") {}")
|
|
1908
1912
|
return
|
|
1909
1913
|
}
|
|
1910
1914
|
}
|
|
@@ -1945,7 +1949,7 @@ if(_1.dictionaries_.Link) {
|
|
|
1945
1949
|
const dictionary_ = _1.dictionaries_.head_;
|
|
1946
1950
|
if(_1.dictionaries_.tail_.Empty) {
|
|
1947
1951
|
const d_ = ff_compiler_JsEmitter.JsEmitter_emitDictionary(self_, dictionary_);
|
|
1948
|
-
const a_ = ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, argument_, async_);
|
|
1952
|
+
const a_ = ff_compiler_JsEmitter.JsEmitter_emitArgument(self_, at_, argument_, async_);
|
|
1949
1953
|
return (((("throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(" + a_) + ", ") + d_) + ")})")
|
|
1950
1954
|
return
|
|
1951
1955
|
}
|
|
@@ -2674,8 +2678,25 @@ newtype_ = definition_.newtype_
|
|
|
2674
2678
|
return newtype_
|
|
2675
2679
|
}
|
|
2676
2680
|
|
|
2677
|
-
export function JsEmitter_emitArgument(self_, argument_, async_) {
|
|
2678
|
-
|
|
2681
|
+
export function JsEmitter_emitArgument(self_, callAt_, argument_, async_) {
|
|
2682
|
+
{
|
|
2683
|
+
const _1 = argument_.value_;
|
|
2684
|
+
{
|
|
2685
|
+
if(_1.ECall) {
|
|
2686
|
+
if(_1.target_.StaticCall) {
|
|
2687
|
+
if(_1.target_.name_ == "ff:core/SourceLocation.callSite") {
|
|
2688
|
+
return (((((((((("\"" + self_.moduleName_) + ":") + callAt_.line_) + ":") + callAt_.column_) + ",") + self_.packagePair_.group_) + ",") + self_.packagePair_.name_) + "\"")
|
|
2689
|
+
return
|
|
2690
|
+
}
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
{
|
|
2695
|
+
const value_ = _1;
|
|
2696
|
+
return ff_compiler_JsEmitter.JsEmitter_emitTerm(self_, value_, async_)
|
|
2697
|
+
return
|
|
2698
|
+
}
|
|
2699
|
+
}
|
|
2679
2700
|
}
|
|
2680
2701
|
|
|
2681
2702
|
export async function JsEmitter_emitModule$(self_, packagePair_, module_, $task) {
|
|
@@ -3132,7 +3153,7 @@ const at_ = _1.at_;
|
|
|
3132
3153
|
const name_ = _1.name_;
|
|
3133
3154
|
const arguments_ = _1.arguments_;
|
|
3134
3155
|
const argumentsString_ = ff_core_List.List_join((await ff_core_List.List_map$(ff_core_List.List_flatten(ff_core_Option.Option_toList(arguments_)), (async (_w1, $task) => {
|
|
3135
|
-
return (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, _w1, async_, $task))
|
|
3156
|
+
return (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, _w1, async_, $task))
|
|
3136
3157
|
}), $task)), ", ");
|
|
3137
3158
|
const newtype_ = (await ff_compiler_JsEmitter.JsEmitter_processVariant$(self_, name_, $task));
|
|
3138
3159
|
if(newtype_) {
|
|
@@ -3319,7 +3340,7 @@ const value_ = _1.arguments_.head_;
|
|
|
3319
3340
|
if(_1.arguments_.tail_.Empty) {
|
|
3320
3341
|
const _guard1 = (!ff_core_Char.Char_isAsciiLetter(ff_core_String.String_grabFirst(operator_)));
|
|
3321
3342
|
if(_guard1) {
|
|
3322
|
-
return ((("(" + operator_) + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, value_, async_, $task))) + ")")
|
|
3343
|
+
return ((("(" + operator_) + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, value_, async_, $task))) + ")")
|
|
3323
3344
|
return
|
|
3324
3345
|
}
|
|
3325
3346
|
}
|
|
@@ -3341,7 +3362,7 @@ const right_ = _1.arguments_.tail_.head_;
|
|
|
3341
3362
|
if(_1.arguments_.tail_.tail_.Empty) {
|
|
3342
3363
|
const _guard1 = (!ff_core_Char.Char_isAsciiLetter(ff_core_String.String_grabFirst(operator_)));
|
|
3343
3364
|
if(_guard1) {
|
|
3344
|
-
return (((((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, left_, async_, $task))) + " ") + operator_) + " ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, right_, async_, $task))) + ")")
|
|
3365
|
+
return (((((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, left_, async_, $task))) + " ") + operator_) + " ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, right_, async_, $task))) + ")")
|
|
3345
3366
|
return
|
|
3346
3367
|
}
|
|
3347
3368
|
}
|
|
@@ -3440,7 +3461,7 @@ if(_1.dictionaries_.head_.dictionaries_.Empty) {
|
|
|
3440
3461
|
if(_1.dictionaries_.tail_.Empty) {
|
|
3441
3462
|
const _guard1 = (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"));
|
|
3442
3463
|
if(_guard1) {
|
|
3443
|
-
return (((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, left_, async_, $task))) + " === ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, right_, async_, $task))) + ")")
|
|
3464
|
+
return (((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, left_, async_, $task))) + " === ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, right_, async_, $task))) + ")")
|
|
3444
3465
|
return
|
|
3445
3466
|
}
|
|
3446
3467
|
}
|
|
@@ -3469,7 +3490,7 @@ if(_1.dictionaries_.head_.dictionaries_.Empty) {
|
|
|
3469
3490
|
if(_1.dictionaries_.tail_.Empty) {
|
|
3470
3491
|
const _guard1 = (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"));
|
|
3471
3492
|
if(_guard1) {
|
|
3472
|
-
return (((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, left_, async_, $task))) + " !== ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, right_, async_, $task))) + ")")
|
|
3493
|
+
return (((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, left_, async_, $task))) + " !== ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, right_, async_, $task))) + ")")
|
|
3473
3494
|
return
|
|
3474
3495
|
}
|
|
3475
3496
|
}
|
|
@@ -3498,7 +3519,7 @@ if(_1.dictionaries_.head_.dictionaries_.Empty) {
|
|
|
3498
3519
|
if(_1.dictionaries_.tail_.Empty) {
|
|
3499
3520
|
const _guard1 = ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
3500
3521
|
if(_guard1) {
|
|
3501
|
-
return (((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, left_, async_, $task))) + " < ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, right_, async_, $task))) + ")")
|
|
3522
|
+
return (((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, left_, async_, $task))) + " < ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, right_, async_, $task))) + ")")
|
|
3502
3523
|
return
|
|
3503
3524
|
}
|
|
3504
3525
|
}
|
|
@@ -3527,7 +3548,7 @@ if(_1.dictionaries_.head_.dictionaries_.Empty) {
|
|
|
3527
3548
|
if(_1.dictionaries_.tail_.Empty) {
|
|
3528
3549
|
const _guard1 = ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
3529
3550
|
if(_guard1) {
|
|
3530
|
-
return (((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, left_, async_, $task))) + " >= ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, right_, async_, $task))) + ")")
|
|
3551
|
+
return (((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, left_, async_, $task))) + " >= ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, right_, async_, $task))) + ")")
|
|
3531
3552
|
return
|
|
3532
3553
|
}
|
|
3533
3554
|
}
|
|
@@ -3556,7 +3577,7 @@ if(_1.dictionaries_.head_.dictionaries_.Empty) {
|
|
|
3556
3577
|
if(_1.dictionaries_.tail_.Empty) {
|
|
3557
3578
|
const _guard1 = ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
3558
3579
|
if(_guard1) {
|
|
3559
|
-
return (((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, left_, async_, $task))) + " > ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, right_, async_, $task))) + ")")
|
|
3580
|
+
return (((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, left_, async_, $task))) + " > ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, right_, async_, $task))) + ")")
|
|
3560
3581
|
return
|
|
3561
3582
|
}
|
|
3562
3583
|
}
|
|
@@ -3585,7 +3606,7 @@ if(_1.dictionaries_.head_.dictionaries_.Empty) {
|
|
|
3585
3606
|
if(_1.dictionaries_.tail_.Empty) {
|
|
3586
3607
|
const _guard1 = ff_core_Set.Set_contains(ff_compiler_JsEmitter.primitiveTypes_, typeName_, ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String);
|
|
3587
3608
|
if(_guard1) {
|
|
3588
|
-
return (((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, left_, async_, $task))) + " <= ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, right_, async_, $task))) + ")")
|
|
3609
|
+
return (((("(" + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, left_, async_, $task))) + " <= ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, right_, async_, $task))) + ")")
|
|
3589
3610
|
return
|
|
3590
3611
|
}
|
|
3591
3612
|
}
|
|
@@ -3626,7 +3647,7 @@ return ff_compiler_JsEmitter.escapeResolved_(_w1)
|
|
|
3626
3647
|
})), (() => {
|
|
3627
3648
|
return "i"
|
|
3628
3649
|
}));
|
|
3629
|
-
return ((((((((((((((((("((() => {\n" + "const size = ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, size_, async_, $task))) + ";\n") + "const result = [];\n") + "for(let ") + n_) + " = 0; ") + n_) + " < size; ") + n_) + "++) {\n") + "result.push(") + (await ff_compiler_JsEmitter.JsEmitter_emitTerm$(self_, body_, async_, $task))) + ");\n") + "}\n") + "return result;\n") + "})())")
|
|
3650
|
+
return ((((((((((((((((("((() => {\n" + "const size = ") + (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, size_, async_, $task))) + ";\n") + "const result = [];\n") + "for(let ") + n_) + " = 0; ") + n_) + " < size; ") + n_) + "++) {\n") + "result.push(") + (await ff_compiler_JsEmitter.JsEmitter_emitTerm$(self_, body_, async_, $task))) + ");\n") + "}\n") + "return result;\n") + "})())")
|
|
3630
3651
|
return
|
|
3631
3652
|
}
|
|
3632
3653
|
}
|
|
@@ -3666,7 +3687,7 @@ const n_ = (ff_compiler_JsEmitter.escapeKeyword_(ff_core_String.String_reverse(f
|
|
|
3666
3687
|
return (_w1 !== 46)
|
|
3667
3688
|
})))) + asyncSuffix_);
|
|
3668
3689
|
const emittedArguments_ = (await ff_core_List.List_map$(arguments_, (async (_w1, $task) => {
|
|
3669
|
-
return (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, _w1, async_, $task))
|
|
3690
|
+
return (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, _w1, async_, $task))
|
|
3670
3691
|
}), $task));
|
|
3671
3692
|
const controller_ = (await_
|
|
3672
3693
|
? ff_core_List.Link("$task", ff_core_List.Empty())
|
|
@@ -3703,7 +3724,7 @@ const functionCode_ = (ff_compiler_JsEmitter.escapeResolved_(name_) + (await_
|
|
|
3703
3724
|
? "$"
|
|
3704
3725
|
: ""));
|
|
3705
3726
|
const emittedArguments_ = (await ff_core_List.List_map$(arguments_, (async (_w1, $task) => {
|
|
3706
|
-
return (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, _w1, async_, $task))
|
|
3727
|
+
return (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, _w1, async_, $task))
|
|
3707
3728
|
}), $task));
|
|
3708
3729
|
const controller_ = (await_
|
|
3709
3730
|
? ff_core_List.Link("$task", ff_core_List.Empty())
|
|
@@ -3770,7 +3791,7 @@ ff_compiler_JsEmitter.fail_(at_, "Internal error: Dictionaries in lambda call")
|
|
|
3770
3791
|
};
|
|
3771
3792
|
const functionCode_ = (await ff_compiler_JsEmitter.JsEmitter_emitTerm$(self_, function_, async_, $task));
|
|
3772
3793
|
const emittedArguments_ = (await ff_core_List.List_map$(arguments_, (async (_w1, $task) => {
|
|
3773
|
-
return (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, _w1, async_, $task))
|
|
3794
|
+
return (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, _w1, async_, $task))
|
|
3774
3795
|
}), $task));
|
|
3775
3796
|
const controller_ = (await_
|
|
3776
3797
|
? ff_core_List.Link("$task", ff_core_List.Empty())
|
|
@@ -3982,7 +4003,7 @@ const doWhileBody_ = _1.arguments_.head_.value_;
|
|
|
3982
4003
|
if(_1.arguments_.tail_.Empty) {
|
|
3983
4004
|
const _guard1 = ff_compiler_JsEmitter.invokeImmediately_(doWhileBody_);
|
|
3984
4005
|
const body_ = _guard1;
|
|
3985
|
-
return (("while(
|
|
4006
|
+
return (("while(" + (await ff_compiler_JsEmitter.JsEmitter_emitTerm$(self_, body_, async_, $task))) + ") {}")
|
|
3986
4007
|
return
|
|
3987
4008
|
}
|
|
3988
4009
|
}
|
|
@@ -4023,7 +4044,7 @@ if(_1.dictionaries_.Link) {
|
|
|
4023
4044
|
const dictionary_ = _1.dictionaries_.head_;
|
|
4024
4045
|
if(_1.dictionaries_.tail_.Empty) {
|
|
4025
4046
|
const d_ = (await ff_compiler_JsEmitter.JsEmitter_emitDictionary$(self_, dictionary_, $task));
|
|
4026
|
-
const a_ = (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, argument_, async_, $task));
|
|
4047
|
+
const a_ = (await ff_compiler_JsEmitter.JsEmitter_emitArgument$(self_, at_, argument_, async_, $task));
|
|
4027
4048
|
return (((("throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(" + a_) + ", ") + d_) + ")})")
|
|
4028
4049
|
return
|
|
4029
4050
|
}
|
|
@@ -4752,8 +4773,25 @@ newtype_ = definition_.newtype_
|
|
|
4752
4773
|
return newtype_
|
|
4753
4774
|
}
|
|
4754
4775
|
|
|
4755
|
-
export async function JsEmitter_emitArgument$(self_, argument_, async_, $task) {
|
|
4756
|
-
|
|
4776
|
+
export async function JsEmitter_emitArgument$(self_, callAt_, argument_, async_, $task) {
|
|
4777
|
+
{
|
|
4778
|
+
const _1 = argument_.value_;
|
|
4779
|
+
{
|
|
4780
|
+
if(_1.ECall) {
|
|
4781
|
+
if(_1.target_.StaticCall) {
|
|
4782
|
+
if(_1.target_.name_ == "ff:core/SourceLocation.callSite") {
|
|
4783
|
+
return (((((((((("\"" + self_.moduleName_) + ":") + callAt_.line_) + ":") + callAt_.column_) + ",") + self_.packagePair_.group_) + ",") + self_.packagePair_.name_) + "\"")
|
|
4784
|
+
return
|
|
4785
|
+
}
|
|
4786
|
+
}
|
|
4787
|
+
}
|
|
4788
|
+
}
|
|
4789
|
+
{
|
|
4790
|
+
const value_ = _1;
|
|
4791
|
+
return (await ff_compiler_JsEmitter.JsEmitter_emitTerm$(self_, value_, async_, $task))
|
|
4792
|
+
return
|
|
4793
|
+
}
|
|
4794
|
+
}
|
|
4757
4795
|
}
|
|
4758
4796
|
|
|
4759
4797
|
export const ff_core_Any_HasAnyTag$ff_compiler_JsEmitter_EmitTarget = {
|
|
@@ -14,6 +14,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
14
14
|
|
|
15
15
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
16
16
|
|
|
17
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
18
|
+
|
|
17
19
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
18
20
|
|
|
19
21
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -74,6 +76,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
74
76
|
|
|
75
77
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
76
78
|
|
|
79
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
80
|
+
|
|
77
81
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
78
82
|
|
|
79
83
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
@@ -18,6 +18,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
18
18
|
|
|
19
19
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
20
20
|
|
|
21
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
22
|
+
|
|
21
23
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
22
24
|
|
|
23
25
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -78,6 +80,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
78
80
|
|
|
79
81
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
80
82
|
|
|
83
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
84
|
+
|
|
81
85
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
82
86
|
|
|
83
87
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
@@ -34,6 +34,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
34
34
|
|
|
35
35
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
36
36
|
|
|
37
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
38
|
+
|
|
37
39
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
38
40
|
|
|
39
41
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -94,6 +96,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
94
96
|
|
|
95
97
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
96
98
|
|
|
99
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
100
|
+
|
|
97
101
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
98
102
|
|
|
99
103
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
@@ -131,15 +135,15 @@ export function CommandLineError(problem_) {
|
|
|
131
135
|
return {problem_};
|
|
132
136
|
}
|
|
133
137
|
|
|
134
|
-
export const usageString_ = `
|
|
135
|
-
usage: firefly <main-file> [<main-arguments>] | <command> [<command-arguments>]
|
|
136
|
-
|
|
137
|
-
These are the commands:
|
|
138
|
-
run <main-file> [<main-arguments>] Run the main file with the provided arguments
|
|
139
|
-
browser <main-file> Compile the main file for the browser
|
|
140
|
-
build <main-file> Build the main file
|
|
141
|
-
check <firefly-file> Check the firefly source file for errors
|
|
142
|
-
bootstrap Bootstrap the compiler
|
|
138
|
+
export const usageString_ = `
|
|
139
|
+
usage: firefly <main-file> [<main-arguments>] | <command> [<command-arguments>]
|
|
140
|
+
|
|
141
|
+
These are the commands:
|
|
142
|
+
run <main-file> [<main-arguments>] Run the main file with the provided arguments
|
|
143
|
+
browser <main-file> Compile the main file for the browser
|
|
144
|
+
build <main-file> Build the main file
|
|
145
|
+
check <firefly-file> Check the firefly source file for errors
|
|
146
|
+
bootstrap Bootstrap the compiler
|
|
143
147
|
`;
|
|
144
148
|
|
|
145
149
|
export function main_(system_) {
|
|
@@ -800,13 +804,13 @@ return (await ff_core_Path.Path_readStream$((await ff_core_NodeSystem.NodeSystem
|
|
|
800
804
|
}
|
|
801
805
|
|
|
802
806
|
export async function importAndRun_$(fireflyPath_, target_, packagePair_, mainFile_, arguments_, $task) {
|
|
803
|
-
|
|
804
|
-
const process = await import('process');
|
|
805
|
-
const cwd = process.cwd();
|
|
806
|
-
const workingDirectory = cwd.indexOf(':') == 1 ? 'file:///' + cwd : cwd;
|
|
807
|
-
const packagePath = packagePair_.group_ + "/" + packagePair_.name_
|
|
808
|
-
const main = await import(workingDirectory + "/.firefly/output/" + target_ + "/" + packagePath + "/" + mainFile_ + ".mjs");
|
|
809
|
-
await main.$run$(fireflyPath_, ff_core_List.List_toArray(arguments_))
|
|
807
|
+
|
|
808
|
+
const process = await import('process');
|
|
809
|
+
const cwd = process.cwd();
|
|
810
|
+
const workingDirectory = cwd.indexOf(':') == 1 ? 'file:///' + cwd : cwd;
|
|
811
|
+
const packagePath = packagePair_.group_ + "/" + packagePair_.name_
|
|
812
|
+
const main = await import(workingDirectory + "/.firefly/output/" + target_ + "/" + packagePath + "/" + mainFile_ + ".mjs");
|
|
813
|
+
await main.$run$(fireflyPath_, ff_core_List.List_toArray(arguments_))
|
|
810
814
|
|
|
811
815
|
}
|
|
812
816
|
|
|
@@ -820,14 +824,14 @@ if((!(await ff_core_Path.Path_exists$((await ff_core_Path.Path_slash$(path_, ".f
|
|
|
820
824
|
}
|
|
821
825
|
|
|
822
826
|
export async function detectFireflyPath_$(system_, $task) {
|
|
823
|
-
|
|
824
|
-
const url = import$0
|
|
825
|
-
const suffix = '/output/js/ff/compiler/Main.mjs'
|
|
826
|
-
const moduleUrl = import.meta.url
|
|
827
|
-
if(!import.meta.url.endsWith(suffix)) {
|
|
828
|
-
throw 'Expected module path to end with: ' + suffix + ", but got: " + moduleUrl;
|
|
829
|
-
}
|
|
830
|
-
return url.fileURLToPath(new URL(moduleUrl.slice(0, -suffix.length)))
|
|
827
|
+
|
|
828
|
+
const url = import$0
|
|
829
|
+
const suffix = '/output/js/ff/compiler/Main.mjs'
|
|
830
|
+
const moduleUrl = import.meta.url
|
|
831
|
+
if(!import.meta.url.endsWith(suffix)) {
|
|
832
|
+
throw 'Expected module path to end with: ' + suffix + ", but got: " + moduleUrl;
|
|
833
|
+
}
|
|
834
|
+
return url.fileURLToPath(new URL(moduleUrl.slice(0, -suffix.length)))
|
|
831
835
|
|
|
832
836
|
}
|
|
833
837
|
|
|
@@ -20,6 +20,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
20
20
|
|
|
21
21
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
22
22
|
|
|
23
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
24
|
+
|
|
23
25
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
24
26
|
|
|
25
27
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -80,6 +82,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
80
82
|
|
|
81
83
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
82
84
|
|
|
85
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
86
|
+
|
|
83
87
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
84
88
|
|
|
85
89
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
@@ -14,6 +14,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
14
14
|
|
|
15
15
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
16
16
|
|
|
17
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
18
|
+
|
|
17
19
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
18
20
|
|
|
19
21
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -74,6 +76,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
74
76
|
|
|
75
77
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
76
78
|
|
|
79
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
80
|
+
|
|
77
81
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
78
82
|
|
|
79
83
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
@@ -16,6 +16,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
16
16
|
|
|
17
17
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
18
18
|
|
|
19
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
20
|
+
|
|
19
21
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
20
22
|
|
|
21
23
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -76,6 +78,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
76
78
|
|
|
77
79
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
78
80
|
|
|
81
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
82
|
+
|
|
79
83
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
80
84
|
|
|
81
85
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
@@ -102,11 +106,11 @@ return {nextUnificationVariableIndex_};
|
|
|
102
106
|
|
|
103
107
|
|
|
104
108
|
|
|
105
|
-
export function make_(lspHook_) {
|
|
109
|
+
export function make_(packagePair_, moduleName_, lspHook_) {
|
|
106
110
|
return ff_compiler_Resolver.Resolver(ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_Resolver.ResolverState(2), lspHook_)
|
|
107
111
|
}
|
|
108
112
|
|
|
109
|
-
export async function make_$(lspHook_, $task) {
|
|
113
|
+
export async function make_$(packagePair_, moduleName_, lspHook_, $task) {
|
|
110
114
|
return ff_compiler_Resolver.Resolver(ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toSet(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_core_List.List_toMap(ff_core_List.Empty(), ff_core_Ordering.ff_core_Ordering_Order$ff_core_String_String), ff_compiler_Resolver.ResolverState(2), lspHook_)
|
|
111
115
|
}
|
|
112
116
|
|
|
@@ -14,6 +14,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
14
14
|
|
|
15
15
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
16
16
|
|
|
17
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
18
|
+
|
|
17
19
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
18
20
|
|
|
19
21
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -74,6 +76,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
74
76
|
|
|
75
77
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
76
78
|
|
|
79
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
80
|
+
|
|
77
81
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
78
82
|
|
|
79
83
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
@@ -12,6 +12,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
12
12
|
|
|
13
13
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
14
14
|
|
|
15
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
16
|
+
|
|
15
17
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
16
18
|
|
|
17
19
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -72,6 +74,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
72
74
|
|
|
73
75
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
74
76
|
|
|
77
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
78
|
+
|
|
75
79
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
76
80
|
|
|
77
81
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
@@ -14,6 +14,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
14
14
|
|
|
15
15
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
16
16
|
|
|
17
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
18
|
+
|
|
17
19
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
18
20
|
|
|
19
21
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -74,6 +76,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
74
76
|
|
|
75
77
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
76
78
|
|
|
79
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
80
|
+
|
|
77
81
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
78
82
|
|
|
79
83
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
@@ -18,6 +18,8 @@ import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
|
18
18
|
|
|
19
19
|
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
20
20
|
|
|
21
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
22
|
+
|
|
21
23
|
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
22
24
|
|
|
23
25
|
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
@@ -78,6 +80,8 @@ import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
|
78
80
|
|
|
79
81
|
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
80
82
|
|
|
83
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
84
|
+
|
|
81
85
|
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
82
86
|
|
|
83
87
|
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|