firefly-compiler 0.5.2 → 0.5.4
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/bin/Release.ff +1 -0
- package/compiler/Compiler.ff +1 -0
- package/compiler/JsEmitter.ff +22 -7
- package/compiler/Parser.ff +8 -0
- package/core/JsSystem.ff +3 -0
- package/{unsafejs → core}/UnsafeJs.ff +20 -0
- package/fireflysite/Guide.ff +2 -1
- package/fireflysite/Main.ff +0 -6
- package/fireflysite/Test.ff +10 -0
- package/fireflysite/assets/markdown/reference/FunctionsAndMethods.md +37 -9
- package/fireflysite/assets/markdown/reference/JavascriptInterop.md +27 -9
- package/output/js/ff/compiler/Builder.mjs +2 -0
- package/output/js/ff/compiler/Compiler.mjs +3 -1
- package/output/js/ff/compiler/Dependencies.mjs +2 -0
- package/output/js/ff/compiler/DependencyLock.mjs +2 -0
- package/output/js/ff/compiler/Deriver.mjs +2 -0
- package/output/js/ff/compiler/Dictionaries.mjs +2 -0
- package/output/js/ff/compiler/Environment.mjs +2 -0
- package/output/js/ff/compiler/Inference.mjs +2 -0
- package/output/js/ff/compiler/JsEmitter.mjs +108 -16
- package/output/js/ff/compiler/JsImporter.mjs +2 -0
- package/output/js/ff/compiler/LspHook.mjs +2 -0
- package/output/js/ff/compiler/Main.mjs +2 -0
- package/output/js/ff/compiler/ModuleCache.mjs +2 -0
- package/output/js/ff/compiler/Parser.mjs +18 -0
- package/output/js/ff/compiler/Patterns.mjs +2 -0
- package/output/js/ff/compiler/Resolver.mjs +2 -0
- package/output/js/ff/compiler/Substitution.mjs +2 -0
- package/output/js/ff/compiler/Syntax.mjs +2 -0
- package/output/js/ff/compiler/Token.mjs +2 -0
- package/output/js/ff/compiler/Tokenizer.mjs +2 -0
- package/output/js/ff/compiler/Unification.mjs +2 -0
- package/output/js/ff/compiler/Wildcards.mjs +2 -0
- package/output/js/ff/compiler/Workspace.mjs +2 -0
- package/output/js/ff/core/Any.mjs +2 -0
- package/output/js/ff/core/Array.mjs +2 -0
- package/output/js/ff/core/AssetSystem.mjs +2 -0
- package/output/js/ff/core/Atomic.mjs +2 -0
- package/output/js/ff/core/Bool.mjs +2 -0
- package/output/js/ff/core/BrowserSystem.mjs +2 -0
- package/output/js/ff/core/Buffer.mjs +2 -0
- package/output/js/ff/core/BuildSystem.mjs +2 -0
- package/output/js/ff/core/Channel.mjs +2 -0
- package/output/js/ff/core/Char.mjs +2 -0
- package/output/js/ff/core/Core.mjs +2 -0
- package/output/js/ff/core/Crypto.mjs +2 -0
- package/output/js/ff/core/Duration.mjs +2 -0
- package/output/js/ff/core/Equal.mjs +2 -0
- package/output/js/ff/core/Error.mjs +2 -0
- package/output/js/ff/core/FileHandle.mjs +2 -0
- package/output/js/ff/core/Float.mjs +2 -0
- package/output/js/ff/core/HttpClient.mjs +2 -0
- package/output/js/ff/core/Instant.mjs +2 -0
- package/output/js/ff/core/Int.mjs +2 -0
- package/output/js/ff/core/IntMap.mjs +2 -0
- package/output/js/ff/core/JsSystem.mjs +10 -0
- package/output/js/ff/core/JsValue.mjs +2 -0
- package/output/js/ff/core/Json.mjs +2 -0
- package/output/js/ff/core/List.mjs +2 -0
- package/output/js/ff/core/Lock.mjs +2 -0
- package/output/js/ff/core/Log.mjs +2 -0
- package/output/js/ff/core/Map.mjs +2 -0
- package/output/js/ff/core/NodeSystem.mjs +2 -0
- package/output/js/ff/core/Nothing.mjs +2 -0
- package/output/js/ff/core/Option.mjs +2 -0
- package/output/js/ff/core/Ordering.mjs +2 -0
- package/output/js/ff/core/Pair.mjs +2 -0
- package/output/js/ff/core/Path.mjs +2 -0
- package/output/js/ff/core/Random.mjs +2 -0
- package/output/js/ff/core/RbMap.mjs +2 -0
- package/output/js/ff/core/Serializable.mjs +2 -0
- package/output/js/ff/core/Set.mjs +2 -0
- package/output/js/ff/core/Show.mjs +2 -0
- package/output/js/ff/core/SourceLocation.mjs +2 -0
- package/output/js/ff/core/Stream.mjs +2 -0
- package/output/js/ff/core/String.mjs +2 -0
- package/output/js/ff/core/StringMap.mjs +2 -0
- package/output/js/ff/core/Task.mjs +2 -0
- package/output/js/ff/core/Try.mjs +2 -0
- package/output/js/ff/core/Unit.mjs +2 -0
- package/output/js/ff/core/UnsafeJs.mjs +191 -0
- package/package.json +1 -1
- package/postgresql/.firefly/package.ff +0 -1
- package/postgresql/Pg.ff +0 -2
- package/vscode/package.json +1 -1
- package/compression/.firefly/package.ff +0 -1
- package/compression/Compression.ff +0 -55
- package/unsafejs/.firefly/package.ff +0 -1
|
@@ -100,6 +100,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
100
100
|
|
|
101
101
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
102
102
|
|
|
103
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
104
|
+
|
|
103
105
|
// type Parser
|
|
104
106
|
export function Parser(packagePair_, file_, tokens_, end_, targetIsNode_, lspHook_, lspEmittedArgumentHook_, offset_, nextUnificationVariableIndex_) {
|
|
105
107
|
return {packagePair_, file_, tokens_, end_, targetIsNode_, lspHook_, lspEmittedArgumentHook_, offset_, nextUnificationVariableIndex_};
|
|
@@ -1520,6 +1522,14 @@ result_ = ff_compiler_Syntax.EField(ff_compiler_Token.Token_at(token_), false, r
|
|
|
1520
1522
|
}
|
|
1521
1523
|
} else if(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LArrowThin())) {
|
|
1522
1524
|
result_ = ff_compiler_Parser.Parser_parseDynamicMember(self_, result_)
|
|
1525
|
+
} else if(ff_compiler_Token.Token_rawIs2(ff_compiler_Parser.Parser_current(self_), "!", "?")) {
|
|
1526
|
+
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LOperator());
|
|
1527
|
+
const method_ = (ff_compiler_Token.Token_rawIs(token_, "!")
|
|
1528
|
+
? "ff:core/UnsafeJs.value"
|
|
1529
|
+
: "ff:core/UnsafeJs.fromValue");
|
|
1530
|
+
const target_ = ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(token_), method_), false);
|
|
1531
|
+
const effect_ = ff_compiler_Parser.Parser_freshUnificationVariable(self_, ff_compiler_Token.Token_at(token_));
|
|
1532
|
+
result_ = ff_compiler_Parser.Parser_parseDynamicMember(self_, ff_compiler_Syntax.ECall(ff_compiler_Token.Token_at(token_), target_, effect_, [], [ff_compiler_Syntax.Argument(result_.at_, ff_core_Option.None(), result_)], []))
|
|
1523
1533
|
} else {
|
|
1524
1534
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_));
|
|
1525
1535
|
const typeArguments_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
@@ -3130,6 +3140,14 @@ result_ = ff_compiler_Syntax.EField(ff_compiler_Token.Token_at(token_), false, r
|
|
|
3130
3140
|
}
|
|
3131
3141
|
} else if(ff_compiler_Token.Token_is(ff_compiler_Parser.Parser_current(self_), ff_compiler_Token.LArrowThin())) {
|
|
3132
3142
|
result_ = ff_compiler_Parser.Parser_parseDynamicMember(self_, result_)
|
|
3143
|
+
} else if(ff_compiler_Token.Token_rawIs2(ff_compiler_Parser.Parser_current(self_), "!", "?")) {
|
|
3144
|
+
const token_ = ff_compiler_Parser.Parser_skip(self_, ff_compiler_Token.LOperator());
|
|
3145
|
+
const method_ = (ff_compiler_Token.Token_rawIs(token_, "!")
|
|
3146
|
+
? "ff:core/UnsafeJs.value"
|
|
3147
|
+
: "ff:core/UnsafeJs.fromValue");
|
|
3148
|
+
const target_ = ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EVariable(ff_compiler_Token.Token_at(token_), method_), false);
|
|
3149
|
+
const effect_ = ff_compiler_Parser.Parser_freshUnificationVariable(self_, ff_compiler_Token.Token_at(token_));
|
|
3150
|
+
result_ = ff_compiler_Parser.Parser_parseDynamicMember(self_, ff_compiler_Syntax.ECall(ff_compiler_Token.Token_at(token_), target_, effect_, [], [ff_compiler_Syntax.Argument(result_.at_, ff_core_Option.None(), result_)], []))
|
|
3133
3151
|
} else {
|
|
3134
3152
|
const at_ = ff_compiler_Token.Token_at(ff_compiler_Parser.Parser_current(self_));
|
|
3135
3153
|
const typeArguments_ = ((!ff_compiler_Token.Token_rawIs(ff_compiler_Parser.Parser_current(self_), "["))
|
|
@@ -94,6 +94,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
94
94
|
|
|
95
95
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
96
96
|
|
|
97
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
98
|
+
|
|
97
99
|
// type PatternInfo
|
|
98
100
|
export function PatternInfo(variant_, otherVariants_, fields_) {
|
|
99
101
|
return {variant_, otherVariants_, fields_};
|
|
@@ -96,6 +96,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
96
96
|
|
|
97
97
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
98
98
|
|
|
99
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
100
|
+
|
|
99
101
|
// type Resolver
|
|
100
102
|
export function Resolver(variables_, variableLocations_, variants_, types_, typeGenerics_, typeLocations_, asyncTypes_, typeParameters_, traits_, traitLocations_, state_, lspHook_) {
|
|
101
103
|
return {variables_, variableLocations_, variants_, types_, typeGenerics_, typeLocations_, asyncTypes_, typeParameters_, traits_, traitLocations_, state_, lspHook_};
|
|
@@ -94,6 +94,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
94
94
|
|
|
95
95
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
96
96
|
|
|
97
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
98
|
+
|
|
97
99
|
// type Substitution
|
|
98
100
|
export function Substitution(substitution_) {
|
|
99
101
|
return {substitution_};
|
|
@@ -92,6 +92,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
92
92
|
|
|
93
93
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
94
94
|
|
|
95
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
96
|
+
|
|
95
97
|
// type Location
|
|
96
98
|
export function Location(file_, line_, column_) {
|
|
97
99
|
return {file_, line_, column_};
|
|
@@ -94,6 +94,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
94
94
|
|
|
95
95
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
96
96
|
|
|
97
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
98
|
+
|
|
97
99
|
// type Token
|
|
98
100
|
export function Token(file_, code_, kind_, startLine_, startLineOffset_, startOffset_, stopLine_, stopLineOffset_, stopOffset_) {
|
|
99
101
|
return {file_, code_, kind_, startLine_, startLineOffset_, startOffset_, stopLine_, stopLineOffset_, stopOffset_};
|
|
@@ -96,6 +96,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
96
96
|
|
|
97
97
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
98
98
|
|
|
99
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
100
|
+
|
|
99
101
|
// type Unification
|
|
100
102
|
export function Unification(substitution_, constraints_, nextUnificationVariableIndex_, instances_, affects_, attemptFixes_) {
|
|
101
103
|
return {substitution_, constraints_, nextUnificationVariableIndex_, instances_, affects_, attemptFixes_};
|
|
@@ -94,6 +94,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
94
94
|
|
|
95
95
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
96
96
|
|
|
97
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
98
|
+
|
|
97
99
|
// type Wildcards
|
|
98
100
|
export function Wildcards(seenWildcards_) {
|
|
99
101
|
return {seenWildcards_};
|
|
@@ -94,6 +94,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
94
94
|
|
|
95
95
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
96
96
|
|
|
97
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
98
|
+
|
|
97
99
|
// type Workspace
|
|
98
100
|
export function Workspace(rules_, defaultLocation_, packageDirectory_) {
|
|
99
101
|
return {rules_, defaultLocation_, packageDirectory_};
|
|
@@ -90,6 +90,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
90
90
|
|
|
91
91
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
92
92
|
|
|
93
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
94
|
+
|
|
93
95
|
// type AssetSystem
|
|
94
96
|
export function AssetSystem(files_) {
|
|
95
97
|
return {files_};
|
|
@@ -90,6 +90,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
90
90
|
|
|
91
91
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
92
92
|
|
|
93
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
94
|
+
|
|
93
95
|
// type Bool
|
|
94
96
|
const False$ = {False: true};
|
|
95
97
|
export function False() {
|
|
@@ -90,6 +90,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
90
90
|
|
|
91
91
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
92
92
|
|
|
93
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
94
|
+
|
|
93
95
|
// type GrabException
|
|
94
96
|
const GrabException$ = {GrabException: true};
|
|
95
97
|
export function GrabException() {
|
|
@@ -90,6 +90,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
90
90
|
|
|
91
91
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
92
92
|
|
|
93
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
94
|
+
|
|
93
95
|
// type JsSystem
|
|
94
96
|
|
|
95
97
|
|
|
@@ -179,6 +181,10 @@ export function JsSystem_object(self_) {
|
|
|
179
181
|
return {}
|
|
180
182
|
}
|
|
181
183
|
|
|
184
|
+
export function JsSystem_new0(self_) {
|
|
185
|
+
return {}
|
|
186
|
+
}
|
|
187
|
+
|
|
182
188
|
export function JsSystem_array(self_, values_) {
|
|
183
189
|
return values_.slice()
|
|
184
190
|
}
|
|
@@ -307,6 +313,10 @@ export async function JsSystem_object$(self_, $task) {
|
|
|
307
313
|
throw new Error('Function JsSystem_object is missing on this target in async context.');
|
|
308
314
|
}
|
|
309
315
|
|
|
316
|
+
export async function JsSystem_new0$(self_, $task) {
|
|
317
|
+
throw new Error('Function JsSystem_new0 is missing on this target in async context.');
|
|
318
|
+
}
|
|
319
|
+
|
|
310
320
|
export async function JsSystem_array$(self_, values_, $task) {
|
|
311
321
|
throw new Error('Function JsSystem_array is missing on this target in async context.');
|
|
312
322
|
}
|
|
@@ -90,6 +90,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
90
90
|
|
|
91
91
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
92
92
|
|
|
93
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
94
|
+
|
|
93
95
|
// type Option
|
|
94
96
|
const None$ = {None: true};
|
|
95
97
|
export function None() {
|
|
@@ -90,6 +90,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
90
90
|
|
|
91
91
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
92
92
|
|
|
93
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
94
|
+
|
|
93
95
|
// type Ordering
|
|
94
96
|
const OrderingBefore$ = {OrderingBefore: true};
|
|
95
97
|
export function OrderingBefore() {
|
|
@@ -90,6 +90,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
90
90
|
|
|
91
91
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
92
92
|
|
|
93
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
94
|
+
|
|
93
95
|
// type Pair
|
|
94
96
|
export function Pair(first_, second_) {
|
|
95
97
|
return {first_, second_};
|
|
@@ -90,6 +90,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
90
90
|
|
|
91
91
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
92
92
|
|
|
93
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
94
|
+
|
|
93
95
|
// type DeserializationChecksumException
|
|
94
96
|
const DeserializationChecksumException$ = {DeserializationChecksumException: true};
|
|
95
97
|
export function DeserializationChecksumException() {
|
|
@@ -90,6 +90,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
90
90
|
|
|
91
91
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
92
92
|
|
|
93
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
94
|
+
|
|
93
95
|
// type Stream
|
|
94
96
|
export function Stream(next_, close_) {
|
|
95
97
|
return {next_, close_};
|
|
@@ -90,6 +90,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
90
90
|
|
|
91
91
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
92
92
|
|
|
93
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
94
|
+
|
|
93
95
|
// type Try
|
|
94
96
|
export function Success(value_) {
|
|
95
97
|
return {Success: true, value_};
|
|
@@ -90,6 +90,8 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
90
90
|
|
|
91
91
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
92
92
|
|
|
93
|
+
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
94
|
+
|
|
93
95
|
// type Unit
|
|
94
96
|
const Unit$ = {Unit: true};
|
|
95
97
|
export function Unit() {
|