firefly-compiler 0.4.6 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiler/Compiler.ff +2 -0
- package/compiler/Deriver.ff +7 -0
- package/core/Array.ff +17 -4
- package/core/AssetSystem.ff +1 -1
- package/core/BrowserSystem.ff +27 -0
- package/core/List.ff +4 -0
- package/core/Lock.ff +2 -2
- package/core/Random.ff +148 -0
- package/core/SourceLocation.ff +27 -0
- package/core/Task.ff +3 -0
- package/core/WebSocket.ff +127 -0
- package/httpserver/HttpServer.ff +1 -1
- package/lux/Css.ff +648 -0
- package/lux/CssTest.ff +48 -0
- package/lux/Lux.ff +33 -18
- package/lux/Main.ff +4 -1
- package/output/js/ff/compiler/Builder.mjs +448 -444
- package/output/js/ff/compiler/Compiler.mjs +420 -416
- package/output/js/ff/compiler/Dependencies.mjs +393 -389
- package/output/js/ff/compiler/Deriver.mjs +1178 -1170
- package/output/js/ff/compiler/Dictionaries.mjs +1315 -1309
- package/output/js/ff/compiler/Environment.mjs +1025 -1015
- package/output/js/ff/compiler/Inference.mjs +4272 -4268
- package/output/js/ff/compiler/JsEmitter.mjs +5405 -5391
- package/output/js/ff/compiler/JsImporter.mjs +270 -266
- package/output/js/ff/compiler/LspHook.mjs +799 -793
- package/output/js/ff/compiler/Main.mjs +1691 -1675
- package/output/js/ff/compiler/Parser.mjs +4016 -4008
- package/output/js/ff/compiler/Patterns.mjs +935 -927
- package/output/js/ff/compiler/Resolver.mjs +2311 -2307
- package/output/js/ff/compiler/Substitution.mjs +1154 -1150
- package/output/js/ff/compiler/Syntax.mjs +12566 -12434
- package/output/js/ff/compiler/Token.mjs +3152 -3096
- package/output/js/ff/compiler/Tokenizer.mjs +597 -593
- package/output/js/ff/compiler/Unification.mjs +1762 -1752
- package/output/js/ff/compiler/Wildcards.mjs +612 -608
- package/output/js/ff/compiler/Workspace.mjs +695 -687
- package/output/js/ff/core/Any.mjs +147 -143
- package/output/js/ff/core/Array.mjs +573 -547
- package/output/js/ff/core/AssetSystem.mjs +278 -274
- package/output/js/ff/core/Atomic.mjs +158 -154
- package/output/js/ff/core/Bool.mjs +156 -152
- package/output/js/ff/core/Box.mjs +116 -112
- package/output/js/ff/core/BrowserSystem.mjs +181 -126
- package/output/js/ff/core/Buffer.mjs +399 -395
- package/output/js/ff/core/BuildSystem.mjs +300 -296
- package/output/js/ff/core/Channel.mjs +193 -189
- package/output/js/ff/core/Char.mjs +153 -149
- package/output/js/ff/core/Core.mjs +304 -300
- package/output/js/ff/core/Duration.mjs +120 -116
- package/output/js/ff/core/Equal.mjs +183 -179
- package/output/js/ff/core/Error.mjs +146 -142
- package/output/js/ff/core/FileHandle.mjs +154 -150
- package/output/js/ff/core/Float.mjs +229 -225
- package/output/js/ff/core/HttpClient.mjs +195 -191
- package/output/js/ff/core/Instant.mjs +113 -109
- package/output/js/ff/core/Int.mjs +269 -265
- package/output/js/ff/core/IntMap.mjs +284 -280
- package/output/js/ff/core/JsSystem.mjs +242 -238
- package/output/js/ff/core/JsValue.mjs +712 -708
- package/output/js/ff/core/List.mjs +2346 -2334
- package/output/js/ff/core/Lock.mjs +235 -231
- package/output/js/ff/core/Log.mjs +167 -163
- package/output/js/ff/core/Map.mjs +366 -362
- package/output/js/ff/core/NodeSystem.mjs +298 -294
- package/output/js/ff/core/Nothing.mjs +108 -104
- package/output/js/ff/core/Option.mjs +1023 -1015
- package/output/js/ff/core/Ordering.mjs +734 -730
- package/output/js/ff/core/Pair.mjs +337 -331
- package/output/js/ff/core/Path.mjs +549 -545
- package/output/js/ff/core/Random.mjs +340 -0
- package/output/js/ff/core/RbMap.mjs +1944 -1940
- package/output/js/ff/core/Serializable.mjs +432 -428
- package/output/js/ff/core/Set.mjs +258 -254
- package/output/js/ff/core/Show.mjs +209 -205
- package/output/js/ff/core/SourceLocation.mjs +273 -229
- package/output/js/ff/core/Stack.mjs +533 -529
- package/output/js/ff/core/Stream.mjs +1308 -1304
- package/output/js/ff/core/String.mjs +369 -365
- package/output/js/ff/core/StringMap.mjs +284 -280
- package/output/js/ff/core/Task.mjs +325 -319
- package/output/js/ff/core/Try.mjs +511 -507
- package/output/js/ff/core/Unit.mjs +155 -151
- package/output/js/ff/core/WebSocket.mjs +198 -0
- package/package.json +1 -1
- package/vscode/package.json +1 -1
- package/webserver/.firefly/include/package-lock.json +16 -0
- package/webserver/.firefly/include/package.json +5 -0
- package/webserver/.firefly/package.ff +2 -0
- package/webserver/WebServer.ff +608 -0
|
@@ -1,126 +1,130 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import * as ff_core_Any from "../../ff/core/Any.mjs"
|
|
4
|
-
|
|
5
|
-
import * as ff_core_Array from "../../ff/core/Array.mjs"
|
|
6
|
-
|
|
7
|
-
import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
|
|
8
|
-
|
|
9
|
-
import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
10
|
-
|
|
11
|
-
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
12
|
-
|
|
13
|
-
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
14
|
-
|
|
15
|
-
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
16
|
-
|
|
17
|
-
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
18
|
-
|
|
19
|
-
import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
|
|
20
|
-
|
|
21
|
-
import * as ff_core_Channel from "../../ff/core/Channel.mjs"
|
|
22
|
-
|
|
23
|
-
import * as ff_core_Char from "../../ff/core/Char.mjs"
|
|
24
|
-
|
|
25
|
-
import * as ff_core_Core from "../../ff/core/Core.mjs"
|
|
26
|
-
|
|
27
|
-
import * as ff_core_Duration from "../../ff/core/Duration.mjs"
|
|
28
|
-
|
|
29
|
-
import * as ff_core_Equal from "../../ff/core/Equal.mjs"
|
|
30
|
-
|
|
31
|
-
import * as ff_core_Error from "../../ff/core/Error.mjs"
|
|
32
|
-
|
|
33
|
-
import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
|
|
34
|
-
|
|
35
|
-
import * as ff_core_Float from "../../ff/core/Float.mjs"
|
|
36
|
-
|
|
37
|
-
import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
|
|
38
|
-
|
|
39
|
-
import * as ff_core_Instant from "../../ff/core/Instant.mjs"
|
|
40
|
-
|
|
41
|
-
import * as ff_core_Int from "../../ff/core/Int.mjs"
|
|
42
|
-
|
|
43
|
-
import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
|
|
44
|
-
|
|
45
|
-
import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
|
|
46
|
-
|
|
47
|
-
import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
|
|
48
|
-
|
|
49
|
-
import * as ff_core_List from "../../ff/core/List.mjs"
|
|
50
|
-
|
|
51
|
-
import * as ff_core_Lock from "../../ff/core/Lock.mjs"
|
|
52
|
-
|
|
53
|
-
import * as ff_core_Log from "../../ff/core/Log.mjs"
|
|
54
|
-
|
|
55
|
-
import * as ff_core_Map from "../../ff/core/Map.mjs"
|
|
56
|
-
|
|
57
|
-
import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
|
|
58
|
-
|
|
59
|
-
import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
|
|
60
|
-
|
|
61
|
-
import * as ff_core_Option from "../../ff/core/Option.mjs"
|
|
62
|
-
|
|
63
|
-
import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
|
|
64
|
-
|
|
65
|
-
import * as ff_core_Pair from "../../ff/core/Pair.mjs"
|
|
66
|
-
|
|
67
|
-
import * as ff_core_Path from "../../ff/core/Path.mjs"
|
|
68
|
-
|
|
69
|
-
import * as
|
|
70
|
-
|
|
71
|
-
import * as
|
|
72
|
-
|
|
73
|
-
import * as
|
|
74
|
-
|
|
75
|
-
import * as
|
|
76
|
-
|
|
77
|
-
import * as
|
|
78
|
-
|
|
79
|
-
import * as
|
|
80
|
-
|
|
81
|
-
import * as
|
|
82
|
-
|
|
83
|
-
import * as
|
|
84
|
-
|
|
85
|
-
import * as
|
|
86
|
-
|
|
87
|
-
import * as
|
|
88
|
-
|
|
89
|
-
import * as
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
serialization_.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import * as ff_core_Any from "../../ff/core/Any.mjs"
|
|
4
|
+
|
|
5
|
+
import * as ff_core_Array from "../../ff/core/Array.mjs"
|
|
6
|
+
|
|
7
|
+
import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
|
|
8
|
+
|
|
9
|
+
import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
10
|
+
|
|
11
|
+
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
12
|
+
|
|
13
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
14
|
+
|
|
15
|
+
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
16
|
+
|
|
17
|
+
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
18
|
+
|
|
19
|
+
import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
|
|
20
|
+
|
|
21
|
+
import * as ff_core_Channel from "../../ff/core/Channel.mjs"
|
|
22
|
+
|
|
23
|
+
import * as ff_core_Char from "../../ff/core/Char.mjs"
|
|
24
|
+
|
|
25
|
+
import * as ff_core_Core from "../../ff/core/Core.mjs"
|
|
26
|
+
|
|
27
|
+
import * as ff_core_Duration from "../../ff/core/Duration.mjs"
|
|
28
|
+
|
|
29
|
+
import * as ff_core_Equal from "../../ff/core/Equal.mjs"
|
|
30
|
+
|
|
31
|
+
import * as ff_core_Error from "../../ff/core/Error.mjs"
|
|
32
|
+
|
|
33
|
+
import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
|
|
34
|
+
|
|
35
|
+
import * as ff_core_Float from "../../ff/core/Float.mjs"
|
|
36
|
+
|
|
37
|
+
import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
|
|
38
|
+
|
|
39
|
+
import * as ff_core_Instant from "../../ff/core/Instant.mjs"
|
|
40
|
+
|
|
41
|
+
import * as ff_core_Int from "../../ff/core/Int.mjs"
|
|
42
|
+
|
|
43
|
+
import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
|
|
44
|
+
|
|
45
|
+
import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
|
|
46
|
+
|
|
47
|
+
import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
|
|
48
|
+
|
|
49
|
+
import * as ff_core_List from "../../ff/core/List.mjs"
|
|
50
|
+
|
|
51
|
+
import * as ff_core_Lock from "../../ff/core/Lock.mjs"
|
|
52
|
+
|
|
53
|
+
import * as ff_core_Log from "../../ff/core/Log.mjs"
|
|
54
|
+
|
|
55
|
+
import * as ff_core_Map from "../../ff/core/Map.mjs"
|
|
56
|
+
|
|
57
|
+
import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
|
|
58
|
+
|
|
59
|
+
import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
|
|
60
|
+
|
|
61
|
+
import * as ff_core_Option from "../../ff/core/Option.mjs"
|
|
62
|
+
|
|
63
|
+
import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
|
|
64
|
+
|
|
65
|
+
import * as ff_core_Pair from "../../ff/core/Pair.mjs"
|
|
66
|
+
|
|
67
|
+
import * as ff_core_Path from "../../ff/core/Path.mjs"
|
|
68
|
+
|
|
69
|
+
import * as ff_core_Random from "../../ff/core/Random.mjs"
|
|
70
|
+
|
|
71
|
+
import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
|
|
72
|
+
|
|
73
|
+
import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
74
|
+
|
|
75
|
+
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
76
|
+
|
|
77
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
78
|
+
|
|
79
|
+
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
80
|
+
|
|
81
|
+
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
82
|
+
|
|
83
|
+
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
84
|
+
|
|
85
|
+
import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
|
|
86
|
+
|
|
87
|
+
import * as ff_core_Task from "../../ff/core/Task.mjs"
|
|
88
|
+
|
|
89
|
+
import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
90
|
+
|
|
91
|
+
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
92
|
+
|
|
93
|
+
import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
|
|
94
|
+
|
|
95
|
+
// type DeserializationChecksumException
|
|
96
|
+
const DeserializationChecksumException$ = {DeserializationChecksumException: true};
|
|
97
|
+
export function DeserializationChecksumException() {
|
|
98
|
+
return DeserializationChecksumException$;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// type Serialization
|
|
102
|
+
export function Serialization(buffer_, offset_, checksum_) {
|
|
103
|
+
return {buffer_, offset_, checksum_};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
export function serialize_(value_, initialBufferSize_ = 1024, ff_core_Serializable_Serializable$T) {
|
|
109
|
+
const serialization_ = ff_core_Serializable.Serialization(ff_core_Buffer.make_(initialBufferSize_, false), 0, 0);
|
|
110
|
+
ff_core_Serializable_Serializable$T.serializeUsing_(serialization_, value_);
|
|
111
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, 4);
|
|
112
|
+
ff_core_Buffer.Buffer_setInt32(serialization_.buffer_, serialization_.offset_, serialization_.checksum_, true);
|
|
113
|
+
serialization_.offset_ += 4;
|
|
114
|
+
return ff_core_Buffer.Buffer_view(serialization_.buffer_, 0, serialization_.offset_)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function deserialize_(buffer_, ff_core_Serializable_Serializable$T) {
|
|
118
|
+
const serialization_ = ff_core_Serializable.Serialization(buffer_, 0, 0);
|
|
119
|
+
const result_ = ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_);
|
|
120
|
+
const checksum_ = ff_core_Buffer.Buffer_grabInt32(serialization_.buffer_, serialization_.offset_, true);
|
|
121
|
+
if((checksum_ !== serialization_.checksum_)) {
|
|
122
|
+
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
|
|
123
|
+
};
|
|
124
|
+
return result_
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function internalSetLatin1_(self_, byteOffset_, value_) {
|
|
124
128
|
|
|
125
129
|
for(let i = 0; i < value_.length; i++) {
|
|
126
130
|
let charCode = value_.charCodeAt(i)
|
|
@@ -128,311 +132,311 @@ export function internalSetLatin1_(self_, byteOffset_, value_) {
|
|
|
128
132
|
self_.setUint8(byteOffset_ + i, charCode)
|
|
129
133
|
}
|
|
130
134
|
return true
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export function internalGrabLatin1_(self_, byteOffset_, size_) {
|
|
135
|
+
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function internalGrabLatin1_(self_, byteOffset_, size_) {
|
|
135
139
|
|
|
136
140
|
const codeUnits = new Uint8Array(self_.buffer, self_.byteOffset + byteOffset_, size_)
|
|
137
141
|
return String.fromCharCode.apply(null, codeUnits)
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export async function serialize_$(value_, initialBufferSize_ = 1024, ff_core_Serializable_Serializable$T, $task) {
|
|
142
|
-
const serialization_ = ff_core_Serializable.Serialization(ff_core_Buffer.make_(initialBufferSize_, false), 0, 0);
|
|
143
|
-
ff_core_Serializable_Serializable$T.serializeUsing_(serialization_, value_);
|
|
144
|
-
ff_core_Serializable.Serialization_autoResize(serialization_, 4);
|
|
145
|
-
ff_core_Buffer.Buffer_setInt32(serialization_.buffer_, serialization_.offset_, serialization_.checksum_, true);
|
|
146
|
-
serialization_.offset_ += 4;
|
|
147
|
-
return ff_core_Buffer.Buffer_view(serialization_.buffer_, 0, serialization_.offset_)
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export async function deserialize_$(buffer_, ff_core_Serializable_Serializable$T, $task) {
|
|
151
|
-
const serialization_ = ff_core_Serializable.Serialization(buffer_, 0, 0);
|
|
152
|
-
const result_ = ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_);
|
|
153
|
-
const checksum_ = ff_core_Buffer.Buffer_grabInt32(serialization_.buffer_, serialization_.offset_, true);
|
|
154
|
-
if((checksum_ !== serialization_.checksum_)) {
|
|
155
|
-
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
|
|
156
|
-
};
|
|
157
|
-
return result_
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export async function internalSetLatin1_$(self_, byteOffset_, value_, $task) {
|
|
161
|
-
throw new Error('Function internalSetLatin1 is missing on this target in async context.');
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export async function internalGrabLatin1_$(self_, byteOffset_, size_, $task) {
|
|
165
|
-
throw new Error('Function internalGrabLatin1 is missing on this target in async context.');
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export function Serialization_autoResize(self_, minSpareCapacity_) {
|
|
169
|
-
if(((self_.offset_ + minSpareCapacity_) > ff_core_Buffer.Buffer_size(self_.buffer_))) {
|
|
170
|
-
const minSize_ = (ff_core_Buffer.Buffer_size(self_.buffer_) + minSpareCapacity_);
|
|
171
|
-
const newBuffer_ = ff_core_Buffer.make_(ff_core_Int.Int_max((ff_core_Buffer.Buffer_size(self_.buffer_) * 2), minSize_), false);
|
|
172
|
-
ff_core_Buffer.Buffer_setAll(newBuffer_, 0, self_.buffer_);
|
|
173
|
-
self_.buffer_ = newBuffer_
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export async function Serialization_autoResize$(self_, minSpareCapacity_, $task) {
|
|
178
|
-
if(((self_.offset_ + minSpareCapacity_) > ff_core_Buffer.Buffer_size(self_.buffer_))) {
|
|
179
|
-
const minSize_ = (ff_core_Buffer.Buffer_size(self_.buffer_) + minSpareCapacity_);
|
|
180
|
-
const newBuffer_ = ff_core_Buffer.make_(ff_core_Int.Int_max((ff_core_Buffer.Buffer_size(self_.buffer_) * 2), minSize_), false);
|
|
181
|
-
ff_core_Buffer.Buffer_setAll(newBuffer_, 0, self_.buffer_);
|
|
182
|
-
self_.buffer_ = newBuffer_
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export const ff_core_Serializable_Serializable$ff_core_Int_Int = {
|
|
187
|
-
serializeUsing_(serialization_, value_) {
|
|
188
|
-
ff_core_Serializable.Serialization_autoResize(serialization_, 8);
|
|
189
|
-
ff_core_Buffer.Buffer_setInt64(serialization_.buffer_, serialization_.offset_, value_, true);
|
|
190
|
-
serialization_.offset_ += 8
|
|
191
|
-
},
|
|
192
|
-
deserializeUsing_(serialization_) {
|
|
193
|
-
const result_ = ff_core_Buffer.Buffer_grabInt64(serialization_.buffer_, serialization_.offset_, true);
|
|
194
|
-
serialization_.offset_ += 8;
|
|
195
|
-
return result_
|
|
196
|
-
},
|
|
197
|
-
async serializeUsing_$(serialization_, value_, $task) {
|
|
198
|
-
ff_core_Serializable.Serialization_autoResize(serialization_, 8);
|
|
199
|
-
ff_core_Buffer.Buffer_setInt64(serialization_.buffer_, serialization_.offset_, value_, true);
|
|
200
|
-
serialization_.offset_ += 8
|
|
201
|
-
},
|
|
202
|
-
async deserializeUsing_$(serialization_, $task) {
|
|
203
|
-
const result_ = ff_core_Buffer.Buffer_grabInt64(serialization_.buffer_, serialization_.offset_, true);
|
|
204
|
-
serialization_.offset_ += 8;
|
|
205
|
-
return result_
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
export const ff_core_Serializable_Serializable$ff_core_Bool_Bool = {
|
|
210
|
-
serializeUsing_(serialization_, value_) {
|
|
211
|
-
ff_core_Serializable.Serialization_autoResize(serialization_, 1);
|
|
212
|
-
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, (value_
|
|
213
|
-
? 1
|
|
214
|
-
: 0));
|
|
215
|
-
serialization_.offset_ += 1
|
|
216
|
-
},
|
|
217
|
-
deserializeUsing_(serialization_) {
|
|
218
|
-
const result_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
|
|
219
|
-
serialization_.offset_ += 1;
|
|
220
|
-
return (result_ === 1)
|
|
221
|
-
},
|
|
222
|
-
async serializeUsing_$(serialization_, value_, $task) {
|
|
223
|
-
ff_core_Serializable.Serialization_autoResize(serialization_, 1);
|
|
224
|
-
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, (value_
|
|
225
|
-
? 1
|
|
226
|
-
: 0));
|
|
227
|
-
serialization_.offset_ += 1
|
|
228
|
-
},
|
|
229
|
-
async deserializeUsing_$(serialization_, $task) {
|
|
230
|
-
const result_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
|
|
231
|
-
serialization_.offset_ += 1;
|
|
232
|
-
return (result_ === 1)
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
export function ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T) { return {
|
|
237
|
-
serializeUsing_(serialization_, value_) {
|
|
238
|
-
if((ff_core_Array.Array_size(value_) < 255)) {
|
|
239
|
-
ff_core_Serializable.Serialization_autoResize(serialization_, 1);
|
|
240
|
-
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, ff_core_Array.Array_size(value_));
|
|
241
|
-
serialization_.offset_ += 1
|
|
242
|
-
} else if((ff_core_Array.Array_size(value_) < 1073741824)) {
|
|
243
|
-
ff_core_Serializable.Serialization_autoResize(serialization_, (1 + 4));
|
|
244
|
-
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 255);
|
|
245
|
-
ff_core_Buffer.Buffer_setUint32(serialization_.buffer_, (1 + serialization_.offset_), ff_core_Array.Array_size(value_), true);
|
|
246
|
-
serialization_.offset_ += (1 + 4)
|
|
247
|
-
} else {
|
|
248
|
-
ff_core_Core.panic_("Can't serialize arrays where size() >= 1073741824")
|
|
249
|
-
};
|
|
250
|
-
ff_core_Array.Array_each(value_, ((_w1) => {
|
|
251
|
-
ff_core_Serializable_Serializable$T.serializeUsing_(serialization_, _w1)
|
|
252
|
-
}))
|
|
253
|
-
},
|
|
254
|
-
deserializeUsing_(serialization_) {
|
|
255
|
-
const smallSize_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
|
|
256
|
-
if((smallSize_ !== 255)) {
|
|
257
|
-
serialization_.offset_ += 1;
|
|
258
|
-
return ((() => {
|
|
259
|
-
const size = smallSize_;
|
|
260
|
-
const result = [];
|
|
261
|
-
for(let i = 0; i < size; i++) {
|
|
262
|
-
result.push(ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_));
|
|
263
|
-
}
|
|
264
|
-
return result;
|
|
265
|
-
})())
|
|
266
|
-
} else {
|
|
267
|
-
const size_ = ff_core_Buffer.Buffer_grabUint32(serialization_.buffer_, (serialization_.offset_ + 1), true);
|
|
268
|
-
serialization_.offset_ += (1 + 4);
|
|
269
|
-
return ((() => {
|
|
270
|
-
const size = size_;
|
|
271
|
-
const result = [];
|
|
272
|
-
for(let i = 0; i < size; i++) {
|
|
273
|
-
result.push(ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_));
|
|
274
|
-
}
|
|
275
|
-
return result;
|
|
276
|
-
})())
|
|
277
|
-
}
|
|
278
|
-
},
|
|
279
|
-
async serializeUsing_$(serialization_, value_, $task) {
|
|
280
|
-
if((ff_core_Array.Array_size(value_) < 255)) {
|
|
281
|
-
ff_core_Serializable.Serialization_autoResize(serialization_, 1);
|
|
282
|
-
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, ff_core_Array.Array_size(value_));
|
|
283
|
-
serialization_.offset_ += 1
|
|
284
|
-
} else if((ff_core_Array.Array_size(value_) < 1073741824)) {
|
|
285
|
-
ff_core_Serializable.Serialization_autoResize(serialization_, (1 + 4));
|
|
286
|
-
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 255);
|
|
287
|
-
ff_core_Buffer.Buffer_setUint32(serialization_.buffer_, (1 + serialization_.offset_), ff_core_Array.Array_size(value_), true);
|
|
288
|
-
serialization_.offset_ += (1 + 4)
|
|
289
|
-
} else {
|
|
290
|
-
ff_core_Core.panic_("Can't serialize arrays where size() >= 1073741824")
|
|
291
|
-
};
|
|
292
|
-
ff_core_Array.Array_each(value_, ((_w1) => {
|
|
293
|
-
ff_core_Serializable_Serializable$T.serializeUsing_(serialization_, _w1)
|
|
294
|
-
}))
|
|
295
|
-
},
|
|
296
|
-
async deserializeUsing_$(serialization_, $task) {
|
|
297
|
-
const smallSize_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
|
|
298
|
-
if((smallSize_ !== 255)) {
|
|
299
|
-
serialization_.offset_ += 1;
|
|
300
|
-
return ((() => {
|
|
301
|
-
const size = smallSize_;
|
|
302
|
-
const result = [];
|
|
303
|
-
for(let i = 0; i < size; i++) {
|
|
304
|
-
result.push(ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_));
|
|
305
|
-
}
|
|
306
|
-
return result;
|
|
307
|
-
})())
|
|
308
|
-
} else {
|
|
309
|
-
const size_ = ff_core_Buffer.Buffer_grabUint32(serialization_.buffer_, (serialization_.offset_ + 1), true);
|
|
310
|
-
serialization_.offset_ += (1 + 4);
|
|
311
|
-
return ((() => {
|
|
312
|
-
const size = size_;
|
|
313
|
-
const result = [];
|
|
314
|
-
for(let i = 0; i < size; i++) {
|
|
315
|
-
result.push(ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_));
|
|
316
|
-
}
|
|
317
|
-
return result;
|
|
318
|
-
})())
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}}
|
|
322
|
-
|
|
323
|
-
export function ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Serializable_Serializable$T) { return {
|
|
324
|
-
serializeUsing_(serialization_, value_) {
|
|
325
|
-
ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).serializeUsing_(serialization_, ff_core_List.List_toArray(value_))
|
|
326
|
-
},
|
|
327
|
-
deserializeUsing_(serialization_) {
|
|
328
|
-
return ff_core_Array.Array_toList(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).deserializeUsing_(serialization_))
|
|
329
|
-
},
|
|
330
|
-
async serializeUsing_$(serialization_, value_, $task) {
|
|
331
|
-
ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).serializeUsing_(serialization_, ff_core_List.List_toArray(value_))
|
|
332
|
-
},
|
|
333
|
-
async deserializeUsing_$(serialization_, $task) {
|
|
334
|
-
return ff_core_Array.Array_toList(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).deserializeUsing_(serialization_))
|
|
335
|
-
}
|
|
336
|
-
}}
|
|
337
|
-
|
|
338
|
-
export function ff_core_Serializable_Serializable$ff_core_Set_Set(ff_core_Serializable_Serializable$T, ff_core_Ordering_Order$T) { return {
|
|
339
|
-
serializeUsing_(serialization_, value_) {
|
|
340
|
-
ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).serializeUsing_(serialization_, ff_core_Set.Set_toArray(value_, ff_core_Ordering_Order$T))
|
|
341
|
-
},
|
|
342
|
-
deserializeUsing_(serialization_) {
|
|
343
|
-
return ff_core_Array.Array_toSet(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).deserializeUsing_(serialization_), ff_core_Ordering_Order$T)
|
|
344
|
-
},
|
|
345
|
-
async serializeUsing_$(serialization_, value_, $task) {
|
|
346
|
-
ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).serializeUsing_(serialization_, ff_core_Set.Set_toArray(value_, ff_core_Ordering_Order$T))
|
|
347
|
-
},
|
|
348
|
-
async deserializeUsing_$(serialization_, $task) {
|
|
349
|
-
return ff_core_Array.Array_toSet(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).deserializeUsing_(serialization_), ff_core_Ordering_Order$T)
|
|
350
|
-
}
|
|
351
|
-
}}
|
|
352
|
-
|
|
353
|
-
export function ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable_Serializable$K, ff_core_Ordering_Order$K, ff_core_Serializable_Serializable$V) { return {
|
|
354
|
-
serializeUsing_(serialization_, value_) {
|
|
355
|
-
ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable_Serializable$K, ff_core_Serializable_Serializable$V)).serializeUsing_(serialization_, ff_core_Map.Map_toArray(value_, ff_core_Ordering_Order$K))
|
|
356
|
-
},
|
|
357
|
-
deserializeUsing_(serialization_) {
|
|
358
|
-
return ff_core_Array.Array_toMap(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable_Serializable$K, ff_core_Serializable_Serializable$V)).deserializeUsing_(serialization_), ff_core_Ordering_Order$K)
|
|
359
|
-
},
|
|
360
|
-
async serializeUsing_$(serialization_, value_, $task) {
|
|
361
|
-
ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable_Serializable$K, ff_core_Serializable_Serializable$V)).serializeUsing_(serialization_, ff_core_Map.Map_toArray(value_, ff_core_Ordering_Order$K))
|
|
362
|
-
},
|
|
363
|
-
async deserializeUsing_$(serialization_, $task) {
|
|
364
|
-
return ff_core_Array.Array_toMap(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable_Serializable$K, ff_core_Serializable_Serializable$V)).deserializeUsing_(serialization_), ff_core_Ordering_Order$K)
|
|
365
|
-
}
|
|
366
|
-
}}
|
|
367
|
-
|
|
368
|
-
export const ff_core_Serializable_Serializable$ff_core_String_String = {
|
|
369
|
-
serializeUsing_(serialization_, value_) {
|
|
370
|
-
ff_core_Serializable.Serialization_autoResize(serialization_, (1 + ff_core_String.String_size(value_)));
|
|
371
|
-
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, ff_core_String.String_size(value_));
|
|
372
|
-
if(((ff_core_String.String_size(value_) < 255) && ff_core_Serializable.internalSetLatin1_(serialization_.buffer_, (serialization_.offset_ + 1), value_))) {
|
|
373
|
-
serialization_.offset_ += (1 + ff_core_String.String_size(value_))
|
|
374
|
-
} else if((ff_core_String.String_size(value_) < 1073741824)) {
|
|
375
|
-
const stringBuffer_ = ff_core_String.String_toBuffer(value_);
|
|
376
|
-
ff_core_Serializable.Serialization_autoResize(serialization_, (5 + ff_core_Buffer.Buffer_size(stringBuffer_)));
|
|
377
|
-
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 255);
|
|
378
|
-
ff_core_Buffer.Buffer_setUint32(serialization_.buffer_, (serialization_.offset_ + 1), ff_core_Buffer.Buffer_size(stringBuffer_), true);
|
|
379
|
-
ff_core_Buffer.Buffer_setAll(serialization_.buffer_, (serialization_.offset_ + 5), stringBuffer_);
|
|
380
|
-
serialization_.offset_ += (5 + ff_core_Buffer.Buffer_size(stringBuffer_))
|
|
381
|
-
} else {
|
|
382
|
-
ff_core_Core.panic_("Can't serialize strings where size() >= 1073741824")
|
|
383
|
-
}
|
|
384
|
-
},
|
|
385
|
-
deserializeUsing_(serialization_) {
|
|
386
|
-
const smallSize_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
|
|
387
|
-
if((smallSize_ !== 255)) {
|
|
388
|
-
const result_ = ff_core_Serializable.internalGrabLatin1_(serialization_.buffer_, (serialization_.offset_ + 1), smallSize_);
|
|
389
|
-
serialization_.offset_ += (1 + smallSize_);
|
|
390
|
-
return result_
|
|
391
|
-
} else {
|
|
392
|
-
const size_ = ff_core_Buffer.Buffer_grabUint32(serialization_.buffer_, (serialization_.offset_ + 1), true);
|
|
393
|
-
const stringBuffer_ = ff_core_Buffer.Buffer_view(serialization_.buffer_, (serialization_.offset_ + 5), ((serialization_.offset_ + 5) + size_));
|
|
394
|
-
serialization_.offset_ += (5 + size_);
|
|
395
|
-
return ff_core_Buffer.Buffer_toString(stringBuffer_, "utf8")
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
async serializeUsing_$(serialization_, value_, $task) {
|
|
399
|
-
ff_core_Serializable.Serialization_autoResize(serialization_, (1 + ff_core_String.String_size(value_)));
|
|
400
|
-
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, ff_core_String.String_size(value_));
|
|
401
|
-
if(((ff_core_String.String_size(value_) < 255) && ff_core_Serializable.internalSetLatin1_(serialization_.buffer_, (serialization_.offset_ + 1), value_))) {
|
|
402
|
-
serialization_.offset_ += (1 + ff_core_String.String_size(value_))
|
|
403
|
-
} else if((ff_core_String.String_size(value_) < 1073741824)) {
|
|
404
|
-
const stringBuffer_ = ff_core_String.String_toBuffer(value_);
|
|
405
|
-
ff_core_Serializable.Serialization_autoResize(serialization_, (5 + ff_core_Buffer.Buffer_size(stringBuffer_)));
|
|
406
|
-
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 255);
|
|
407
|
-
ff_core_Buffer.Buffer_setUint32(serialization_.buffer_, (serialization_.offset_ + 1), ff_core_Buffer.Buffer_size(stringBuffer_), true);
|
|
408
|
-
ff_core_Buffer.Buffer_setAll(serialization_.buffer_, (serialization_.offset_ + 5), stringBuffer_);
|
|
409
|
-
serialization_.offset_ += (5 + ff_core_Buffer.Buffer_size(stringBuffer_))
|
|
410
|
-
} else {
|
|
411
|
-
ff_core_Core.panic_("Can't serialize strings where size() >= 1073741824")
|
|
412
|
-
}
|
|
413
|
-
},
|
|
414
|
-
async deserializeUsing_$(serialization_, $task) {
|
|
415
|
-
const smallSize_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
|
|
416
|
-
if((smallSize_ !== 255)) {
|
|
417
|
-
const result_ = ff_core_Serializable.internalGrabLatin1_(serialization_.buffer_, (serialization_.offset_ + 1), smallSize_);
|
|
418
|
-
serialization_.offset_ += (1 + smallSize_);
|
|
419
|
-
return result_
|
|
420
|
-
} else {
|
|
421
|
-
const size_ = ff_core_Buffer.Buffer_grabUint32(serialization_.buffer_, (serialization_.offset_ + 1), true);
|
|
422
|
-
const stringBuffer_ = ff_core_Buffer.Buffer_view(serialization_.buffer_, (serialization_.offset_ + 5), ((serialization_.offset_ + 5) + size_));
|
|
423
|
-
serialization_.offset_ += (5 + size_);
|
|
424
|
-
return ff_core_Buffer.Buffer_toString(stringBuffer_, "utf8")
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
};
|
|
428
|
-
|
|
429
|
-
export const ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException = {
|
|
430
|
-
anyTag_() {
|
|
431
|
-
return ff_core_Any.internalAnyTag_((("ff:core/Serializable.DeserializationChecksumException" + "[") + "]"))
|
|
432
|
-
},
|
|
433
|
-
async anyTag_$($task) {
|
|
434
|
-
return ff_core_Any.internalAnyTag_((("ff:core/Serializable.DeserializationChecksumException" + "[") + "]"))
|
|
435
|
-
}
|
|
436
|
-
};
|
|
437
|
-
|
|
438
|
-
|
|
142
|
+
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export async function serialize_$(value_, initialBufferSize_ = 1024, ff_core_Serializable_Serializable$T, $task) {
|
|
146
|
+
const serialization_ = ff_core_Serializable.Serialization(ff_core_Buffer.make_(initialBufferSize_, false), 0, 0);
|
|
147
|
+
ff_core_Serializable_Serializable$T.serializeUsing_(serialization_, value_);
|
|
148
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, 4);
|
|
149
|
+
ff_core_Buffer.Buffer_setInt32(serialization_.buffer_, serialization_.offset_, serialization_.checksum_, true);
|
|
150
|
+
serialization_.offset_ += 4;
|
|
151
|
+
return ff_core_Buffer.Buffer_view(serialization_.buffer_, 0, serialization_.offset_)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export async function deserialize_$(buffer_, ff_core_Serializable_Serializable$T, $task) {
|
|
155
|
+
const serialization_ = ff_core_Serializable.Serialization(buffer_, 0, 0);
|
|
156
|
+
const result_ = ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_);
|
|
157
|
+
const checksum_ = ff_core_Buffer.Buffer_grabInt32(serialization_.buffer_, serialization_.offset_, true);
|
|
158
|
+
if((checksum_ !== serialization_.checksum_)) {
|
|
159
|
+
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_core_Serializable.DeserializationChecksumException(), ff_core_Serializable.ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException)})
|
|
160
|
+
};
|
|
161
|
+
return result_
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export async function internalSetLatin1_$(self_, byteOffset_, value_, $task) {
|
|
165
|
+
throw new Error('Function internalSetLatin1 is missing on this target in async context.');
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export async function internalGrabLatin1_$(self_, byteOffset_, size_, $task) {
|
|
169
|
+
throw new Error('Function internalGrabLatin1 is missing on this target in async context.');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export function Serialization_autoResize(self_, minSpareCapacity_) {
|
|
173
|
+
if(((self_.offset_ + minSpareCapacity_) > ff_core_Buffer.Buffer_size(self_.buffer_))) {
|
|
174
|
+
const minSize_ = (ff_core_Buffer.Buffer_size(self_.buffer_) + minSpareCapacity_);
|
|
175
|
+
const newBuffer_ = ff_core_Buffer.make_(ff_core_Int.Int_max((ff_core_Buffer.Buffer_size(self_.buffer_) * 2), minSize_), false);
|
|
176
|
+
ff_core_Buffer.Buffer_setAll(newBuffer_, 0, self_.buffer_);
|
|
177
|
+
self_.buffer_ = newBuffer_
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export async function Serialization_autoResize$(self_, minSpareCapacity_, $task) {
|
|
182
|
+
if(((self_.offset_ + minSpareCapacity_) > ff_core_Buffer.Buffer_size(self_.buffer_))) {
|
|
183
|
+
const minSize_ = (ff_core_Buffer.Buffer_size(self_.buffer_) + minSpareCapacity_);
|
|
184
|
+
const newBuffer_ = ff_core_Buffer.make_(ff_core_Int.Int_max((ff_core_Buffer.Buffer_size(self_.buffer_) * 2), minSize_), false);
|
|
185
|
+
ff_core_Buffer.Buffer_setAll(newBuffer_, 0, self_.buffer_);
|
|
186
|
+
self_.buffer_ = newBuffer_
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export const ff_core_Serializable_Serializable$ff_core_Int_Int = {
|
|
191
|
+
serializeUsing_(serialization_, value_) {
|
|
192
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, 8);
|
|
193
|
+
ff_core_Buffer.Buffer_setInt64(serialization_.buffer_, serialization_.offset_, value_, true);
|
|
194
|
+
serialization_.offset_ += 8
|
|
195
|
+
},
|
|
196
|
+
deserializeUsing_(serialization_) {
|
|
197
|
+
const result_ = ff_core_Buffer.Buffer_grabInt64(serialization_.buffer_, serialization_.offset_, true);
|
|
198
|
+
serialization_.offset_ += 8;
|
|
199
|
+
return result_
|
|
200
|
+
},
|
|
201
|
+
async serializeUsing_$(serialization_, value_, $task) {
|
|
202
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, 8);
|
|
203
|
+
ff_core_Buffer.Buffer_setInt64(serialization_.buffer_, serialization_.offset_, value_, true);
|
|
204
|
+
serialization_.offset_ += 8
|
|
205
|
+
},
|
|
206
|
+
async deserializeUsing_$(serialization_, $task) {
|
|
207
|
+
const result_ = ff_core_Buffer.Buffer_grabInt64(serialization_.buffer_, serialization_.offset_, true);
|
|
208
|
+
serialization_.offset_ += 8;
|
|
209
|
+
return result_
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export const ff_core_Serializable_Serializable$ff_core_Bool_Bool = {
|
|
214
|
+
serializeUsing_(serialization_, value_) {
|
|
215
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, 1);
|
|
216
|
+
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, (value_
|
|
217
|
+
? 1
|
|
218
|
+
: 0));
|
|
219
|
+
serialization_.offset_ += 1
|
|
220
|
+
},
|
|
221
|
+
deserializeUsing_(serialization_) {
|
|
222
|
+
const result_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
|
|
223
|
+
serialization_.offset_ += 1;
|
|
224
|
+
return (result_ === 1)
|
|
225
|
+
},
|
|
226
|
+
async serializeUsing_$(serialization_, value_, $task) {
|
|
227
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, 1);
|
|
228
|
+
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, (value_
|
|
229
|
+
? 1
|
|
230
|
+
: 0));
|
|
231
|
+
serialization_.offset_ += 1
|
|
232
|
+
},
|
|
233
|
+
async deserializeUsing_$(serialization_, $task) {
|
|
234
|
+
const result_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
|
|
235
|
+
serialization_.offset_ += 1;
|
|
236
|
+
return (result_ === 1)
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
export function ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T) { return {
|
|
241
|
+
serializeUsing_(serialization_, value_) {
|
|
242
|
+
if((ff_core_Array.Array_size(value_) < 255)) {
|
|
243
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, 1);
|
|
244
|
+
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, ff_core_Array.Array_size(value_));
|
|
245
|
+
serialization_.offset_ += 1
|
|
246
|
+
} else if((ff_core_Array.Array_size(value_) < 1073741824)) {
|
|
247
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, (1 + 4));
|
|
248
|
+
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 255);
|
|
249
|
+
ff_core_Buffer.Buffer_setUint32(serialization_.buffer_, (1 + serialization_.offset_), ff_core_Array.Array_size(value_), true);
|
|
250
|
+
serialization_.offset_ += (1 + 4)
|
|
251
|
+
} else {
|
|
252
|
+
ff_core_Core.panic_("Can't serialize arrays where size() >= 1073741824")
|
|
253
|
+
};
|
|
254
|
+
ff_core_Array.Array_each(value_, ((_w1) => {
|
|
255
|
+
ff_core_Serializable_Serializable$T.serializeUsing_(serialization_, _w1)
|
|
256
|
+
}))
|
|
257
|
+
},
|
|
258
|
+
deserializeUsing_(serialization_) {
|
|
259
|
+
const smallSize_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
|
|
260
|
+
if((smallSize_ !== 255)) {
|
|
261
|
+
serialization_.offset_ += 1;
|
|
262
|
+
return ((() => {
|
|
263
|
+
const size = smallSize_;
|
|
264
|
+
const result = [];
|
|
265
|
+
for(let i = 0; i < size; i++) {
|
|
266
|
+
result.push(ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_));
|
|
267
|
+
}
|
|
268
|
+
return result;
|
|
269
|
+
})())
|
|
270
|
+
} else {
|
|
271
|
+
const size_ = ff_core_Buffer.Buffer_grabUint32(serialization_.buffer_, (serialization_.offset_ + 1), true);
|
|
272
|
+
serialization_.offset_ += (1 + 4);
|
|
273
|
+
return ((() => {
|
|
274
|
+
const size = size_;
|
|
275
|
+
const result = [];
|
|
276
|
+
for(let i = 0; i < size; i++) {
|
|
277
|
+
result.push(ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_));
|
|
278
|
+
}
|
|
279
|
+
return result;
|
|
280
|
+
})())
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
async serializeUsing_$(serialization_, value_, $task) {
|
|
284
|
+
if((ff_core_Array.Array_size(value_) < 255)) {
|
|
285
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, 1);
|
|
286
|
+
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, ff_core_Array.Array_size(value_));
|
|
287
|
+
serialization_.offset_ += 1
|
|
288
|
+
} else if((ff_core_Array.Array_size(value_) < 1073741824)) {
|
|
289
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, (1 + 4));
|
|
290
|
+
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 255);
|
|
291
|
+
ff_core_Buffer.Buffer_setUint32(serialization_.buffer_, (1 + serialization_.offset_), ff_core_Array.Array_size(value_), true);
|
|
292
|
+
serialization_.offset_ += (1 + 4)
|
|
293
|
+
} else {
|
|
294
|
+
ff_core_Core.panic_("Can't serialize arrays where size() >= 1073741824")
|
|
295
|
+
};
|
|
296
|
+
ff_core_Array.Array_each(value_, ((_w1) => {
|
|
297
|
+
ff_core_Serializable_Serializable$T.serializeUsing_(serialization_, _w1)
|
|
298
|
+
}))
|
|
299
|
+
},
|
|
300
|
+
async deserializeUsing_$(serialization_, $task) {
|
|
301
|
+
const smallSize_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
|
|
302
|
+
if((smallSize_ !== 255)) {
|
|
303
|
+
serialization_.offset_ += 1;
|
|
304
|
+
return ((() => {
|
|
305
|
+
const size = smallSize_;
|
|
306
|
+
const result = [];
|
|
307
|
+
for(let i = 0; i < size; i++) {
|
|
308
|
+
result.push(ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_));
|
|
309
|
+
}
|
|
310
|
+
return result;
|
|
311
|
+
})())
|
|
312
|
+
} else {
|
|
313
|
+
const size_ = ff_core_Buffer.Buffer_grabUint32(serialization_.buffer_, (serialization_.offset_ + 1), true);
|
|
314
|
+
serialization_.offset_ += (1 + 4);
|
|
315
|
+
return ((() => {
|
|
316
|
+
const size = size_;
|
|
317
|
+
const result = [];
|
|
318
|
+
for(let i = 0; i < size; i++) {
|
|
319
|
+
result.push(ff_core_Serializable_Serializable$T.deserializeUsing_(serialization_));
|
|
320
|
+
}
|
|
321
|
+
return result;
|
|
322
|
+
})())
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}}
|
|
326
|
+
|
|
327
|
+
export function ff_core_Serializable_Serializable$ff_core_List_List(ff_core_Serializable_Serializable$T) { return {
|
|
328
|
+
serializeUsing_(serialization_, value_) {
|
|
329
|
+
ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).serializeUsing_(serialization_, ff_core_List.List_toArray(value_))
|
|
330
|
+
},
|
|
331
|
+
deserializeUsing_(serialization_) {
|
|
332
|
+
return ff_core_Array.Array_toList(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).deserializeUsing_(serialization_))
|
|
333
|
+
},
|
|
334
|
+
async serializeUsing_$(serialization_, value_, $task) {
|
|
335
|
+
ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).serializeUsing_(serialization_, ff_core_List.List_toArray(value_))
|
|
336
|
+
},
|
|
337
|
+
async deserializeUsing_$(serialization_, $task) {
|
|
338
|
+
return ff_core_Array.Array_toList(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).deserializeUsing_(serialization_))
|
|
339
|
+
}
|
|
340
|
+
}}
|
|
341
|
+
|
|
342
|
+
export function ff_core_Serializable_Serializable$ff_core_Set_Set(ff_core_Serializable_Serializable$T, ff_core_Ordering_Order$T) { return {
|
|
343
|
+
serializeUsing_(serialization_, value_) {
|
|
344
|
+
ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).serializeUsing_(serialization_, ff_core_Set.Set_toArray(value_, ff_core_Ordering_Order$T))
|
|
345
|
+
},
|
|
346
|
+
deserializeUsing_(serialization_) {
|
|
347
|
+
return ff_core_Array.Array_toSet(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).deserializeUsing_(serialization_), ff_core_Ordering_Order$T)
|
|
348
|
+
},
|
|
349
|
+
async serializeUsing_$(serialization_, value_, $task) {
|
|
350
|
+
ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).serializeUsing_(serialization_, ff_core_Set.Set_toArray(value_, ff_core_Ordering_Order$T))
|
|
351
|
+
},
|
|
352
|
+
async deserializeUsing_$(serialization_, $task) {
|
|
353
|
+
return ff_core_Array.Array_toSet(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Serializable_Serializable$T).deserializeUsing_(serialization_), ff_core_Ordering_Order$T)
|
|
354
|
+
}
|
|
355
|
+
}}
|
|
356
|
+
|
|
357
|
+
export function ff_core_Serializable_Serializable$ff_core_Map_Map(ff_core_Serializable_Serializable$K, ff_core_Ordering_Order$K, ff_core_Serializable_Serializable$V) { return {
|
|
358
|
+
serializeUsing_(serialization_, value_) {
|
|
359
|
+
ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable_Serializable$K, ff_core_Serializable_Serializable$V)).serializeUsing_(serialization_, ff_core_Map.Map_toArray(value_, ff_core_Ordering_Order$K))
|
|
360
|
+
},
|
|
361
|
+
deserializeUsing_(serialization_) {
|
|
362
|
+
return ff_core_Array.Array_toMap(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable_Serializable$K, ff_core_Serializable_Serializable$V)).deserializeUsing_(serialization_), ff_core_Ordering_Order$K)
|
|
363
|
+
},
|
|
364
|
+
async serializeUsing_$(serialization_, value_, $task) {
|
|
365
|
+
ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable_Serializable$K, ff_core_Serializable_Serializable$V)).serializeUsing_(serialization_, ff_core_Map.Map_toArray(value_, ff_core_Ordering_Order$K))
|
|
366
|
+
},
|
|
367
|
+
async deserializeUsing_$(serialization_, $task) {
|
|
368
|
+
return ff_core_Array.Array_toMap(ff_core_Serializable.ff_core_Serializable_Serializable$ff_core_Array_Array(ff_core_Pair.ff_core_Serializable_Serializable$ff_core_Pair_Pair(ff_core_Serializable_Serializable$K, ff_core_Serializable_Serializable$V)).deserializeUsing_(serialization_), ff_core_Ordering_Order$K)
|
|
369
|
+
}
|
|
370
|
+
}}
|
|
371
|
+
|
|
372
|
+
export const ff_core_Serializable_Serializable$ff_core_String_String = {
|
|
373
|
+
serializeUsing_(serialization_, value_) {
|
|
374
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, (1 + ff_core_String.String_size(value_)));
|
|
375
|
+
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, ff_core_String.String_size(value_));
|
|
376
|
+
if(((ff_core_String.String_size(value_) < 255) && ff_core_Serializable.internalSetLatin1_(serialization_.buffer_, (serialization_.offset_ + 1), value_))) {
|
|
377
|
+
serialization_.offset_ += (1 + ff_core_String.String_size(value_))
|
|
378
|
+
} else if((ff_core_String.String_size(value_) < 1073741824)) {
|
|
379
|
+
const stringBuffer_ = ff_core_String.String_toBuffer(value_);
|
|
380
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, (5 + ff_core_Buffer.Buffer_size(stringBuffer_)));
|
|
381
|
+
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 255);
|
|
382
|
+
ff_core_Buffer.Buffer_setUint32(serialization_.buffer_, (serialization_.offset_ + 1), ff_core_Buffer.Buffer_size(stringBuffer_), true);
|
|
383
|
+
ff_core_Buffer.Buffer_setAll(serialization_.buffer_, (serialization_.offset_ + 5), stringBuffer_);
|
|
384
|
+
serialization_.offset_ += (5 + ff_core_Buffer.Buffer_size(stringBuffer_))
|
|
385
|
+
} else {
|
|
386
|
+
ff_core_Core.panic_("Can't serialize strings where size() >= 1073741824")
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
deserializeUsing_(serialization_) {
|
|
390
|
+
const smallSize_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
|
|
391
|
+
if((smallSize_ !== 255)) {
|
|
392
|
+
const result_ = ff_core_Serializable.internalGrabLatin1_(serialization_.buffer_, (serialization_.offset_ + 1), smallSize_);
|
|
393
|
+
serialization_.offset_ += (1 + smallSize_);
|
|
394
|
+
return result_
|
|
395
|
+
} else {
|
|
396
|
+
const size_ = ff_core_Buffer.Buffer_grabUint32(serialization_.buffer_, (serialization_.offset_ + 1), true);
|
|
397
|
+
const stringBuffer_ = ff_core_Buffer.Buffer_view(serialization_.buffer_, (serialization_.offset_ + 5), ((serialization_.offset_ + 5) + size_));
|
|
398
|
+
serialization_.offset_ += (5 + size_);
|
|
399
|
+
return ff_core_Buffer.Buffer_toString(stringBuffer_, "utf8")
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
async serializeUsing_$(serialization_, value_, $task) {
|
|
403
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, (1 + ff_core_String.String_size(value_)));
|
|
404
|
+
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, ff_core_String.String_size(value_));
|
|
405
|
+
if(((ff_core_String.String_size(value_) < 255) && ff_core_Serializable.internalSetLatin1_(serialization_.buffer_, (serialization_.offset_ + 1), value_))) {
|
|
406
|
+
serialization_.offset_ += (1 + ff_core_String.String_size(value_))
|
|
407
|
+
} else if((ff_core_String.String_size(value_) < 1073741824)) {
|
|
408
|
+
const stringBuffer_ = ff_core_String.String_toBuffer(value_);
|
|
409
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, (5 + ff_core_Buffer.Buffer_size(stringBuffer_)));
|
|
410
|
+
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 255);
|
|
411
|
+
ff_core_Buffer.Buffer_setUint32(serialization_.buffer_, (serialization_.offset_ + 1), ff_core_Buffer.Buffer_size(stringBuffer_), true);
|
|
412
|
+
ff_core_Buffer.Buffer_setAll(serialization_.buffer_, (serialization_.offset_ + 5), stringBuffer_);
|
|
413
|
+
serialization_.offset_ += (5 + ff_core_Buffer.Buffer_size(stringBuffer_))
|
|
414
|
+
} else {
|
|
415
|
+
ff_core_Core.panic_("Can't serialize strings where size() >= 1073741824")
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
async deserializeUsing_$(serialization_, $task) {
|
|
419
|
+
const smallSize_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
|
|
420
|
+
if((smallSize_ !== 255)) {
|
|
421
|
+
const result_ = ff_core_Serializable.internalGrabLatin1_(serialization_.buffer_, (serialization_.offset_ + 1), smallSize_);
|
|
422
|
+
serialization_.offset_ += (1 + smallSize_);
|
|
423
|
+
return result_
|
|
424
|
+
} else {
|
|
425
|
+
const size_ = ff_core_Buffer.Buffer_grabUint32(serialization_.buffer_, (serialization_.offset_ + 1), true);
|
|
426
|
+
const stringBuffer_ = ff_core_Buffer.Buffer_view(serialization_.buffer_, (serialization_.offset_ + 5), ((serialization_.offset_ + 5) + size_));
|
|
427
|
+
serialization_.offset_ += (5 + size_);
|
|
428
|
+
return ff_core_Buffer.Buffer_toString(stringBuffer_, "utf8")
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
export const ff_core_Any_HasAnyTag$ff_core_Serializable_DeserializationChecksumException = {
|
|
434
|
+
anyTag_() {
|
|
435
|
+
return ff_core_Any.internalAnyTag_((("ff:core/Serializable.DeserializationChecksumException" + "[") + "]"))
|
|
436
|
+
},
|
|
437
|
+
async anyTag_$($task) {
|
|
438
|
+
return ff_core_Any.internalAnyTag_((("ff:core/Serializable.DeserializationChecksumException" + "[") + "]"))
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
|