From 4b7d81c1e0449adc031ece6299fe4d0a09f66347 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 1 May 2018 00:40:01 -0400 Subject: - WIP: - Initial PHP back-end implementation [missing procedures]. --- new-luxc/source/luxc/lang/translation/php.lux | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/php.lux') diff --git a/new-luxc/source/luxc/lang/translation/php.lux b/new-luxc/source/luxc/lang/translation/php.lux index 4cfcaaa0f..eeaa95309 100644 --- a/new-luxc/source/luxc/lang/translation/php.lux +++ b/new-luxc/source/luxc/lang/translation/php.lux @@ -46,9 +46,8 @@ (host.import javax/script/ScriptEngine (eval [String] #try Object)) -(host.import javax/script/ScriptEngineManager - (new []) - (getEngineByName [String] ScriptEngine)) +(host.import org/develnext/jphp/scripting/JPHPScriptEngine + (new [])) (type: #export Anchor [Text Register]) @@ -62,16 +61,15 @@ (def: #export init (IO Host) - (io (let [interpreter (|> (ScriptEngineManager::new []) - (ScriptEngineManager::getEngineByName ["jphp"]))] + (io (let [interpreter (JPHPScriptEngine::new [])] {#context ["" +0] #anchor #.None #loader (function (_ code) (do e.Monad - [_ (ScriptEngine::eval [(format " compiler (get@ #.host) (:! Host) (get@ ))] (case (runner code) (#e.Error error) - (exec (log! (:! Text code)) - ((lang.throw Cannot-Execute error) compiler)) + ((lang.throw Cannot-Execute error) compiler) (#e.Success output) (#e.Success [compiler output])))))] @@ -192,7 +189,7 @@ (-> Statement (Meta Unit)) (do macro.Monad [module-buffer module-buffer - #let [_ (Appendable::append [(:! CharSequence (_.statement code))] + #let [_ (Appendable::append [(:! CharSequence (_.code code))] module-buffer)]] (load! code))) -- cgit v1.2.3