From f8d6348b3fec0c55768ebcd8dba446949b8a4ef7 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 27 Apr 2018 19:46:44 -0400 Subject: - WIP: - Initial PHP back-end implementation. --- .../luxc/lang/translation/php/reference.jvm.lux | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 new-luxc/source/luxc/lang/translation/php/reference.jvm.lux (limited to 'new-luxc/source/luxc/lang/translation/php/reference.jvm.lux') diff --git a/new-luxc/source/luxc/lang/translation/php/reference.jvm.lux b/new-luxc/source/luxc/lang/translation/php/reference.jvm.lux new file mode 100644 index 000000000..280710afc --- /dev/null +++ b/new-luxc/source/luxc/lang/translation/php/reference.jvm.lux @@ -0,0 +1,37 @@ +(.module: + lux + (lux [macro] + (data [text] + text/format)) + (luxc ["&" lang] + (lang [".L" variable #+ Variable Register] + (host ["_" php #+ VExpression]))) + [//] + (// [".T" runtime])) + +(do-template [ ] + [(def: #export + (-> Register VExpression) + (|>> (:! Int) %i (format ) _.var))] + + [closure "c"] + [variable "v"]) + +(def: #export (local var) + (-> Variable VExpression) + (if (variableL.captured? var) + (closure (variableL.captured-register var)) + (variable (:! Nat var)))) + +(def: #export global + (-> Ident VExpression) + (|>> //.definition-name _.var)) + +(do-template [ ] + [(def: #export + (-> (Meta VExpression)) + (|>> (:: macro.Monad wrap)))] + + [translate-variable Variable local] + [translate-definition Ident global] + ) -- cgit v1.2.3