From 9eaaaf953ba7ce1eeb805603f4e113aa15f5178f Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 8 Jan 2018 21:40:06 -0400 Subject: - Moved all translation code under the JVM path (in preparation for porting the JS back-end). --- new-luxc/source/luxc/lang/translation/eval.jvm.lux | 47 ---------------------- 1 file changed, 47 deletions(-) delete mode 100644 new-luxc/source/luxc/lang/translation/eval.jvm.lux (limited to 'new-luxc/source/luxc/lang/translation/eval.jvm.lux') diff --git a/new-luxc/source/luxc/lang/translation/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/eval.jvm.lux deleted file mode 100644 index 9cce16a49..000000000 --- a/new-luxc/source/luxc/lang/translation/eval.jvm.lux +++ /dev/null @@ -1,47 +0,0 @@ -(.module: - lux - (lux (control monad) - (data [text] - text/format) - [macro] - [host #+ do-to]) - (luxc ["&" lang] - (lang (host ["$" jvm] - (jvm ["$t" type] - ["$d" def] - ["$i" inst])) - ["la" analysis] - ["ls" synthesis] - (translation [".T" common])) - )) - -(host.import java/lang/reflect/Field - (get [Object] Object)) - -(host.import (java/lang/Class a) - (getField [String] Field)) - -(def: #export (eval valueI) - (-> $.Inst (Meta Top)) - (do macro.Monad - [current-module macro.current-module-name - class-name (:: @ map %code (macro.gensym (format current-module "/eval"))) - #let [store-name (text.replace-all "/" "." class-name) - bytecode ($d.class #$.V1_6 - #$.Public $.noneC - class-name - (list) ["java.lang.Object" (list)] - (list) - (|>> ($d.field #$.Public ($_ $.++F $.finalF $.staticF) - commonT.value-field commonT.$Object) - ($d.method #$.Public ($_ $.++M $.staticM $.strictM) - "" - ($t.method (list) #.None (list)) - (|>> valueI - ($i.PUTSTATIC store-name commonT.value-field commonT.$Object) - $i.RETURN))))] - _ (commonT.store-class store-name bytecode) - class (commonT.load-class store-name)] - (wrap (|> class - (Class::getField [commonT.value-field]) - (Field::get (host.null)))))) -- cgit v1.2.3