aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/eval.lux
blob: eb16cc433f38b281175e876fb1b8c81bbae2cbf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
(.module:
  lux
  (lux (control [monad #+ do])
       [macro])
  (luxc ["&" lang]
        (lang [".L" extension]
              (analysis [".A" expression])
              (synthesis [".S" expression])
              (translation (jvm [".T" expression]
                                [".T" eval])))))

(def: #export (eval type exprC)
  &.Eval
  (do macro.Monad<Meta>
    [exprA (&.with-type type
             (expressionA.analyser eval exprC))
     syntheses extensionL.all-syntheses
     #let [exprS (expressionS.synthesize syntheses exprA)]
     exprI (expressionT.translate exprS)]
    (evalT.eval exprI)))