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.
Files changed (67) hide show
  1. package/compiler/Builder.ff +2 -2
  2. package/compiler/Compiler.ff +1 -1
  3. package/compiler/Inference.ff +2 -1
  4. package/compiler/JsEmitter.ff +11 -17
  5. package/compiler/Main.ff +3 -3
  6. package/compiler/ModuleCache.ff +1 -1
  7. package/compiler/Tokenizer.ff +1 -1
  8. package/compiler/Unification.ff +1 -1
  9. package/core/.firefly/include/package-lock.json +267 -97
  10. package/core/.firefly/include/package.json +1 -1
  11. package/core/Float.ff +25 -0
  12. package/core/Lock.ff +1 -1
  13. package/core/NodeSystem.ff +1 -1
  14. package/core/Stream.ff +9 -9
  15. package/core/Task.ff +3 -3
  16. package/core/Try.ff +25 -4
  17. package/experimental/s3/S3TestAuthorizationHeader.ff +2 -1
  18. package/experimental/s3/S3TestPut.ff +2 -1
  19. package/fireflysite/CommunityOverview.ff +2 -2
  20. package/fireflysite/CountingButtonDemo.ff +1 -1
  21. package/fireflysite/DocumentParser.ff +332 -0
  22. package/fireflysite/ExamplesOverview.ff +11 -2
  23. package/fireflysite/FrontPage.ff +344 -0
  24. package/fireflysite/{GuideIntroduction.ff → GettingStarted.ff} +1 -25
  25. package/fireflysite/Guide.ff +239 -104
  26. package/fireflysite/Main.ff +100 -51
  27. package/fireflysite/MatchingPasswordsDemo.ff +13 -17
  28. package/fireflysite/PackagesOverview.ff +1 -1
  29. package/fireflysite/PostgresqlDemo.ff +34 -0
  30. package/fireflysite/ReferenceAll.ff +19 -0
  31. package/fireflysite/ReferenceIntroduction.ff +11 -0
  32. package/fireflysite/Styles.ff +358 -97
  33. package/fireflysite/Test.ff +38 -0
  34. package/fireflysite/assets/font/NotoSansMono-Regular.ttf +0 -0
  35. package/fireflysite/assets/font/NunitoSans-VariableFont_YTLC,opsz,wdth,wght.ttf +0 -0
  36. package/fireflysite/assets/image/autocomplete-small.png +0 -0
  37. package/fireflysite/assets/image/autocomplete.png +0 -0
  38. package/fireflysite/assets/image/edit-time-error.png +0 -0
  39. package/fireflysite/assets/image/firefly-logo-yellow.png +0 -0
  40. package/fireflysite/assets/markdown/reference/BaseTypes.md +209 -0
  41. package/fireflysite/assets/markdown/reference/FunctionsAndMethods.md +208 -0
  42. package/fireflysite/assets/markdown/reference/ModulesAndPackages.md +168 -0
  43. package/fireflysite/assets/markdown/reference/PatternMatching.md +224 -0
  44. package/fireflysite/assets/markdown/reference/StatementsAndExpressions.md +86 -0
  45. package/fireflysite/assets/markdown/reference/TraitsAndInstances.md +100 -0
  46. package/fireflysite/assets/markdown/reference/UserDefinedTypes.md +184 -0
  47. package/fireflysite/assets/markdown/scratch/ControlFlow.md +136 -0
  48. package/fireflysite/assets/markdown/scratch/Toc.md +41 -0
  49. package/lsp/Handler.ff +4 -4
  50. package/lsp/LanguageServer.ff +5 -5
  51. package/lux/Lux.ff +9 -9
  52. package/lux/Main2.ff +1 -1
  53. package/output/js/ff/compiler/Builder.mjs +4 -4
  54. package/output/js/ff/compiler/Inference.mjs +2 -2
  55. package/output/js/ff/compiler/JsEmitter.mjs +18 -72
  56. package/output/js/ff/compiler/Main.mjs +4 -4
  57. package/output/js/ff/compiler/ModuleCache.mjs +4 -4
  58. package/output/js/ff/core/Float.mjs +50 -0
  59. package/output/js/ff/core/NodeSystem.mjs +4 -4
  60. package/output/js/ff/core/Task.mjs +8 -8
  61. package/output/js/ff/core/Try.mjs +98 -4
  62. package/package.json +1 -1
  63. package/postgresql/Pg.ff +1 -1
  64. package/vscode/package.json +15 -1
  65. package/vscode/syntaxes/firefly-markdown-injection.json +45 -0
  66. package/webserver/.firefly/include/package-lock.json +7 -1
  67. /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
- if(password2.size() != 0) {
33
- lux.text(
34
- if(password1 == password2) {
35
- "Passwords match!"
36
- } else {
37
- "Passwords don't match."
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
- Document([
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
- if(password2.size() != 0) {
73
- lux.text(
74
- if(password1 == password2) {
75
- "Passwords match!"
76
- } else {
77
- "Passwords don't match."
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
  }
@@ -3,7 +3,7 @@ import CountingButtonDemo
3
3
  import MatchingPasswordsDemo
4
4
 
5
5
  new(): Document {
6
- Document([
6
+ ReadyDocument([
7
7
  Section("Packages", [
8
8
  Paragraph([
9
9
  Text("Here you'll eventually find the package index.")
@@ -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
+ }
@@ -0,0 +1,11 @@
1
+ import Guide
2
+
3
+ new(): Document {
4
+ ReadyDocument([
5
+ Section("Reference", [
6
+ Paragraph([
7
+ Text("This is a reference for the Firefly programming language.")
8
+ ])
9
+ ])
10
+ ])
11
+ }