firefly-compiler 0.4.90 → 0.5.1
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/compiler/Parser.ff
CHANGED
|
@@ -1199,10 +1199,10 @@ extend self: Parser {
|
|
|
1199
1199
|
if(argument.name.isEmpty()) {
|
|
1200
1200
|
throw(CompileError(argument.at, "Expected a named argument"))
|
|
1201
1201
|
}
|
|
1202
|
-
let target = DynamicCall(EField(token.at(), False,
|
|
1202
|
+
let target = DynamicCall(EField(token.at(), False, result, "with"), False)
|
|
1203
1203
|
result = ECall(record.at, target, effect, [], [
|
|
1204
1204
|
Argument(argument.at, None, EString(argument.at, argument.name.grab()))
|
|
1205
|
-
argument
|
|
1205
|
+
Argument(argument.value.at, None, argument.value)
|
|
1206
1206
|
], [])
|
|
1207
1207
|
}
|
|
1208
1208
|
result
|
|
@@ -5,7 +5,7 @@ capability Compression {}
|
|
|
5
5
|
extend self: Compression {
|
|
6
6
|
|
|
7
7
|
compressBrotli(uncompressed: Buffer, level: Int = 4): Buffer {
|
|
8
|
-
internalCompress("brotli", level, uncompressed)
|
|
8
|
+
internalCompress(self, "brotli", level, uncompressed)
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
decompressBrotli(compressed: Buffer): Buffer {
|
|
@@ -13,7 +13,7 @@ extend self: Compression {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
compressGzip(uncompressed: Buffer, level: Int = 6): Buffer {
|
|
16
|
-
internalCompress("gzip", level, uncompressed)
|
|
16
|
+
internalCompress(self, "gzip", level, uncompressed)
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
decompressGzip(compressed: Buffer): Buffer {
|
|
@@ -21,7 +21,7 @@ extend self: Compression {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
compressDeflate(uncompressed: Buffer, level: Int = 6): Buffer {
|
|
24
|
-
internalCompress("deflate", level, uncompressed)
|
|
24
|
+
internalCompress(self, "deflate", level, uncompressed)
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
decompressDeflate(compressed: Buffer): Buffer {
|
|
@@ -36,9 +36,9 @@ newForBrowserSystem(browserSystem: BrowserSystem): Compression
|
|
|
36
36
|
newForNodeSystem(nodeSystem: NodeSystem): Compression
|
|
37
37
|
target js async "return globalThis"
|
|
38
38
|
|
|
39
|
-
internalCompress(algorithm: String, level: Int, buffer: Buffer): Buffer {
|
|
39
|
+
internalCompress(compression: Compression, algorithm: String, level: Int, buffer: Buffer): Buffer {
|
|
40
40
|
let js = UnsafeJs.jsSystem()
|
|
41
|
-
let dataView =
|
|
41
|
+
let dataView = js.value(buffer)
|
|
42
42
|
let uint8Array = js->Uint8Array->(dataView->buffer, dataView->byteOffset, dataView->byteLength)
|
|
43
43
|
let stream = js->ReadableStream->(js->(
|
|
44
44
|
start = js->{controller =>
|
|
@@ -1558,8 +1558,8 @@ ff_core_List.List_each(arguments_.first_, ((argument_) => {
|
|
|
1558
1558
|
if(ff_core_Option.Option_isEmpty(argument_.name_)) {
|
|
1559
1559
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(argument_.at_, "Expected a named argument"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
1560
1560
|
};
|
|
1561
|
-
const target_ = ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EField(ff_compiler_Token.Token_at(token_), false,
|
|
1562
|
-
result_ = ff_compiler_Syntax.ECall(record_.at_, target_, effect_, [], [ff_compiler_Syntax.Argument(argument_.at_, ff_core_Option.None(), ff_compiler_Syntax.EString(argument_.at_, ff_core_Option.Option_grab(argument_.name_))), argument_], [])
|
|
1561
|
+
const target_ = ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EField(ff_compiler_Token.Token_at(token_), false, result_, "with"), false);
|
|
1562
|
+
result_ = ff_compiler_Syntax.ECall(record_.at_, target_, effect_, [], [ff_compiler_Syntax.Argument(argument_.at_, ff_core_Option.None(), ff_compiler_Syntax.EString(argument_.at_, ff_core_Option.Option_grab(argument_.name_))), ff_compiler_Syntax.Argument(argument_.value_.at_, ff_core_Option.None(), argument_.value_)], [])
|
|
1563
1563
|
}));
|
|
1564
1564
|
return result_
|
|
1565
1565
|
}
|
|
@@ -3168,8 +3168,8 @@ ff_core_List.List_each(arguments_.first_, ((argument_) => {
|
|
|
3168
3168
|
if(ff_core_Option.Option_isEmpty(argument_.name_)) {
|
|
3169
3169
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(argument_.at_, "Expected a named argument"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
3170
3170
|
};
|
|
3171
|
-
const target_ = ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EField(ff_compiler_Token.Token_at(token_), false,
|
|
3172
|
-
result_ = ff_compiler_Syntax.ECall(record_.at_, target_, effect_, [], [ff_compiler_Syntax.Argument(argument_.at_, ff_core_Option.None(), ff_compiler_Syntax.EString(argument_.at_, ff_core_Option.Option_grab(argument_.name_))), argument_], [])
|
|
3171
|
+
const target_ = ff_compiler_Syntax.DynamicCall(ff_compiler_Syntax.EField(ff_compiler_Token.Token_at(token_), false, result_, "with"), false);
|
|
3172
|
+
result_ = ff_compiler_Syntax.ECall(record_.at_, target_, effect_, [], [ff_compiler_Syntax.Argument(argument_.at_, ff_core_Option.None(), ff_compiler_Syntax.EString(argument_.at_, ff_core_Option.Option_grab(argument_.name_))), ff_compiler_Syntax.Argument(argument_.value_.at_, ff_core_Option.None(), argument_.value_)], [])
|
|
3173
3173
|
}));
|
|
3174
3174
|
return result_
|
|
3175
3175
|
}
|
package/package.json
CHANGED
package/unsafejs/UnsafeJs.ff
CHANGED