diff options
author | Eduardo Julian | 2018-04-27 19:46:44 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-04-27 19:46:44 -0400 |
commit | f8d6348b3fec0c55768ebcd8dba446949b8a4ef7 (patch) | |
tree | 26aa0a2cc6309cfc6cba5b23d6a68f68934e40a4 /new-luxc/source/luxc/lang/translation/php/reference.jvm.lux | |
parent | fac2fa47c11db08596c890290bae09bf57a27089 (diff) |
- WIP: - Initial PHP back-end implementation.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/php/reference.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/php/reference.jvm.lux | 37 |
1 files changed, 37 insertions, 0 deletions
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 [<register> <prefix>] + [(def: #export <register> + (-> Register VExpression) + (|>> (:! Int) %i (format <prefix>) _.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 [<name> <input> <converter>] + [(def: #export <name> + (-> <input> (Meta VExpression)) + (|>> <converter> (:: macro.Monad<Meta> wrap)))] + + [translate-variable Variable local] + [translate-definition Ident global] + ) |