diff options
author | Eduardo Julian | 2017-06-12 21:14:55 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-06-12 21:14:55 -0400 |
commit | 9cd2927a4f6175784e081d6b512d3e900c8069e7 (patch) | |
tree | d1fe512bc84ea1e3a50ad86eeb3265771edd23c6 /new-luxc/source/luxc/compiler/common.jvm.lux | |
parent | c50667a431a5ca67328a230f0c59956dc6ff43fa (diff) |
- Renamed the "compilation" phase as the "generation" phase.
- Implemented compilation of primitives.
- Implemented compilation of structures.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/compiler/common.jvm.lux | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/new-luxc/source/luxc/compiler/common.jvm.lux b/new-luxc/source/luxc/compiler/common.jvm.lux deleted file mode 100644 index bd5487ef6..000000000 --- a/new-luxc/source/luxc/compiler/common.jvm.lux +++ /dev/null @@ -1,65 +0,0 @@ -(;module: - lux - (lux (concurrency ["A" atom]) - (data ["R" result] - (coll ["D" dict])) - [macro] - [host #+ jvm-import])) - -## [Host] -(jvm-import org.objectweb.asm.MethodVisitor - (visitLdcInsn [Object] void)) - -(jvm-import java.lang.ClassLoader) - -## [Types] -(type: #export Compiled - Unit) - -(type: #export Blob host;Byte-Array) - -(type: #export Class-Store (A;Atom (D;Dict Text Blob))) - -(type: #export Host - {#visitor (Maybe MethodVisitor) - #loader ClassLoader - #store Class-Store}) - -(def: #export unit-value Text "\u0000unit\u0000") - -(def: (visitor::get compiler) - (-> Compiler (Maybe MethodVisitor)) - (|> (get@ #;host compiler) - (:! Host) - (get@ #visitor))) - -(def: (visitor::put ?visitor compiler) - (-> (Maybe MethodVisitor) Compiler Compiler) - (update@ #;host - (function [host] - (|> host - (:! Host) - (set@ #visitor ?visitor) - (:! Void))) - compiler)) - -(def: #export get-visitor - (Lux MethodVisitor) - (function [compiler] - (case (visitor::get compiler) - #;None - (#R;Error "No visitor has been set.") - - (#;Some visitor) - (#R;Success [compiler visitor])))) - -(def: #export (with-visitor visitor body) - (All [a] (-> MethodVisitor (Lux a) (Lux a))) - (function [compiler] - (case (macro;run' (visitor::put (#;Some visitor) compiler) body) - (#R;Error error) - (#R;Error error) - - (#R;Success [compiler' output]) - (#R;Success [(visitor::put (visitor::get compiler) compiler') - output])))) |