diff options
author | Eduardo Julian | 2017-05-03 18:17:00 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-05-03 18:17:00 -0400 |
commit | bf47bd7b3d4f70bc3a481761b8e9ff074313fb44 (patch) | |
tree | 7f5f0f625b59eff108d2b2652fa604c4b4aec3fc /new-luxc/source/luxc/compiler | |
parent | 3f146f8372758c39ece0b9a4c19f4f408e8400ea (diff) |
- WIP: Implemented more functionality.
- Lots of refactorings.
Diffstat (limited to 'new-luxc/source/luxc/compiler')
-rw-r--r-- | new-luxc/source/luxc/compiler/expr.jvm.lux | 15 | ||||
-rw-r--r-- | new-luxc/source/luxc/compiler/runtime.jvm.lux | 7 | ||||
-rw-r--r-- | new-luxc/source/luxc/compiler/statement.jvm.lux | 6 |
3 files changed, 18 insertions, 10 deletions
diff --git a/new-luxc/source/luxc/compiler/expr.jvm.lux b/new-luxc/source/luxc/compiler/expr.jvm.lux index 6655abd5f..138d0d540 100644 --- a/new-luxc/source/luxc/compiler/expr.jvm.lux +++ b/new-luxc/source/luxc/compiler/expr.jvm.lux @@ -2,26 +2,29 @@ lux (lux (control monad) (data text/format) - [macro #+ Monad<Lux>]) + [macro #+ Monad<Lux> "Lux/" Monad<Lux>]) (luxc ["&" base] - ["&;" module] - ["&;" env] + lang ["&;" analyser] - ["&;" synthesizer #+ Synthesis])) + ["&;" synthesizer])) (type: #export JVM-Bytecode Void) -(type: Compiled +(type: #export Compiled JVM-Bytecode) (def: (compile-synthesis synthesis) (-> Synthesis Compiled) (undefined)) +(def: (eval type code) + Eval + (undefined)) + (def: #export (compile input) (-> AST (Lux Compiled)) (|> input - &analyser;analyse + (&analyser;analyse eval) (Lux/map &synthesizer;synthesize) (Lux/map compile-synthesis))) diff --git a/new-luxc/source/luxc/compiler/runtime.jvm.lux b/new-luxc/source/luxc/compiler/runtime.jvm.lux index 2d48b3617..b6cebb193 100644 --- a/new-luxc/source/luxc/compiler/runtime.jvm.lux +++ b/new-luxc/source/luxc/compiler/runtime.jvm.lux @@ -1,6 +1,11 @@ (;module: lux (lux (control monad) - (data text/format)) + (concurrency ["P" promise "P/" Monad<Promise>]) + (data text/format + ["E" error])) (luxc ["&" base])) +(def: #export (compile-runtime _) + (-> Top (P;Promise (E;Error Unit))) + (P/wrap (#E;Success []))) diff --git a/new-luxc/source/luxc/compiler/statement.jvm.lux b/new-luxc/source/luxc/compiler/statement.jvm.lux index c4c23746e..0e53ba37d 100644 --- a/new-luxc/source/luxc/compiler/statement.jvm.lux +++ b/new-luxc/source/luxc/compiler/statement.jvm.lux @@ -11,16 +11,16 @@ ["&;" env] (compiler ["&;" expr]))) -(def: (compile-def def-name def-value def-meta) +(def: #export (compile-def def-name def-value def-meta) (-> Text AST AST (Lux Unit)) (do Monad<Lux> [=def-value (&expr;compile def-value) =def-meta (&expr;compile def-meta)] (undefined))) -(def: (compile-program prog-args prog-body) +(def: #export (compile-program prog-args prog-body) (-> Text AST (Lux Unit)) (do Monad<Lux> [=prog-body (&env;with-local [prog-args (type (List Text))] - (&expr;compile prog-body))] + (&expr;compile prog-body))] (undefined))) |