firefly-compiler 0.5.35 → 0.5.37
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 +4 -4
- package/.vscode/settings.json +4 -4
- package/bin/Release.ff +157 -154
- package/bin/firefly.mjs +1 -1
- package/compiler/Builder.ff +275 -277
- package/compiler/Compiler.ff +234 -233
- package/compiler/Dependencies.ff +186 -187
- package/compiler/DependencyLock.ff +17 -17
- package/compiler/Deriver.ff +23 -31
- package/compiler/Dictionaries.ff +1 -1
- package/compiler/Inference.ff +43 -20
- package/compiler/JsEmitter.ff +1437 -1282
- package/compiler/LspHook.ff +202 -202
- package/compiler/Main.ff +25 -24
- package/compiler/ModuleCache.ff +178 -178
- package/compiler/Parser.ff +36 -109
- package/compiler/Resolver.ff +5 -8
- package/compiler/Substitution.ff +1 -1
- package/compiler/Syntax.ff +1 -16
- package/compiler/Token.ff +9 -0
- package/compiler/Tokenizer.ff +4 -0
- package/compiler/Workspace.ff +88 -88
- package/core/.firefly/include/package.json +5 -5
- package/core/.firefly/package.ff +2 -2
- package/core/Any.ff +26 -30
- package/core/Array.ff +298 -265
- package/core/Atomic.ff +63 -64
- package/core/Box.ff +7 -7
- package/core/BrowserSystem.ff +40 -40
- package/core/Buffer.ff +185 -152
- package/core/BuildSystem.ff +156 -148
- package/core/Channel.ff +95 -92
- package/core/Char.ff +3 -2
- package/core/Core.ff +16 -23
- package/core/Crypto.ff +94 -96
- package/core/Equal.ff +41 -36
- package/core/Error.ff +15 -10
- package/core/FileHandle.ff +45 -37
- package/core/Float.ff +176 -200
- package/core/HttpClient.ff +142 -148
- package/core/Instant.ff +6 -8
- package/core/Int.ff +40 -24
- package/core/IntMap.ff +61 -39
- package/core/Js.ff +305 -0
- package/core/JsSystem.ff +135 -114
- package/core/JsValue.ff +303 -159
- package/core/Json.ff +423 -443
- package/core/List.ff +482 -486
- package/core/Lock.ff +108 -144
- package/core/Log.ff +25 -14
- package/core/NodeSystem.ff +198 -191
- package/core/Ordering.ff +160 -161
- package/core/Path.ff +377 -409
- package/core/Queue.ff +90 -0
- package/core/Random.ff +140 -134
- package/core/RbMap.ff +216 -216
- package/core/Serializable.ff +16 -13
- package/core/Show.ff +44 -43
- package/core/SourceLocation.ff +68 -68
- package/core/Stream.ff +1 -1
- package/core/String.ff +224 -202
- package/core/StringMap.ff +58 -36
- package/core/Task.ff +165 -149
- package/experimental/benchmarks/ListGrab.ff +23 -23
- package/experimental/benchmarks/ListGrab.java +55 -55
- package/experimental/benchmarks/Pyrotek45.ff +30 -30
- package/experimental/benchmarks/Pyrotek45.java +64 -64
- package/experimental/bidirectional/Bidi.ff +88 -88
- package/experimental/lines/Main.ff +40 -0
- package/experimental/random/Index.ff +53 -53
- package/experimental/random/Process.ff +120 -120
- package/experimental/random/RunLength.ff +65 -65
- package/experimental/random/Scrape.ff +51 -51
- package/experimental/random/Symbols.ff +73 -73
- package/experimental/random/Tensor.ff +52 -52
- package/experimental/random/Units.ff +36 -36
- package/experimental/s3/S3TestAuthorizationHeader.ff +39 -39
- package/experimental/s3/S3TestPut.ff +16 -16
- package/experimental/tests/TestJson.ff +26 -26
- package/firefly.sh +0 -0
- package/fireflysite/.firefly/package.ff +4 -4
- package/fireflysite/CommunityOverview.ff +20 -20
- package/fireflysite/CountingButtonDemo.ff +58 -58
- package/fireflysite/DocumentParser.ff +325 -331
- package/fireflysite/ExamplesOverview.ff +40 -40
- package/fireflysite/FrontPage.ff +344 -344
- package/fireflysite/GettingStarted.ff +45 -45
- package/fireflysite/Guide.ff +456 -456
- package/fireflysite/Main.ff +163 -152
- package/fireflysite/MatchingPasswordsDemo.ff +82 -82
- package/fireflysite/PackagesOverview.ff +49 -49
- package/fireflysite/PostgresqlDemo.ff +34 -34
- package/fireflysite/ReferenceAll.ff +18 -18
- package/fireflysite/ReferenceIntroduction.ff +11 -11
- package/fireflysite/Styles.ff +567 -567
- package/fireflysite/Test.ff +121 -62
- package/fireflysite/assets/markdown/reference/BaseTypes.md +209 -209
- package/fireflysite/assets/markdown/reference/EmittedJavascript.md +65 -65
- package/fireflysite/assets/markdown/reference/Exceptions.md +101 -101
- package/fireflysite/assets/markdown/reference/FunctionsAndMethods.md +364 -364
- package/fireflysite/assets/markdown/reference/JavascriptInterop.md +235 -172
- package/fireflysite/assets/markdown/reference/ModulesAndPackages.md +162 -162
- package/fireflysite/assets/markdown/reference/OldStructuredConcurrency.md +48 -48
- package/fireflysite/assets/markdown/reference/PatternMatching.md +224 -224
- package/fireflysite/assets/markdown/reference/StatementsAndExpressions.md +86 -86
- package/fireflysite/assets/markdown/reference/StructuredConcurrency.md +99 -99
- package/fireflysite/assets/markdown/reference/TraitsAndInstances.md +100 -100
- package/fireflysite/assets/markdown/reference/UserDefinedTypes.md +184 -184
- package/fireflysite/assets/markdown/scratch/ControlFlow.md +136 -136
- package/fireflysite/assets/markdown/scratch/Toc.md +40 -40
- package/lsp/.firefly/package.ff +1 -1
- package/lsp/CompletionHandler.ff +827 -827
- package/lsp/Handler.ff +714 -714
- package/lsp/HoverHandler.ff +79 -79
- package/lsp/LanguageServer.ff +272 -272
- package/lsp/SignatureHelpHandler.ff +55 -55
- package/lsp/SymbolHandler.ff +181 -181
- package/lsp/TestReferences.ff +17 -17
- package/lsp/TestReferencesCase.ff +7 -7
- package/lsp/stderr.txt +1 -1
- package/lsp/stdout.txt +34 -34
- package/lux/.firefly/package.ff +1 -1
- package/lux/Css.ff +648 -648
- package/lux/CssTest.ff +48 -48
- package/lux/Lux.ff +608 -617
- package/lux/LuxEvent.ff +79 -116
- package/lux/Main.ff +123 -123
- package/lux/Main2.ff +143 -143
- package/lux/TestDry.ff +28 -28
- package/output/js/ff/compiler/Builder.mjs +72 -71
- package/output/js/ff/compiler/Compiler.mjs +19 -13
- package/output/js/ff/compiler/Dependencies.mjs +8 -7
- package/output/js/ff/compiler/DependencyLock.mjs +6 -4
- package/output/js/ff/compiler/Deriver.mjs +26 -24
- package/output/js/ff/compiler/Dictionaries.mjs +14 -18
- package/output/js/ff/compiler/Environment.mjs +6 -4
- package/output/js/ff/compiler/Inference.mjs +238 -164
- package/output/js/ff/compiler/JsEmitter.mjs +1160 -350
- package/output/js/ff/compiler/JsImporter.mjs +20 -18
- package/output/js/ff/compiler/LspHook.mjs +12 -10
- package/output/js/ff/compiler/Main.mjs +61 -41
- package/output/js/ff/compiler/ModuleCache.mjs +10 -8
- package/output/js/ff/compiler/Parser.mjs +153 -669
- package/output/js/ff/compiler/Patterns.mjs +12 -10
- package/output/js/ff/compiler/Resolver.mjs +52 -78
- package/output/js/ff/compiler/Substitution.mjs +12 -16
- package/output/js/ff/compiler/Syntax.mjs +50 -341
- package/output/js/ff/compiler/Token.mjs +126 -4
- package/output/js/ff/compiler/Tokenizer.mjs +62 -52
- package/output/js/ff/compiler/Unification.mjs +74 -90
- package/output/js/ff/compiler/Wildcards.mjs +4 -2
- package/output/js/ff/compiler/Workspace.mjs +26 -20
- package/output/js/ff/core/Any.mjs +20 -20
- package/output/js/ff/core/Array.mjs +268 -175
- package/output/js/ff/core/AssetSystem.mjs +8 -6
- package/output/js/ff/core/Atomic.mjs +84 -52
- package/output/js/ff/core/Bool.mjs +6 -4
- package/output/js/ff/core/BrowserSystem.mjs +38 -29
- package/output/js/ff/core/Buffer.mjs +285 -133
- package/output/js/ff/core/BuildSystem.mjs +36 -56
- package/output/js/ff/core/Channel.mjs +250 -97
- package/output/js/ff/core/Char.mjs +5 -3
- package/output/js/ff/core/Core.mjs +28 -34
- package/output/js/ff/core/Crypto.mjs +30 -52
- package/output/js/ff/core/Duration.mjs +4 -2
- package/output/js/ff/core/Equal.mjs +14 -12
- package/output/js/ff/core/Error.mjs +17 -11
- package/output/js/ff/core/FileHandle.mjs +76 -38
- package/output/js/ff/core/Float.mjs +92 -160
- package/output/js/ff/core/HttpClient.mjs +208 -76
- package/output/js/ff/core/Instant.mjs +8 -10
- package/output/js/ff/core/Int.mjs +36 -26
- package/output/js/ff/core/IntMap.mjs +79 -33
- package/output/js/ff/core/Js.mjs +751 -0
- package/output/js/ff/core/JsSystem.mjs +54 -60
- package/output/js/ff/core/JsValue.mjs +294 -143
- package/output/js/ff/core/Json.mjs +443 -253
- package/output/js/ff/core/List.mjs +262 -214
- package/output/js/ff/core/Lock.mjs +156 -125
- package/output/js/ff/core/Log.mjs +20 -10
- package/output/js/ff/core/Map.mjs +10 -8
- package/output/js/ff/core/NodeSystem.mjs +189 -123
- package/output/js/ff/core/Nothing.mjs +4 -2
- package/output/js/ff/core/Option.mjs +40 -38
- package/output/js/ff/core/Ordering.mjs +26 -20
- package/output/js/ff/core/Pair.mjs +4 -2
- package/output/js/ff/core/Path.mjs +517 -315
- package/output/js/ff/core/Queue.mjs +306 -0
- package/output/js/ff/core/Random.mjs +141 -77
- package/output/js/ff/core/RbMap.mjs +36 -34
- package/output/js/ff/core/Serializable.mjs +44 -28
- package/output/js/ff/core/Set.mjs +6 -4
- package/output/js/ff/core/Show.mjs +8 -6
- package/output/js/ff/core/SourceLocation.mjs +4 -2
- package/output/js/ff/core/Stream.mjs +30 -50
- package/output/js/ff/core/String.mjs +263 -172
- package/output/js/ff/core/StringMap.mjs +77 -31
- package/output/js/ff/core/Task.mjs +91 -76
- package/output/js/ff/core/Try.mjs +20 -18
- package/output/js/ff/core/Unit.mjs +4 -2
- package/package.json +1 -1
- package/postgresql/Pg.ff +53 -59
- package/rpc/.firefly/package.ff +1 -1
- package/rpc/Rpc.ff +70 -70
- package/s3/.firefly/package.ff +1 -1
- package/s3/S3.ff +92 -94
- package/vscode/LICENSE.txt +21 -21
- package/vscode/Prepublish.ff +15 -15
- package/vscode/README.md +16 -16
- package/vscode/client/package-lock.json +544 -544
- package/vscode/client/package.json +22 -22
- package/vscode/client/src/extension.ts +104 -104
- package/vscode/icons/firefly-icon.svg +10 -10
- package/vscode/language-configuration.json +61 -61
- package/vscode/package-lock.json +3623 -3623
- package/vscode/package.json +1 -1
- package/vscode/snippets.json +241 -241
- package/vscode/syntaxes/firefly-markdown-injection.json +45 -45
- package/webserver/.firefly/include/package.json +5 -5
- package/webserver/.firefly/package.ff +2 -2
- package/webserver/WebServer.ff +647 -685
- package/websocket/.firefly/package.ff +1 -1
- package/websocket/WebSocket.ff +100 -131
- package/core/UnsafeJs.ff +0 -42
- package/output/js/ff/core/UnsafeJs.mjs +0 -191
|
@@ -46,6 +46,8 @@ import * as ff_core_Int from "../../ff/core/Int.mjs"
|
|
|
46
46
|
|
|
47
47
|
import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
|
|
48
48
|
|
|
49
|
+
import * as ff_core_Js from "../../ff/core/Js.mjs"
|
|
50
|
+
|
|
49
51
|
import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
|
|
50
52
|
|
|
51
53
|
import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
|
|
@@ -72,6 +74,8 @@ import * as ff_core_Pair from "../../ff/core/Pair.mjs"
|
|
|
72
74
|
|
|
73
75
|
import * as ff_core_Path from "../../ff/core/Path.mjs"
|
|
74
76
|
|
|
77
|
+
import * as ff_core_Queue from "../../ff/core/Queue.mjs"
|
|
78
|
+
|
|
75
79
|
import * as ff_core_Random from "../../ff/core/Random.mjs"
|
|
76
80
|
|
|
77
81
|
import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
|
|
@@ -94,8 +98,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
94
98
|
|
|
95
99
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
96
100
|
|
|
97
|
-
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
98
|
-
|
|
99
101
|
// type Token
|
|
100
102
|
export function Token(file_, code_, kind_, startLine_, startLineOffset_, startOffset_, stopLine_, stopLineOffset_, stopOffset_) {
|
|
101
103
|
return {file_, code_, kind_, startLine_, startLineOffset_, startOffset_, stopLine_, stopLineOffset_, stopOffset_};
|
|
@@ -206,6 +208,14 @@ const LAssignMinus$ = {LAssignMinus: true};
|
|
|
206
208
|
export function LAssignMinus() {
|
|
207
209
|
return LAssignMinus$;
|
|
208
210
|
}
|
|
211
|
+
const LAssignMultiplication$ = {LAssignMultiplication: true};
|
|
212
|
+
export function LAssignMultiplication() {
|
|
213
|
+
return LAssignMultiplication$;
|
|
214
|
+
}
|
|
215
|
+
const LAssignDivision$ = {LAssignDivision: true};
|
|
216
|
+
export function LAssignDivision() {
|
|
217
|
+
return LAssignDivision$;
|
|
218
|
+
}
|
|
209
219
|
|
|
210
220
|
|
|
211
221
|
|
|
@@ -246,7 +256,7 @@ return ((((ff_compiler_Token.ff_core_Equal_Equal$ff_compiler_Token_TokenKind.equ
|
|
|
246
256
|
}
|
|
247
257
|
|
|
248
258
|
export function Token_rawIs(token_, value_) {
|
|
249
|
-
return (((token_.stopOffset_ - token_.startOffset_) ===
|
|
259
|
+
return (((token_.stopOffset_ - token_.startOffset_) === value_.length) && ff_core_String.String_startsWith(token_.code_, value_, token_.startOffset_))
|
|
250
260
|
}
|
|
251
261
|
|
|
252
262
|
export function Token_rawIs2(token_, value1_, value2_) {
|
|
@@ -294,7 +304,7 @@ return ((((ff_compiler_Token.ff_core_Equal_Equal$ff_compiler_Token_TokenKind.equ
|
|
|
294
304
|
}
|
|
295
305
|
|
|
296
306
|
export async function Token_rawIs$(token_, value_, $task) {
|
|
297
|
-
return (((token_.stopOffset_ - token_.startOffset_) ===
|
|
307
|
+
return (((token_.stopOffset_ - token_.startOffset_) === value_.length) && ff_core_String.String_startsWith(token_.code_, value_, token_.startOffset_))
|
|
298
308
|
}
|
|
299
309
|
|
|
300
310
|
export async function Token_rawIs2$(token_, value1_, value2_, $task) {
|
|
@@ -390,6 +400,12 @@ return false
|
|
|
390
400
|
if(_1.LAssignMinus) {
|
|
391
401
|
return false
|
|
392
402
|
}
|
|
403
|
+
if(_1.LAssignMultiplication) {
|
|
404
|
+
return false
|
|
405
|
+
}
|
|
406
|
+
{
|
|
407
|
+
return false
|
|
408
|
+
}
|
|
393
409
|
}
|
|
394
410
|
}
|
|
395
411
|
|
|
@@ -474,6 +490,12 @@ return false
|
|
|
474
490
|
if(_1.LAssignMinus) {
|
|
475
491
|
return false
|
|
476
492
|
}
|
|
493
|
+
if(_1.LAssignMultiplication) {
|
|
494
|
+
return false
|
|
495
|
+
}
|
|
496
|
+
{
|
|
497
|
+
return false
|
|
498
|
+
}
|
|
477
499
|
}
|
|
478
500
|
}
|
|
479
501
|
|
|
@@ -558,6 +580,12 @@ return false
|
|
|
558
580
|
if(_1.LAssignMinus) {
|
|
559
581
|
return false
|
|
560
582
|
}
|
|
583
|
+
if(_1.LAssignMultiplication) {
|
|
584
|
+
return false
|
|
585
|
+
}
|
|
586
|
+
{
|
|
587
|
+
return false
|
|
588
|
+
}
|
|
561
589
|
}
|
|
562
590
|
}
|
|
563
591
|
|
|
@@ -642,6 +670,12 @@ return false
|
|
|
642
670
|
if(_1.LAssignMinus) {
|
|
643
671
|
return false
|
|
644
672
|
}
|
|
673
|
+
if(_1.LAssignMultiplication) {
|
|
674
|
+
return false
|
|
675
|
+
}
|
|
676
|
+
{
|
|
677
|
+
return false
|
|
678
|
+
}
|
|
645
679
|
}
|
|
646
680
|
}
|
|
647
681
|
|
|
@@ -726,6 +760,12 @@ return false
|
|
|
726
760
|
if(_1.LAssignMinus) {
|
|
727
761
|
return false
|
|
728
762
|
}
|
|
763
|
+
if(_1.LAssignMultiplication) {
|
|
764
|
+
return false
|
|
765
|
+
}
|
|
766
|
+
{
|
|
767
|
+
return false
|
|
768
|
+
}
|
|
729
769
|
}
|
|
730
770
|
}
|
|
731
771
|
|
|
@@ -810,6 +850,12 @@ return false
|
|
|
810
850
|
if(_1.LAssignMinus) {
|
|
811
851
|
return false
|
|
812
852
|
}
|
|
853
|
+
if(_1.LAssignMultiplication) {
|
|
854
|
+
return false
|
|
855
|
+
}
|
|
856
|
+
{
|
|
857
|
+
return false
|
|
858
|
+
}
|
|
813
859
|
}
|
|
814
860
|
}
|
|
815
861
|
|
|
@@ -955,6 +1001,14 @@ if(value_a.LAssignMinus) {
|
|
|
955
1001
|
const z_ = value_a;
|
|
956
1002
|
return "LAssignMinus"
|
|
957
1003
|
}
|
|
1004
|
+
if(value_a.LAssignMultiplication) {
|
|
1005
|
+
const z_ = value_a;
|
|
1006
|
+
return "LAssignMultiplication"
|
|
1007
|
+
}
|
|
1008
|
+
{
|
|
1009
|
+
const z_ = value_a;
|
|
1010
|
+
return "LAssignDivision"
|
|
1011
|
+
}
|
|
958
1012
|
},
|
|
959
1013
|
async show_$(value_, $task) {
|
|
960
1014
|
const value_a = value_;
|
|
@@ -1062,6 +1116,14 @@ if(value_a.LAssignMinus) {
|
|
|
1062
1116
|
const z_ = value_a;
|
|
1063
1117
|
return "LAssignMinus"
|
|
1064
1118
|
}
|
|
1119
|
+
if(value_a.LAssignMultiplication) {
|
|
1120
|
+
const z_ = value_a;
|
|
1121
|
+
return "LAssignMultiplication"
|
|
1122
|
+
}
|
|
1123
|
+
{
|
|
1124
|
+
const z_ = value_a;
|
|
1125
|
+
return "LAssignDivision"
|
|
1126
|
+
}
|
|
1065
1127
|
}
|
|
1066
1128
|
};
|
|
1067
1129
|
|
|
@@ -1314,6 +1376,12 @@ return 24
|
|
|
1314
1376
|
if(z_a.LAssignMinus) {
|
|
1315
1377
|
return 25
|
|
1316
1378
|
}
|
|
1379
|
+
if(z_a.LAssignMultiplication) {
|
|
1380
|
+
return 26
|
|
1381
|
+
}
|
|
1382
|
+
{
|
|
1383
|
+
return 27
|
|
1384
|
+
}
|
|
1317
1385
|
}
|
|
1318
1386
|
return ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int.compare_(number_(x_), number_(y_))
|
|
1319
1387
|
}
|
|
@@ -1405,6 +1473,12 @@ return 24
|
|
|
1405
1473
|
if(z_a.LAssignMinus) {
|
|
1406
1474
|
return 25
|
|
1407
1475
|
}
|
|
1476
|
+
if(z_a.LAssignMultiplication) {
|
|
1477
|
+
return 26
|
|
1478
|
+
}
|
|
1479
|
+
{
|
|
1480
|
+
return 27
|
|
1481
|
+
}
|
|
1408
1482
|
}
|
|
1409
1483
|
return ff_core_Ordering.ff_core_Ordering_Order$ff_core_Int_Int.compare_(number_(x_), number_(y_))
|
|
1410
1484
|
}
|
|
@@ -1696,6 +1770,22 @@ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 2
|
|
|
1696
1770
|
serialization_.offset_ += 1
|
|
1697
1771
|
return
|
|
1698
1772
|
}
|
|
1773
|
+
if(value_a.LAssignMultiplication) {
|
|
1774
|
+
const v_ = value_a;
|
|
1775
|
+
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 39), 0);
|
|
1776
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, 1);
|
|
1777
|
+
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 26);
|
|
1778
|
+
serialization_.offset_ += 1
|
|
1779
|
+
return
|
|
1780
|
+
}
|
|
1781
|
+
{
|
|
1782
|
+
const v_ = value_a;
|
|
1783
|
+
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
|
|
1784
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, 1);
|
|
1785
|
+
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 27);
|
|
1786
|
+
serialization_.offset_ += 1
|
|
1787
|
+
return
|
|
1788
|
+
}
|
|
1699
1789
|
},
|
|
1700
1790
|
deserializeUsing_(serialization_) {
|
|
1701
1791
|
const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
|
|
@@ -1806,6 +1896,14 @@ if(_1 === 25) {
|
|
|
1806
1896
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 30), 0);
|
|
1807
1897
|
return ff_compiler_Token.LAssignMinus()
|
|
1808
1898
|
}
|
|
1899
|
+
if(_1 === 26) {
|
|
1900
|
+
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 39), 0);
|
|
1901
|
+
return ff_compiler_Token.LAssignMultiplication()
|
|
1902
|
+
}
|
|
1903
|
+
if(_1 === 27) {
|
|
1904
|
+
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
|
|
1905
|
+
return ff_compiler_Token.LAssignDivision()
|
|
1906
|
+
}
|
|
1809
1907
|
{
|
|
1810
1908
|
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)})
|
|
1811
1909
|
}
|
|
@@ -2022,6 +2120,22 @@ ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 2
|
|
|
2022
2120
|
serialization_.offset_ += 1
|
|
2023
2121
|
return
|
|
2024
2122
|
}
|
|
2123
|
+
if(value_a.LAssignMultiplication) {
|
|
2124
|
+
const v_ = value_a;
|
|
2125
|
+
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 39), 0);
|
|
2126
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, 1);
|
|
2127
|
+
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 26);
|
|
2128
|
+
serialization_.offset_ += 1
|
|
2129
|
+
return
|
|
2130
|
+
}
|
|
2131
|
+
{
|
|
2132
|
+
const v_ = value_a;
|
|
2133
|
+
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
|
|
2134
|
+
ff_core_Serializable.Serialization_autoResize(serialization_, 1);
|
|
2135
|
+
ff_core_Buffer.Buffer_setUint8(serialization_.buffer_, serialization_.offset_, 27);
|
|
2136
|
+
serialization_.offset_ += 1
|
|
2137
|
+
return
|
|
2138
|
+
}
|
|
2025
2139
|
},
|
|
2026
2140
|
async deserializeUsing_$(serialization_, $task) {
|
|
2027
2141
|
const variantIndex_ = ff_core_Buffer.Buffer_grabUint8(serialization_.buffer_, serialization_.offset_);
|
|
@@ -2132,6 +2246,14 @@ if(_1 === 25) {
|
|
|
2132
2246
|
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 30), 0);
|
|
2133
2247
|
return ff_compiler_Token.LAssignMinus()
|
|
2134
2248
|
}
|
|
2249
|
+
if(_1 === 26) {
|
|
2250
|
+
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 39), 0);
|
|
2251
|
+
return ff_compiler_Token.LAssignMultiplication()
|
|
2252
|
+
}
|
|
2253
|
+
if(_1 === 27) {
|
|
2254
|
+
serialization_.checksum_ = ff_core_Int.Int_bitOr(((31 * serialization_.checksum_) + 33), 0);
|
|
2255
|
+
return ff_compiler_Token.LAssignDivision()
|
|
2256
|
+
}
|
|
2135
2257
|
{
|
|
2136
2258
|
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)})
|
|
2137
2259
|
}
|
|
@@ -50,6 +50,8 @@ import * as ff_core_Int from "../../ff/core/Int.mjs"
|
|
|
50
50
|
|
|
51
51
|
import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
|
|
52
52
|
|
|
53
|
+
import * as ff_core_Js from "../../ff/core/Js.mjs"
|
|
54
|
+
|
|
53
55
|
import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
|
|
54
56
|
|
|
55
57
|
import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
|
|
@@ -76,6 +78,8 @@ import * as ff_core_Pair from "../../ff/core/Pair.mjs"
|
|
|
76
78
|
|
|
77
79
|
import * as ff_core_Path from "../../ff/core/Path.mjs"
|
|
78
80
|
|
|
81
|
+
import * as ff_core_Queue from "../../ff/core/Queue.mjs"
|
|
82
|
+
|
|
79
83
|
import * as ff_core_Random from "../../ff/core/Random.mjs"
|
|
80
84
|
|
|
81
85
|
import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
|
|
@@ -98,8 +102,6 @@ import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
|
98
102
|
|
|
99
103
|
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
100
104
|
|
|
101
|
-
import * as ff_core_UnsafeJs from "../../ff/core/UnsafeJs.mjs"
|
|
102
|
-
|
|
103
105
|
|
|
104
106
|
|
|
105
107
|
|
|
@@ -126,7 +128,7 @@ let startLine_ = line_;
|
|
|
126
128
|
let startLineOffset_ = lineOffset_;
|
|
127
129
|
const operatorCharactersString_ = "!@#$%&/=?+|^~*<>.:-;";
|
|
128
130
|
let operatorCharacters_ = ff_core_Set.new_();
|
|
129
|
-
ff_core_List.List_map(ff_core_List.range_(
|
|
131
|
+
ff_core_List.List_map(ff_core_List.range_(operatorCharactersString_.length), ((j_) => {
|
|
130
132
|
operatorCharacters_ = ff_core_Set.Set_add(operatorCharacters_, ff_core_String.String_grab(operatorCharactersString_, j_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_Char_Char)
|
|
131
133
|
}));
|
|
132
134
|
function emitToken_(kind_, startOffset_, stopOffset_) {
|
|
@@ -159,31 +161,31 @@ const column_ = ((i_ - startLineOffset_) + 1);
|
|
|
159
161
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_compiler_Syntax.Location(file_, line_, column_), message_), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
160
162
|
}
|
|
161
163
|
try {
|
|
162
|
-
while((i_ <
|
|
164
|
+
while((i_ < code_.length)) {
|
|
163
165
|
startLine_ = line_;
|
|
164
166
|
startLineOffset_ = lineOffset_;
|
|
165
167
|
if((completionLine_ === line_)) {
|
|
166
|
-
while(((i_ <
|
|
168
|
+
while(((i_ < code_.length) && (((ff_core_String.String_grab(code_, i_) === 32) || (ff_core_String.String_grab(code_, i_) === 9)) || (ff_core_String.String_grab(code_, i_) === 13)))) {
|
|
167
169
|
if((completionColumn_ === ((1 + i_) - lineOffset_))) {
|
|
168
170
|
emitToken_(ff_compiler_Token.LLower(), i_, i_)
|
|
169
171
|
};
|
|
170
172
|
i_ += 1
|
|
171
173
|
};
|
|
172
|
-
if(((i_ <
|
|
174
|
+
if(((i_ < code_.length) && (completionColumn_ === ((1 + i_) - lineOffset_)))) {
|
|
173
175
|
const c_ = ff_core_String.String_grab(code_, i_);
|
|
174
176
|
if(((((!ff_core_Char.Char_isAsciiLetterOrDigit(c_)) && (c_ !== 95)) && (c_ !== 39)) && (c_ !== 34))) {
|
|
175
177
|
emitToken_(ff_compiler_Token.LLower(), i_, i_);
|
|
176
|
-
if((((i_ + 1) <
|
|
178
|
+
if((((i_ + 1) < code_.length) && (ff_core_String.String_grab(code_, i_) === 95))) {
|
|
177
179
|
i_ += 1
|
|
178
180
|
}
|
|
179
181
|
}
|
|
180
182
|
}
|
|
181
183
|
} else {
|
|
182
|
-
while(((i_ <
|
|
184
|
+
while(((i_ < code_.length) && (((ff_core_String.String_grab(code_, i_) === 32) || (ff_core_String.String_grab(code_, i_) === 9)) || (ff_core_String.String_grab(code_, i_) === 13)))) {
|
|
183
185
|
i_ += 1
|
|
184
186
|
}
|
|
185
187
|
};
|
|
186
|
-
if((i_ <
|
|
188
|
+
if((i_ < code_.length)) {
|
|
187
189
|
const start_ = i_;
|
|
188
190
|
if((ff_core_String.String_grab(code_, i_) === 10)) {
|
|
189
191
|
i_ += 1;
|
|
@@ -191,13 +193,13 @@ line_ += 1;
|
|
|
191
193
|
lineOffset_ = i_
|
|
192
194
|
} else if(((ff_core_String.String_grab(code_, i_) === 47) && (ff_core_String.String_grab(code_, (i_ + 1)) === 47))) {
|
|
193
195
|
i_ += 2;
|
|
194
|
-
while(((i_ <
|
|
196
|
+
while(((i_ < code_.length) && (ff_core_String.String_grab(code_, i_) !== 10))) {
|
|
195
197
|
i_ += 1
|
|
196
198
|
}
|
|
197
199
|
} else if(((ff_core_String.String_grab(code_, i_) === 47) && (ff_core_String.String_grab(code_, (i_ + 1)) === 42))) {
|
|
198
200
|
i_ += 2;
|
|
199
|
-
while(((i_ <
|
|
200
|
-
if((i_ >=
|
|
201
|
+
while(((i_ < code_.length) && ((ff_core_String.String_grab(code_, i_) !== 42) || (ff_core_String.String_grab(code_, (i_ + 1)) !== 47)))) {
|
|
202
|
+
if((i_ >= code_.length)) {
|
|
201
203
|
throwError_((("Expected end of comment started on line " + startLine_) + ", got end of file."))
|
|
202
204
|
};
|
|
203
205
|
if((ff_core_String.String_grab(code_, i_) === 10)) {
|
|
@@ -209,11 +211,11 @@ i_ += 1
|
|
|
209
211
|
i_ += 2
|
|
210
212
|
} else if(((ff_core_String.String_grab(code_, i_) === 34) || (ff_core_String.String_grab(code_, i_) === 39))) {
|
|
211
213
|
const endSign_ = ff_core_String.String_grab(code_, i_);
|
|
212
|
-
let multiLine_ = (((((i_ + 2) <
|
|
214
|
+
let multiLine_ = (((((i_ + 2) < code_.length) && (ff_core_String.String_grab(code_, i_) === 34)) && (ff_core_String.String_grab(code_, (i_ + 1)) === 34)) && (ff_core_String.String_grab(code_, (i_ + 2)) === 34));
|
|
213
215
|
i_ += (multiLine_
|
|
214
216
|
? 3
|
|
215
217
|
: 1);
|
|
216
|
-
while(((i_ <
|
|
218
|
+
while(((i_ < code_.length) && (multiLine_ || (ff_core_String.String_grab(code_, i_) !== endSign_)))) {
|
|
217
219
|
if((ff_core_String.String_grab(code_, i_) === 10)) {
|
|
218
220
|
if(multiLine_) {
|
|
219
221
|
line_ += 1;
|
|
@@ -222,13 +224,13 @@ lineOffset_ = (i_ + 1)
|
|
|
222
224
|
throwError_("Unexpected end of line in string.")
|
|
223
225
|
}
|
|
224
226
|
};
|
|
225
|
-
if((i_ >=
|
|
227
|
+
if((i_ >= code_.length)) {
|
|
226
228
|
throwError_((("Expected end of string started on line " + startLine_) + ", got end of file."))
|
|
227
229
|
};
|
|
228
230
|
if(((ff_core_String.String_grab(code_, i_) === 92) && (ff_core_String.String_grab(code_, (i_ + 1)) !== 10))) {
|
|
229
231
|
i_ += 1
|
|
230
232
|
};
|
|
231
|
-
if((((((multiLine_ && ((i_ + 2) <
|
|
233
|
+
if((((((multiLine_ && ((i_ + 2) < code_.length)) && (((i_ + 3) >= code_.length) || (ff_core_String.String_grab(code_, (i_ + 3)) !== 34))) && (ff_core_String.String_grab(code_, i_) === 34)) && (ff_core_String.String_grab(code_, (i_ + 1)) === 34)) && (ff_core_String.String_grab(code_, (i_ + 2)) === 34))) {
|
|
232
234
|
multiLine_ = false;
|
|
233
235
|
i_ += 2
|
|
234
236
|
} else {
|
|
@@ -244,19 +246,19 @@ const kind_ = ((ff_core_String.String_grab(code_, i_) >= 97)
|
|
|
244
246
|
? ff_compiler_Token.LLower()
|
|
245
247
|
: ff_compiler_Token.LUpper());
|
|
246
248
|
i_ += 1;
|
|
247
|
-
while(((i_ <
|
|
249
|
+
while(((i_ < code_.length) && ff_core_Char.Char_isAsciiLetterOrDigit(ff_core_String.String_grab(code_, i_)))) {
|
|
248
250
|
i_ += 1
|
|
249
251
|
};
|
|
250
|
-
if(((((i_ <
|
|
252
|
+
if(((((i_ < code_.length) && ff_compiler_Token.ff_core_Equal_Equal$ff_compiler_Token_TokenKind.equals_(kind_, ff_compiler_Token.LUpper())) && (ff_core_String.String_grab(code_, i_) === 46)) && (ff_core_Array.Array_isEmpty(tokens_) || ff_core_Equal.notEquals_(ff_core_Array.Array_grabLast(tokens_).kind_, ff_compiler_Token.LArrowThin(), ff_compiler_Token.ff_core_Equal_Equal$ff_compiler_Token_TokenKind)))) {
|
|
251
253
|
i_ += 1;
|
|
252
254
|
emitToken_(ff_compiler_Token.LNamespace(), start_, i_)
|
|
253
255
|
} else {
|
|
254
256
|
emitToken_(kind_, start_, i_)
|
|
255
257
|
}
|
|
256
258
|
} else if(ff_core_Char.Char_isAsciiDigit(ff_core_String.String_grab(code_, i_))) {
|
|
257
|
-
if(((((i_ + 2) <
|
|
259
|
+
if(((((i_ + 2) < code_.length) && (ff_core_String.String_grab(code_, i_) === 48)) && ((ff_core_String.String_grab(code_, (i_ + 1)) === 120) || (ff_core_String.String_grab(code_, (i_ + 1)) === 88)))) {
|
|
258
260
|
i_ += 2;
|
|
259
|
-
while(((i_ <
|
|
261
|
+
while(((i_ < code_.length) && ((ff_core_Char.Char_isAsciiDigit(ff_core_String.String_grab(code_, i_)) || ((ff_core_String.String_grab(code_, i_) >= 97) && (ff_core_String.String_grab(code_, i_) <= 102))) || ((ff_core_String.String_grab(code_, i_) >= 65) && (ff_core_String.String_grab(code_, i_) <= 70))))) {
|
|
260
262
|
i_ += 1
|
|
261
263
|
};
|
|
262
264
|
if((start_ === (i_ - 2))) {
|
|
@@ -266,7 +268,7 @@ emitToken_(ff_compiler_Token.LInt(), start_, i_)
|
|
|
266
268
|
} else {
|
|
267
269
|
let dot_ = false;
|
|
268
270
|
let exponent_ = false;
|
|
269
|
-
while(((i_ <
|
|
271
|
+
while(((i_ < code_.length) && ff_core_Char.Char_isAsciiDigit(ff_core_String.String_grab(code_, i_)))) {
|
|
270
272
|
i_ += 1;
|
|
271
273
|
if((((ff_core_String.String_grab(code_, i_) === 101) || (ff_core_String.String_grab(code_, i_) === 69)) && (!exponent_))) {
|
|
272
274
|
i_ += 1;
|
|
@@ -276,7 +278,7 @@ if(((ff_core_String.String_grab(code_, i_) === 43) || (ff_core_String.String_gra
|
|
|
276
278
|
i_ += 1
|
|
277
279
|
}
|
|
278
280
|
};
|
|
279
|
-
if(((((((i_ + 1) <
|
|
281
|
+
if(((((((i_ + 1) < code_.length) && (ff_core_String.String_grab(code_, i_) === 46)) && ff_core_Char.Char_isAsciiDigit(ff_core_String.String_grab(code_, (i_ + 1)))) && (!dot_)) && (!exponent_))) {
|
|
280
282
|
i_ += 1;
|
|
281
283
|
dot_ = true
|
|
282
284
|
}
|
|
@@ -291,12 +293,12 @@ emitToken_(ff_compiler_Token.LWildcard(), start_, i_)
|
|
|
291
293
|
} else if((ff_core_String.String_grab(code_, i_) === 44)) {
|
|
292
294
|
i_ += 1;
|
|
293
295
|
emitToken_(ff_compiler_Token.LComma(), start_, i_)
|
|
294
|
-
} else if(((ff_core_String.String_grab(code_, i_) === 63) || ((ff_core_String.String_grab(code_, i_) === 33) && (((i_ + 1) >=
|
|
296
|
+
} else if(((ff_core_String.String_grab(code_, i_) === 63) || ((ff_core_String.String_grab(code_, i_) === 33) && (((i_ + 1) >= code_.length) || (ff_core_String.String_grab(code_, (i_ + 1)) !== 61))))) {
|
|
295
297
|
i_ += 1;
|
|
296
298
|
emitToken_(ff_compiler_Token.LUnary(), start_, i_)
|
|
297
299
|
} else if(ff_core_Set.Set_contains(operatorCharacters_, ff_core_String.String_grab(code_, i_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_Char_Char)) {
|
|
298
300
|
i_ += 1;
|
|
299
|
-
if(((((ff_core_String.String_grab(code_, (i_ - 1)) === 46) && ((i_ + 1) <
|
|
301
|
+
if(((((ff_core_String.String_grab(code_, (i_ - 1)) === 46) && ((i_ + 1) < code_.length)) && (ff_core_String.String_grab(code_, i_) === 46)) && (ff_core_String.String_grab(code_, (i_ + 1)) !== 46))) {
|
|
300
302
|
emitToken_(ff_compiler_Token.LDot(), start_, i_);
|
|
301
303
|
const newStart_ = i_;
|
|
302
304
|
if((!ff_core_Option.Option_isEmpty(completionAt_))) {
|
|
@@ -305,7 +307,7 @@ emitToken_(ff_compiler_Token.LLower(), newStart_, newStart_)
|
|
|
305
307
|
i_ += 1;
|
|
306
308
|
emitToken_(ff_compiler_Token.LDot(), newStart_, i_)
|
|
307
309
|
} else {
|
|
308
|
-
while(((i_ <
|
|
310
|
+
while(((i_ < code_.length) && ff_core_Set.Set_contains(operatorCharacters_, ff_core_String.String_grab(code_, i_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_Char_Char))) {
|
|
309
311
|
i_ += 1
|
|
310
312
|
};
|
|
311
313
|
const o_ = ((((i_ - start_) === 1) && (ff_core_String.String_grab(code_, (i_ - 1)) === 46))
|
|
@@ -328,6 +330,10 @@ const o_ = ((((i_ - start_) === 1) && (ff_core_String.String_grab(code_, (i_ - 1
|
|
|
328
330
|
? ff_compiler_Token.LAssignPlus()
|
|
329
331
|
: ((((i_ - start_) === 2) && (ff_core_String.String_grab(code_, (i_ - 2)) === 45)) && (ff_core_String.String_grab(code_, (i_ - 1)) === 61))
|
|
330
332
|
? ff_compiler_Token.LAssignMinus()
|
|
333
|
+
: ((((i_ - start_) === 2) && (ff_core_String.String_grab(code_, (i_ - 2)) === 42)) && (ff_core_String.String_grab(code_, (i_ - 1)) === 61))
|
|
334
|
+
? ff_compiler_Token.LAssignMultiplication()
|
|
335
|
+
: ((((i_ - start_) === 2) && (ff_core_String.String_grab(code_, (i_ - 2)) === 47)) && (ff_core_String.String_grab(code_, (i_ - 1)) === 61))
|
|
336
|
+
? ff_compiler_Token.LAssignDivision()
|
|
331
337
|
: ff_compiler_Token.LOperator());
|
|
332
338
|
emitToken_(o_, start_, i_)
|
|
333
339
|
}
|
|
@@ -337,7 +343,7 @@ emitToken_(ff_compiler_Token.LBracketLeft(), start_, i_)
|
|
|
337
343
|
} else if((((ff_core_String.String_grab(code_, i_) === 41) || (ff_core_String.String_grab(code_, i_) === 93)) || (ff_core_String.String_grab(code_, i_) === 125))) {
|
|
338
344
|
i_ += 1;
|
|
339
345
|
emitToken_(ff_compiler_Token.LBracketRight(), start_, i_)
|
|
340
|
-
} else if((i_ <
|
|
346
|
+
} else if((i_ < code_.length)) {
|
|
341
347
|
if(attemptFixes_) {
|
|
342
348
|
i_ += 1
|
|
343
349
|
} else {
|
|
@@ -356,7 +362,7 @@ const error_ = _error;
|
|
|
356
362
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_compiler_Syntax.Location(file_, line_, (i_ - lineOffset_)), "Unexpected end of file"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
357
363
|
}
|
|
358
364
|
};
|
|
359
|
-
for(let
|
|
365
|
+
for(let for_a = ff_core_List.range_(5), for_i = 0, for_l = for_a.length; for_i < for_l; for_i++) {
|
|
360
366
|
emitToken_(ff_compiler_Token.LEnd(), i_, i_)
|
|
361
367
|
};
|
|
362
368
|
return ff_core_Array.Array_drain(tokens_)
|
|
@@ -384,7 +390,7 @@ let startLine_ = line_;
|
|
|
384
390
|
let startLineOffset_ = lineOffset_;
|
|
385
391
|
const operatorCharactersString_ = "!@#$%&/=?+|^~*<>.:-;";
|
|
386
392
|
let operatorCharacters_ = ff_core_Set.new_();
|
|
387
|
-
ff_core_List.List_map(ff_core_List.range_(
|
|
393
|
+
ff_core_List.List_map(ff_core_List.range_(operatorCharactersString_.length), ((j_) => {
|
|
388
394
|
operatorCharacters_ = ff_core_Set.Set_add(operatorCharacters_, ff_core_String.String_grab(operatorCharactersString_, j_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_Char_Char)
|
|
389
395
|
}));
|
|
390
396
|
function emitToken_(kind_, startOffset_, stopOffset_) {
|
|
@@ -417,31 +423,31 @@ const column_ = ((i_ - startLineOffset_) + 1);
|
|
|
417
423
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_compiler_Syntax.Location(file_, line_, column_), message_), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
418
424
|
}
|
|
419
425
|
try {
|
|
420
|
-
while((i_ <
|
|
426
|
+
while((i_ < code_.length)) {
|
|
421
427
|
startLine_ = line_;
|
|
422
428
|
startLineOffset_ = lineOffset_;
|
|
423
429
|
if((completionLine_ === line_)) {
|
|
424
|
-
while(((i_ <
|
|
430
|
+
while(((i_ < code_.length) && (((ff_core_String.String_grab(code_, i_) === 32) || (ff_core_String.String_grab(code_, i_) === 9)) || (ff_core_String.String_grab(code_, i_) === 13)))) {
|
|
425
431
|
if((completionColumn_ === ((1 + i_) - lineOffset_))) {
|
|
426
432
|
emitToken_(ff_compiler_Token.LLower(), i_, i_)
|
|
427
433
|
};
|
|
428
434
|
i_ += 1
|
|
429
435
|
};
|
|
430
|
-
if(((i_ <
|
|
436
|
+
if(((i_ < code_.length) && (completionColumn_ === ((1 + i_) - lineOffset_)))) {
|
|
431
437
|
const c_ = ff_core_String.String_grab(code_, i_);
|
|
432
438
|
if(((((!ff_core_Char.Char_isAsciiLetterOrDigit(c_)) && (c_ !== 95)) && (c_ !== 39)) && (c_ !== 34))) {
|
|
433
439
|
emitToken_(ff_compiler_Token.LLower(), i_, i_);
|
|
434
|
-
if((((i_ + 1) <
|
|
440
|
+
if((((i_ + 1) < code_.length) && (ff_core_String.String_grab(code_, i_) === 95))) {
|
|
435
441
|
i_ += 1
|
|
436
442
|
}
|
|
437
443
|
}
|
|
438
444
|
}
|
|
439
445
|
} else {
|
|
440
|
-
while(((i_ <
|
|
446
|
+
while(((i_ < code_.length) && (((ff_core_String.String_grab(code_, i_) === 32) || (ff_core_String.String_grab(code_, i_) === 9)) || (ff_core_String.String_grab(code_, i_) === 13)))) {
|
|
441
447
|
i_ += 1
|
|
442
448
|
}
|
|
443
449
|
};
|
|
444
|
-
if((i_ <
|
|
450
|
+
if((i_ < code_.length)) {
|
|
445
451
|
const start_ = i_;
|
|
446
452
|
if((ff_core_String.String_grab(code_, i_) === 10)) {
|
|
447
453
|
i_ += 1;
|
|
@@ -449,13 +455,13 @@ line_ += 1;
|
|
|
449
455
|
lineOffset_ = i_
|
|
450
456
|
} else if(((ff_core_String.String_grab(code_, i_) === 47) && (ff_core_String.String_grab(code_, (i_ + 1)) === 47))) {
|
|
451
457
|
i_ += 2;
|
|
452
|
-
while(((i_ <
|
|
458
|
+
while(((i_ < code_.length) && (ff_core_String.String_grab(code_, i_) !== 10))) {
|
|
453
459
|
i_ += 1
|
|
454
460
|
}
|
|
455
461
|
} else if(((ff_core_String.String_grab(code_, i_) === 47) && (ff_core_String.String_grab(code_, (i_ + 1)) === 42))) {
|
|
456
462
|
i_ += 2;
|
|
457
|
-
while(((i_ <
|
|
458
|
-
if((i_ >=
|
|
463
|
+
while(((i_ < code_.length) && ((ff_core_String.String_grab(code_, i_) !== 42) || (ff_core_String.String_grab(code_, (i_ + 1)) !== 47)))) {
|
|
464
|
+
if((i_ >= code_.length)) {
|
|
459
465
|
throwError_((("Expected end of comment started on line " + startLine_) + ", got end of file."))
|
|
460
466
|
};
|
|
461
467
|
if((ff_core_String.String_grab(code_, i_) === 10)) {
|
|
@@ -467,11 +473,11 @@ i_ += 1
|
|
|
467
473
|
i_ += 2
|
|
468
474
|
} else if(((ff_core_String.String_grab(code_, i_) === 34) || (ff_core_String.String_grab(code_, i_) === 39))) {
|
|
469
475
|
const endSign_ = ff_core_String.String_grab(code_, i_);
|
|
470
|
-
let multiLine_ = (((((i_ + 2) <
|
|
476
|
+
let multiLine_ = (((((i_ + 2) < code_.length) && (ff_core_String.String_grab(code_, i_) === 34)) && (ff_core_String.String_grab(code_, (i_ + 1)) === 34)) && (ff_core_String.String_grab(code_, (i_ + 2)) === 34));
|
|
471
477
|
i_ += (multiLine_
|
|
472
478
|
? 3
|
|
473
479
|
: 1);
|
|
474
|
-
while(((i_ <
|
|
480
|
+
while(((i_ < code_.length) && (multiLine_ || (ff_core_String.String_grab(code_, i_) !== endSign_)))) {
|
|
475
481
|
if((ff_core_String.String_grab(code_, i_) === 10)) {
|
|
476
482
|
if(multiLine_) {
|
|
477
483
|
line_ += 1;
|
|
@@ -480,13 +486,13 @@ lineOffset_ = (i_ + 1)
|
|
|
480
486
|
throwError_("Unexpected end of line in string.")
|
|
481
487
|
}
|
|
482
488
|
};
|
|
483
|
-
if((i_ >=
|
|
489
|
+
if((i_ >= code_.length)) {
|
|
484
490
|
throwError_((("Expected end of string started on line " + startLine_) + ", got end of file."))
|
|
485
491
|
};
|
|
486
492
|
if(((ff_core_String.String_grab(code_, i_) === 92) && (ff_core_String.String_grab(code_, (i_ + 1)) !== 10))) {
|
|
487
493
|
i_ += 1
|
|
488
494
|
};
|
|
489
|
-
if((((((multiLine_ && ((i_ + 2) <
|
|
495
|
+
if((((((multiLine_ && ((i_ + 2) < code_.length)) && (((i_ + 3) >= code_.length) || (ff_core_String.String_grab(code_, (i_ + 3)) !== 34))) && (ff_core_String.String_grab(code_, i_) === 34)) && (ff_core_String.String_grab(code_, (i_ + 1)) === 34)) && (ff_core_String.String_grab(code_, (i_ + 2)) === 34))) {
|
|
490
496
|
multiLine_ = false;
|
|
491
497
|
i_ += 2
|
|
492
498
|
} else {
|
|
@@ -502,19 +508,19 @@ const kind_ = ((ff_core_String.String_grab(code_, i_) >= 97)
|
|
|
502
508
|
? ff_compiler_Token.LLower()
|
|
503
509
|
: ff_compiler_Token.LUpper());
|
|
504
510
|
i_ += 1;
|
|
505
|
-
while(((i_ <
|
|
511
|
+
while(((i_ < code_.length) && ff_core_Char.Char_isAsciiLetterOrDigit(ff_core_String.String_grab(code_, i_)))) {
|
|
506
512
|
i_ += 1
|
|
507
513
|
};
|
|
508
|
-
if(((((i_ <
|
|
514
|
+
if(((((i_ < code_.length) && ff_compiler_Token.ff_core_Equal_Equal$ff_compiler_Token_TokenKind.equals_(kind_, ff_compiler_Token.LUpper())) && (ff_core_String.String_grab(code_, i_) === 46)) && (ff_core_Array.Array_isEmpty(tokens_) || ff_core_Equal.notEquals_(ff_core_Array.Array_grabLast(tokens_).kind_, ff_compiler_Token.LArrowThin(), ff_compiler_Token.ff_core_Equal_Equal$ff_compiler_Token_TokenKind)))) {
|
|
509
515
|
i_ += 1;
|
|
510
516
|
emitToken_(ff_compiler_Token.LNamespace(), start_, i_)
|
|
511
517
|
} else {
|
|
512
518
|
emitToken_(kind_, start_, i_)
|
|
513
519
|
}
|
|
514
520
|
} else if(ff_core_Char.Char_isAsciiDigit(ff_core_String.String_grab(code_, i_))) {
|
|
515
|
-
if(((((i_ + 2) <
|
|
521
|
+
if(((((i_ + 2) < code_.length) && (ff_core_String.String_grab(code_, i_) === 48)) && ((ff_core_String.String_grab(code_, (i_ + 1)) === 120) || (ff_core_String.String_grab(code_, (i_ + 1)) === 88)))) {
|
|
516
522
|
i_ += 2;
|
|
517
|
-
while(((i_ <
|
|
523
|
+
while(((i_ < code_.length) && ((ff_core_Char.Char_isAsciiDigit(ff_core_String.String_grab(code_, i_)) || ((ff_core_String.String_grab(code_, i_) >= 97) && (ff_core_String.String_grab(code_, i_) <= 102))) || ((ff_core_String.String_grab(code_, i_) >= 65) && (ff_core_String.String_grab(code_, i_) <= 70))))) {
|
|
518
524
|
i_ += 1
|
|
519
525
|
};
|
|
520
526
|
if((start_ === (i_ - 2))) {
|
|
@@ -524,7 +530,7 @@ emitToken_(ff_compiler_Token.LInt(), start_, i_)
|
|
|
524
530
|
} else {
|
|
525
531
|
let dot_ = false;
|
|
526
532
|
let exponent_ = false;
|
|
527
|
-
while(((i_ <
|
|
533
|
+
while(((i_ < code_.length) && ff_core_Char.Char_isAsciiDigit(ff_core_String.String_grab(code_, i_)))) {
|
|
528
534
|
i_ += 1;
|
|
529
535
|
if((((ff_core_String.String_grab(code_, i_) === 101) || (ff_core_String.String_grab(code_, i_) === 69)) && (!exponent_))) {
|
|
530
536
|
i_ += 1;
|
|
@@ -534,7 +540,7 @@ if(((ff_core_String.String_grab(code_, i_) === 43) || (ff_core_String.String_gra
|
|
|
534
540
|
i_ += 1
|
|
535
541
|
}
|
|
536
542
|
};
|
|
537
|
-
if(((((((i_ + 1) <
|
|
543
|
+
if(((((((i_ + 1) < code_.length) && (ff_core_String.String_grab(code_, i_) === 46)) && ff_core_Char.Char_isAsciiDigit(ff_core_String.String_grab(code_, (i_ + 1)))) && (!dot_)) && (!exponent_))) {
|
|
538
544
|
i_ += 1;
|
|
539
545
|
dot_ = true
|
|
540
546
|
}
|
|
@@ -549,12 +555,12 @@ emitToken_(ff_compiler_Token.LWildcard(), start_, i_)
|
|
|
549
555
|
} else if((ff_core_String.String_grab(code_, i_) === 44)) {
|
|
550
556
|
i_ += 1;
|
|
551
557
|
emitToken_(ff_compiler_Token.LComma(), start_, i_)
|
|
552
|
-
} else if(((ff_core_String.String_grab(code_, i_) === 63) || ((ff_core_String.String_grab(code_, i_) === 33) && (((i_ + 1) >=
|
|
558
|
+
} else if(((ff_core_String.String_grab(code_, i_) === 63) || ((ff_core_String.String_grab(code_, i_) === 33) && (((i_ + 1) >= code_.length) || (ff_core_String.String_grab(code_, (i_ + 1)) !== 61))))) {
|
|
553
559
|
i_ += 1;
|
|
554
560
|
emitToken_(ff_compiler_Token.LUnary(), start_, i_)
|
|
555
561
|
} else if(ff_core_Set.Set_contains(operatorCharacters_, ff_core_String.String_grab(code_, i_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_Char_Char)) {
|
|
556
562
|
i_ += 1;
|
|
557
|
-
if(((((ff_core_String.String_grab(code_, (i_ - 1)) === 46) && ((i_ + 1) <
|
|
563
|
+
if(((((ff_core_String.String_grab(code_, (i_ - 1)) === 46) && ((i_ + 1) < code_.length)) && (ff_core_String.String_grab(code_, i_) === 46)) && (ff_core_String.String_grab(code_, (i_ + 1)) !== 46))) {
|
|
558
564
|
emitToken_(ff_compiler_Token.LDot(), start_, i_);
|
|
559
565
|
const newStart_ = i_;
|
|
560
566
|
if((!ff_core_Option.Option_isEmpty(completionAt_))) {
|
|
@@ -563,7 +569,7 @@ emitToken_(ff_compiler_Token.LLower(), newStart_, newStart_)
|
|
|
563
569
|
i_ += 1;
|
|
564
570
|
emitToken_(ff_compiler_Token.LDot(), newStart_, i_)
|
|
565
571
|
} else {
|
|
566
|
-
while(((i_ <
|
|
572
|
+
while(((i_ < code_.length) && ff_core_Set.Set_contains(operatorCharacters_, ff_core_String.String_grab(code_, i_), ff_core_Ordering.ff_core_Ordering_Order$ff_core_Char_Char))) {
|
|
567
573
|
i_ += 1
|
|
568
574
|
};
|
|
569
575
|
const o_ = ((((i_ - start_) === 1) && (ff_core_String.String_grab(code_, (i_ - 1)) === 46))
|
|
@@ -586,6 +592,10 @@ const o_ = ((((i_ - start_) === 1) && (ff_core_String.String_grab(code_, (i_ - 1
|
|
|
586
592
|
? ff_compiler_Token.LAssignPlus()
|
|
587
593
|
: ((((i_ - start_) === 2) && (ff_core_String.String_grab(code_, (i_ - 2)) === 45)) && (ff_core_String.String_grab(code_, (i_ - 1)) === 61))
|
|
588
594
|
? ff_compiler_Token.LAssignMinus()
|
|
595
|
+
: ((((i_ - start_) === 2) && (ff_core_String.String_grab(code_, (i_ - 2)) === 42)) && (ff_core_String.String_grab(code_, (i_ - 1)) === 61))
|
|
596
|
+
? ff_compiler_Token.LAssignMultiplication()
|
|
597
|
+
: ((((i_ - start_) === 2) && (ff_core_String.String_grab(code_, (i_ - 2)) === 47)) && (ff_core_String.String_grab(code_, (i_ - 1)) === 61))
|
|
598
|
+
? ff_compiler_Token.LAssignDivision()
|
|
589
599
|
: ff_compiler_Token.LOperator());
|
|
590
600
|
emitToken_(o_, start_, i_)
|
|
591
601
|
}
|
|
@@ -595,7 +605,7 @@ emitToken_(ff_compiler_Token.LBracketLeft(), start_, i_)
|
|
|
595
605
|
} else if((((ff_core_String.String_grab(code_, i_) === 41) || (ff_core_String.String_grab(code_, i_) === 93)) || (ff_core_String.String_grab(code_, i_) === 125))) {
|
|
596
606
|
i_ += 1;
|
|
597
607
|
emitToken_(ff_compiler_Token.LBracketRight(), start_, i_)
|
|
598
|
-
} else if((i_ <
|
|
608
|
+
} else if((i_ < code_.length)) {
|
|
599
609
|
if(attemptFixes_) {
|
|
600
610
|
i_ += 1
|
|
601
611
|
} else {
|
|
@@ -614,7 +624,7 @@ const error_ = _error;
|
|
|
614
624
|
throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(ff_compiler_Syntax.CompileError(ff_compiler_Syntax.Location(file_, line_, (i_ - lineOffset_)), "Unexpected end of file"), ff_compiler_Syntax.ff_core_Any_HasAnyTag$ff_compiler_Syntax_CompileError)})
|
|
615
625
|
}
|
|
616
626
|
};
|
|
617
|
-
for(let
|
|
627
|
+
for(let for_a = ff_core_List.range_(5), for_i = 0, for_l = for_a.length; for_i < for_l; for_i++) {
|
|
618
628
|
emitToken_(ff_compiler_Token.LEnd(), i_, i_)
|
|
619
629
|
};
|
|
620
630
|
return ff_core_Array.Array_drain(tokens_)
|