aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/lang/init.lux
blob: 9c909942e75f5d47f3b90130af02b25be9b0d993 (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
63
64
(.module:
  lux
  (// ["//." target]
      [".L" extension]
      (extension [".E" analysis]
                 ## [".E" synthesis]
                 ## [".E" translation]
                 ## [".E" statement]
                 )))

(def: #export (cursor file)
  (-> Text Cursor)
  [file +1 +0])

(def: #export (source file code)
  (-> Text Text Source)
  [(cursor file) +0 code])

(def: dummy-source
  Source
  [.dummy-cursor +0 ""])

(def: #export type-context
  Type-Context
  {#.ex-counter +0
   #.var-counter +0
   #.var-bindings (list)})

(type: #export Version Text)

(def: #export version Version "0.6.0")

(`` (def: #export info
      Info
      {#.target  (for {(~~ (static //target.common-lisp)) //target.common-lisp
                       (~~ (static //target.js))          //target.js
                       (~~ (static //target.jvm))         //target.jvm
                       (~~ (static //target.lua))         //target.lua
                       (~~ (static //target.php))         //target.php
                       (~~ (static //target.python))      //target.python
                       (~~ (static //target.r))           //target.r
                       (~~ (static //target.ruby))        //target.ruby
                       (~~ (static //target.scheme))      //target.scheme})
       #.version ..version
       #.mode    #.Build}))

(def: #export (compiler host)
  (-> Any Lux)
  {#.info            ..info
   #.source          dummy-source
   #.cursor          .dummy-cursor
   #.current-module  #.None
   #.modules         (list)
   #.scopes          (list)
   #.type-context    ..type-context
   #.expected        #.None
   #.seed            +0
   #.scope-type-vars (list)
   #.extensions      {#extensionL.analysis analysisE.defaults
                      #extensionL.synthesis (:!! []) ## synthesisE.defaults
                      #extensionL.translation (:!! []) ## translationE.defaults
                      #extensionL.statement (:!! []) ## statementE.defaults
                      }
   #.host            host})