firefly-compiler 0.4.78 → 0.4.80
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/Builder.ff +2 -2
- package/compiler/Compiler.ff +1 -1
- package/compiler/Inference.ff +2 -1
- package/compiler/JsEmitter.ff +11 -17
- package/compiler/Main.ff +3 -3
- package/compiler/ModuleCache.ff +1 -1
- package/compiler/Tokenizer.ff +1 -1
- package/compiler/Unification.ff +1 -1
- package/core/.firefly/include/package-lock.json +267 -97
- package/core/.firefly/include/package.json +1 -1
- package/core/Float.ff +25 -0
- package/core/Lock.ff +1 -1
- package/core/NodeSystem.ff +1 -1
- package/core/Stream.ff +9 -9
- package/core/Task.ff +3 -3
- package/core/Try.ff +25 -4
- package/experimental/s3/S3TestAuthorizationHeader.ff +2 -1
- package/experimental/s3/S3TestPut.ff +2 -1
- package/fireflysite/CommunityOverview.ff +2 -2
- package/fireflysite/CountingButtonDemo.ff +1 -1
- package/fireflysite/DocumentParser.ff +332 -0
- package/fireflysite/ExamplesOverview.ff +11 -2
- package/fireflysite/FrontPage.ff +344 -0
- package/fireflysite/{GuideIntroduction.ff → GettingStarted.ff} +1 -25
- package/fireflysite/Guide.ff +239 -104
- package/fireflysite/Main.ff +100 -51
- package/fireflysite/MatchingPasswordsDemo.ff +13 -17
- package/fireflysite/PackagesOverview.ff +1 -1
- package/fireflysite/PostgresqlDemo.ff +34 -0
- package/fireflysite/ReferenceAll.ff +19 -0
- package/fireflysite/ReferenceIntroduction.ff +11 -0
- package/fireflysite/Styles.ff +358 -97
- package/fireflysite/Test.ff +38 -0
- package/fireflysite/assets/font/NotoSansMono-Regular.ttf +0 -0
- package/fireflysite/assets/font/NunitoSans-VariableFont_YTLC,opsz,wdth,wght.ttf +0 -0
- package/fireflysite/assets/image/autocomplete-small.png +0 -0
- package/fireflysite/assets/image/autocomplete.png +0 -0
- package/fireflysite/assets/image/edit-time-error.png +0 -0
- package/fireflysite/assets/image/firefly-logo-yellow.png +0 -0
- package/fireflysite/assets/markdown/reference/BaseTypes.md +209 -0
- package/fireflysite/assets/markdown/reference/FunctionsAndMethods.md +208 -0
- package/fireflysite/assets/markdown/reference/ModulesAndPackages.md +168 -0
- package/fireflysite/assets/markdown/reference/PatternMatching.md +224 -0
- package/fireflysite/assets/markdown/reference/StatementsAndExpressions.md +86 -0
- package/fireflysite/assets/markdown/reference/TraitsAndInstances.md +100 -0
- package/fireflysite/assets/markdown/reference/UserDefinedTypes.md +184 -0
- package/fireflysite/assets/markdown/scratch/ControlFlow.md +136 -0
- package/fireflysite/assets/markdown/scratch/Toc.md +41 -0
- package/lsp/Handler.ff +4 -4
- package/lsp/LanguageServer.ff +5 -5
- package/lux/Lux.ff +9 -9
- package/lux/Main2.ff +1 -1
- package/output/js/ff/compiler/Builder.mjs +4 -4
- package/output/js/ff/compiler/Inference.mjs +2 -2
- package/output/js/ff/compiler/JsEmitter.mjs +18 -72
- package/output/js/ff/compiler/Main.mjs +4 -4
- package/output/js/ff/compiler/ModuleCache.mjs +4 -4
- package/output/js/ff/core/Float.mjs +50 -0
- package/output/js/ff/core/NodeSystem.mjs +4 -4
- package/output/js/ff/core/Task.mjs +8 -8
- package/output/js/ff/core/Try.mjs +98 -4
- package/package.json +1 -1
- package/postgresql/Pg.ff +1 -1
- package/vscode/package.json +15 -1
- package/vscode/syntaxes/firefly-markdown-injection.json +45 -0
- package/webserver/.firefly/include/package-lock.json +7 -1
- /package/fireflysite/{firefly-logo-notext.png → assets/image/firefly-logo-notext.png} +0 -0
package/compiler/Builder.ff
CHANGED
|
@@ -145,11 +145,11 @@ check(
|
|
|
145
145
|
} else {
|
|
146
146
|
compiler.resolve(resolvedDependencies.mainPackagePair, localFile.dropLast(".ff".size()))
|
|
147
147
|
}
|
|
148
|
-
}
|
|
148
|
+
} tryCatch {| CompileError(_, _) @ c, error =>
|
|
149
149
|
errors.push(c)
|
|
150
150
|
} catch {| CompileErrors(compileErrors), error =>
|
|
151
151
|
errors.pushList(compileErrors)
|
|
152
|
-
}
|
|
152
|
+
}
|
|
153
153
|
}
|
|
154
154
|
cache.mergeVersions(compiler.cache)
|
|
155
155
|
}
|
package/compiler/Compiler.ff
CHANGED
|
@@ -168,7 +168,7 @@ extend self: Compiler {
|
|
|
168
168
|
} catch {| CompileError(_, _) @ e, error =>
|
|
169
169
|
let newError = CompileError(import.at, "Parse error in imported module: " + import.package.groupName() + "/" + newModuleName)
|
|
170
170
|
throw(CompileErrors([e, newError]))
|
|
171
|
-
}
|
|
171
|
+
}
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
|
package/compiler/Inference.ff
CHANGED
|
@@ -479,7 +479,8 @@ extend self: Inference {
|
|
|
479
479
|
| a => a
|
|
480
480
|
})
|
|
481
481
|
| ECall e {e.target | DynamicCall c} {c.function | EField f} {
|
|
482
|
-
f.field == "else" || f.field == "elseIf" ||
|
|
482
|
+
f.field == "else" || f.field == "elseIf" ||
|
|
483
|
+
f.field == "tryCatch" || f.field == "tryCatchAny" || f.field == "tryFinally" ||
|
|
483
484
|
f.field == "catch" || f.field == "catchAny" || f.field == "finally"
|
|
484
485
|
} =>
|
|
485
486
|
e.ECall(target = c.DynamicCall(function = f.EField(record = semicolonUnit(f.record))))
|
package/compiler/JsEmitter.ff
CHANGED
|
@@ -86,7 +86,7 @@ extend self: JsEmitter {
|
|
|
86
86
|
body()
|
|
87
87
|
} finally {
|
|
88
88
|
self.emittingAsync = False
|
|
89
|
-
}
|
|
89
|
+
}
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
emitRun(functions: List[DFunction], mainPackagePair: PackagePair, bootstrapping: Bool): List[String] {
|
|
@@ -533,22 +533,16 @@ extend self: JsEmitter {
|
|
|
533
533
|
let d = self.emitDictionary(dictionary)
|
|
534
534
|
let a = self.emitArgument(at, argument, async)
|
|
535
535
|
"throw Object.assign(new Error(), {ffException: ff_core_Any.toAny_(" + a + ", " + d + ")})"
|
|
536
|
-
| ECall(at, StaticCall("ff:core/
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
| ECall(at, StaticCall("ff:core/Try.
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
| ECall(at, StaticCall("ff:core/Try.
|
|
545
|
-
|
|
546
|
-
| ECall(at, StaticCall("ff:core/Try.Try_catchAny", _, _), _, _, _, _) {!last} =>
|
|
547
|
-
throw(CompileError(at, "Statements can't be a catchAny without a grab"))
|
|
548
|
-
| ECall(at, StaticCall("ff:core/Try.Try_finally", _, _), _, _, _, _) {!last} =>
|
|
549
|
-
throw(CompileError(at, "Statements can't be a finally without a grab"))
|
|
550
|
-
| ECall(at, StaticCall("ff:core/Try.Try_grab", _, _), _, _, [argument], _) {
|
|
551
|
-
self.emitTryCatchFinally(argument.value, last, async) | Some(code)
|
|
536
|
+
| ECall(at, StaticCall("ff:core/Try.Try_catch", _, _), _, _, _, _) {
|
|
537
|
+
self.emitTryCatchFinally(term, last, async) | Some(code)
|
|
538
|
+
} =>
|
|
539
|
+
code
|
|
540
|
+
| ECall(at, StaticCall("ff:core/Try.Try_catchAny", _, _), _, _, _, _) {
|
|
541
|
+
self.emitTryCatchFinally(term, last, async) | Some(code)
|
|
542
|
+
} =>
|
|
543
|
+
code
|
|
544
|
+
| ECall(at, StaticCall("ff:core/Try.Try_finally", _, _), _, _, _, _) {
|
|
545
|
+
self.emitTryCatchFinally(term, last, async) | Some(code)
|
|
552
546
|
} =>
|
|
553
547
|
code
|
|
554
548
|
| ECall(at, StaticCall("ff:unsafejs/UnsafeJs.throwIfCancelled", _, _), _, _, [], _) =>
|
package/compiler/Main.ff
CHANGED
|
@@ -148,9 +148,9 @@ main(system: NodeSystem): Unit {
|
|
|
148
148
|
try {
|
|
149
149
|
let command = parseCommandLine(system.arguments())
|
|
150
150
|
runCommand(command)
|
|
151
|
-
}
|
|
151
|
+
} tryCatch {| CommandLineError(message), _ =>
|
|
152
152
|
Log.debug(message)
|
|
153
|
-
}
|
|
153
|
+
} tryCatch {| CompileError(at, message), _ =>
|
|
154
154
|
Log.debug(message)
|
|
155
155
|
Log.debug(" at " + at.file.replace("./", "") + ":" + at.line + ":" + at.column)
|
|
156
156
|
} catch {| CompileErrors(errors), _ =>
|
|
@@ -158,7 +158,7 @@ main(system: NodeSystem): Unit {
|
|
|
158
158
|
Log.debug(message)
|
|
159
159
|
Log.debug(" at " + at.file.replace("./", "") + ":" + at.line + ":" + at.column)
|
|
160
160
|
}
|
|
161
|
-
}
|
|
161
|
+
}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
usageString = """
|
package/compiler/ModuleCache.ff
CHANGED
package/compiler/Tokenizer.ff
CHANGED
|
@@ -268,7 +268,7 @@ tokenize(file: String, code: String, completionAt: Option[Location], attemptFixe
|
|
|
268
268
|
}
|
|
269
269
|
} catch {| GrabException e, error =>
|
|
270
270
|
throw(CompileError(Location(file, line, i - lineOffset), "Unexpected end of file"))
|
|
271
|
-
}
|
|
271
|
+
}
|
|
272
272
|
|
|
273
273
|
List.range(5).each {_ => emitToken(LEnd, i, i) }
|
|
274
274
|
|