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/structure.jvm.lux | |
parent | fac2fa47c11db08596c890290bae09bf57a27089 (diff) |
- WIP: - Initial PHP back-end implementation.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/php/structure.jvm.lux | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/new-luxc/source/luxc/lang/translation/php/structure.jvm.lux b/new-luxc/source/luxc/lang/translation/php/structure.jvm.lux new file mode 100644 index 000000000..6e44f3973 --- /dev/null +++ b/new-luxc/source/luxc/lang/translation/php/structure.jvm.lux @@ -0,0 +1,31 @@ +(.module: + lux + (lux (control [monad #+ do]) + (data [text] + text/format) + [macro]) + (luxc ["&" lang] + (lang [synthesis #+ Synthesis] + (host ["_" php #+ Expression CExpression]))) + [//] + (// [".T" runtime])) + +(def: #export (translate-tuple translate elemsS+) + (-> //.Translator (List Synthesis) (Meta Expression)) + (case elemsS+ + #.Nil + (:: macro.Monad<Meta> wrap runtimeT.unit) + + (#.Cons singletonS #.Nil) + (translate singletonS) + + _ + (do macro.Monad<Meta> + [elemsT+ (monad.map @ translate elemsS+)] + (wrap (_.array/* elemsT+))))) + +(def: #export (translate-variant translate tag tail? valueS) + (-> //.Translator Nat Bool Synthesis (Meta CExpression)) + (do macro.Monad<Meta> + [valueT (translate valueS)] + (wrap (runtimeT.variant tag tail? valueT)))) |