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
|
@@ -29,20 +29,18 @@ render(lux: Lux): Unit {
|
|
|
29
29
|
lux.useState(""): password2, setPassword2 =>
|
|
30
30
|
passwordInput(password1, setPassword1)
|
|
31
31
|
passwordInput(password2, setPassword2)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
)
|
|
32
|
+
lux.div {
|
|
33
|
+
if(password1 != password2) {
|
|
34
|
+
lux.text("Passwords don't match!")
|
|
35
|
+
} elseIf {password2.size() != 0} {
|
|
36
|
+
lux.text("Passwords match!")
|
|
37
|
+
}
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
newDocument(): Document {
|
|
45
|
-
|
|
43
|
+
ReadyDocument([
|
|
46
44
|
Section(name, [
|
|
47
45
|
Paragraph([Text("Two passwords fields and a check that they match.")])
|
|
48
46
|
])
|
|
@@ -69,14 +67,12 @@ newDocument(): Document {
|
|
|
69
67
|
lux.useState(""): password2, setPassword2 =>
|
|
70
68
|
passwordInput(password1, setPassword1)
|
|
71
69
|
passwordInput(password2, setPassword2)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
)
|
|
70
|
+
lux.div {
|
|
71
|
+
if(password1 != password2) {
|
|
72
|
+
lux.text("Passwords don't match!")
|
|
73
|
+
} elseIf {password2.size() != 0} {
|
|
74
|
+
lux.text("Passwords match!")
|
|
75
|
+
}
|
|
80
76
|
}
|
|
81
77
|
}
|
|
82
78
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Guide
|
|
2
|
+
import Lux from ff:lux
|
|
3
|
+
import LuxEvent from ff:lux
|
|
4
|
+
|
|
5
|
+
name = "Connecting to PostgreSQL"
|
|
6
|
+
|
|
7
|
+
newDocument(): Document {
|
|
8
|
+
ReadyDocument([
|
|
9
|
+
Section(name, [
|
|
10
|
+
Paragraph([Text("Connect to a PostgreSQL database and run a query.")])
|
|
11
|
+
Paragraph([Text("Add a dependency on "), Code("ff:postgresql"), Text(":")])
|
|
12
|
+
CodeBlock("""
|
|
13
|
+
dependency ff:postgresql:0.0.0
|
|
14
|
+
""", firefly = True)
|
|
15
|
+
Paragraph([Text("Import the"), Code("Pg"), Text("module from it:")])
|
|
16
|
+
CodeBlock("""
|
|
17
|
+
import Pg from ff:postgresql
|
|
18
|
+
""", firefly = True)
|
|
19
|
+
Paragraph([Text("Create a connection pool with the appropriate connection parameters:")])
|
|
20
|
+
CodeBlock("""
|
|
21
|
+
let pool = Pg.newPool(...)
|
|
22
|
+
""", firefly = True)
|
|
23
|
+
Paragraph([Text("And run your first transaction, e.g.:")])
|
|
24
|
+
CodeBlock("""
|
|
25
|
+
pool.transaction {connection =>
|
|
26
|
+
let emails = connection.statement("select email from users")
|
|
27
|
+
.map {row => row.getString("email").grab()}
|
|
28
|
+
Log.debug(emails)
|
|
29
|
+
}
|
|
30
|
+
""", firefly = True)
|
|
31
|
+
Paragraph([Text("Note that"), Code(".map", firefly = True), Text("here runs for each row of the result.")])
|
|
32
|
+
])
|
|
33
|
+
])
|
|
34
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Guide
|
|
2
|
+
import ReferenceIntroduction
|
|
3
|
+
|
|
4
|
+
mock(): List[Document] {
|
|
5
|
+
[
|
|
6
|
+
ReferenceIntroduction.new()
|
|
7
|
+
UnfetchedDocument("Modules and packages")
|
|
8
|
+
UnfetchedDocument("Base types")
|
|
9
|
+
UnfetchedDocument("User defined types")
|
|
10
|
+
UnfetchedDocument("Statements and expressions")
|
|
11
|
+
UnfetchedDocument("Functions and methods")
|
|
12
|
+
UnfetchedDocument("Pattern matching")
|
|
13
|
+
UnfetchedDocument("Traits and instances")
|
|
14
|
+
UnfetchedDocument("Exceptions")
|
|
15
|
+
UnfetchedDocument("JavaScript interop")
|
|
16
|
+
UnfetchedDocument("Async I/O")
|
|
17
|
+
UnfetchedDocument("Structured concurrency")
|
|
18
|
+
]
|
|
19
|
+
}
|