aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/extension.lux
blob: 49a37153cce81d7a9a37a1156ceb275ea48d2193 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
(.module:
  [library
   [lux "*"
    ["$" documentation {"+" [documentation:]}]
    ["." debug]
    [control
     ["<>" parser
      ["<.>" code]]]
    [data
     ["." text {"+" [\n]}
      ["%" format {"+" [format]}]]
     [collection
      ["." row]]]
    [macro
     ["." template]]
    ["@" target
     ["." jvm]]
    [tool
     [compiler
      ["." phase]
      [language
       [lux
        [phase
         ["." directive]]]]]]]]
  [\\library
   ["." /]])

(documentation: /.analysis:
  "Mechanism for defining extensions to Lux's analysis/type-checking infrastructure."
  [(analysis: ("my analysis" self phase archive [pass_through <code>.any])
     (phase archive pass_through))])

(documentation: /.synthesis:
  "Mechanism for defining extensions to Lux's synthesis/optimization infrastructure."
  [(synthesis: ("my synthesis" self phase archive [pass_through <analysis>.any])
     (phase archive pass_through))])

(documentation: /.generation:
  ""
  [(generation: ("my generation" self phase archive [pass_through <synthesis>.any])
     (for {@.jvm
           (\ phase.monad each (|>> #jvm.Embedded
                                    row.row)
              (phase archive pass_through))}
          (phase archive pass_through)))])

(documentation: /.directive:
  ""
  [(directive: ("my directive" self phase archive [parameters (<>.some <code>.any)])
     (do phase.monad
       [.let [_ (debug.log! (format "Successfully installed directive " (%.text self) "!"))]]
       (in directive.no_requirements)))])

(.def: .public documentation
  (.List $.Module)
  ($.module /._
            ""
            [..analysis:
             ..synthesis:
             ..generation:
             ..directive:]
            []))