aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/extension.lux
blob: 06fa4e43ad677de78d3e8ac80b2ed2fa2a18d842 (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
(.using
 [library
  [lux (.except)
   ["$" documentation (.only documentation:)]
   ["[0]" debug]
   [control
    ["<>" parser
     ["<[0]>" code]]]
   [data
    [text
     ["%" format (.only format)]]
    [collection
     ["[0]" sequence]]]
   [macro
    ["[0]" template]]
   ["@" target
    ["[0]" jvm]]
   [tool
    [compiler
     ["[0]" phase]
     [language
      [lux
       [phase
        ["[0]" directive]]]]]]]]
 [\\library
  ["[0]" /]])

(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}
                                   sequence.sequence)
             (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:]
            []))