aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/jvm/extension/host.lux
diff options
context:
space:
mode:
authorEduardo Julian2020-03-19 21:18:58 -0400
committerEduardo Julian2020-03-19 21:18:58 -0400
commit6b8678f818a5f7399a50f4e2108d96783d22fd67 (patch)
treeade6d0a7b3c2dd7a826a90a56dc6e94600b59bbb /new-luxc/source/luxc/lang/translation/jvm/extension/host.lux
parent409deaa8f8a9727cf42762c8ac8ebe5b2766a04b (diff)
Got the new compiler to build again.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/jvm/extension/host.lux')
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/extension/host.lux154
1 files changed, 78 insertions, 76 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/extension/host.lux b/new-luxc/source/luxc/lang/translation/jvm/extension/host.lux
index 7569a825e..cf039db68 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/extension/host.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/extension/host.lux
@@ -946,87 +946,89 @@
## (:: type.equivalence = type.double returnT)
_.DRETURN))))
-(def: class::anonymous
- Handler
- (..custom
- [($_ <>.and
- <s>.text
- ..class
- (<s>.tuple (<>.some ..class))
- (<s>.tuple (<>.some ..input))
- (<s>.tuple (<>.some ..overriden-method-definition)))
- (function (_ extension-name generate archive [class-name
- super-class super-interfaces
- inputsTS
- overriden-methods])
- (do phase.monad
- [#let [class (type.class class-name (list))
- total-environment (|> overriden-methods
- ## Get all the environments.
- (list@map product.left)
- ## Combine them.
- list@join
- ## Remove duplicates.
- (set.from-list reference.hash)
- set.to-list)
- global-mapping (|> total-environment
- ## Give them names as "foreign" variables.
- list.enumerate
- (list@map (function (_ [id capture])
- [capture (#reference.Foreign id)]))
- (dictionary.from-list reference.hash))
- normalized-methods (list@map (function (_ [environment
- [ownerT name
- strict-fp? annotations vars
- self-name arguments returnT exceptionsT
- body]])
- (let [local-mapping (|> environment
- list.enumerate
- (list@map (function (_ [foreign-id capture])
- [(#reference.Foreign foreign-id)
- (|> global-mapping
- (dictionary.get capture)
- maybe.assume)]))
- (dictionary.from-list reference.hash))]
- [ownerT name
- strict-fp? annotations vars
- self-name arguments returnT exceptionsT
- (normalize-method-body local-mapping body)]))
- overriden-methods)]
- inputsTI (monad.map @ (generate-input generate archive) inputsTS)
- method-definitions (|> normalized-methods
- (monad.map @ (function (_ [ownerT name
- strict-fp? annotations vars
- self-name arguments returnT exceptionsT
- bodyS])
- (do @
- [bodyG (generation.with-specific-context class-name
- (generate archive bodyS))]
- (wrap (_def.method #$.Public
- (if strict-fp?
- ($_ $.++M $.finalM $.strictM)
- $.finalM)
- name
- (type.method [(list@map product.right arguments)
- returnT
- exceptionsT])
- (|>> bodyG (returnI returnT)))))))
- (:: @ map _def.fuse))
- _ (generation.save! true ["" class-name]
- [class-name
- (_def.class #$.V1_6 #$.Public $.finalC
- class-name (list)
- super-class super-interfaces
- (|>> (///function.with-environment total-environment)
- (..with-anonymous-init class total-environment super-class inputsTI)
- method-definitions))])]
- (anonymous-instance class total-environment)))]))
+## TODO: Uncomment ASAP
+## (def: class::anonymous
+## Handler
+## (..custom
+## [($_ <>.and
+## <s>.text
+## ..class
+## (<s>.tuple (<>.some ..class))
+## (<s>.tuple (<>.some ..input))
+## (<s>.tuple (<>.some ..overriden-method-definition)))
+## (function (_ extension-name generate archive [class-name
+## super-class super-interfaces
+## inputsTS
+## overriden-methods])
+## (do phase.monad
+## [#let [class (type.class class-name (list))
+## total-environment (|> overriden-methods
+## ## Get all the environments.
+## (list@map product.left)
+## ## Combine them.
+## list@join
+## ## Remove duplicates.
+## (set.from-list reference.hash)
+## set.to-list)
+## global-mapping (|> total-environment
+## ## Give them names as "foreign" variables.
+## list.enumerate
+## (list@map (function (_ [id capture])
+## [capture (#reference.Foreign id)]))
+## (dictionary.from-list reference.hash))
+## normalized-methods (list@map (function (_ [environment
+## [ownerT name
+## strict-fp? annotations vars
+## self-name arguments returnT exceptionsT
+## body]])
+## (let [local-mapping (|> environment
+## list.enumerate
+## (list@map (function (_ [foreign-id capture])
+## [(#reference.Foreign foreign-id)
+## (|> global-mapping
+## (dictionary.get capture)
+## maybe.assume)]))
+## (dictionary.from-list reference.hash))]
+## [ownerT name
+## strict-fp? annotations vars
+## self-name arguments returnT exceptionsT
+## (normalize-method-body local-mapping body)]))
+## overriden-methods)]
+## inputsTI (monad.map @ (generate-input generate archive) inputsTS)
+## method-definitions (|> normalized-methods
+## (monad.map @ (function (_ [ownerT name
+## strict-fp? annotations vars
+## self-name arguments returnT exceptionsT
+## bodyS])
+## (do @
+## [bodyG (generation.with-specific-context class-name
+## (generate archive bodyS))]
+## (wrap (_def.method #$.Public
+## (if strict-fp?
+## ($_ $.++M $.finalM $.strictM)
+## $.finalM)
+## name
+## (type.method [(list@map product.right arguments)
+## returnT
+## exceptionsT])
+## (|>> bodyG (returnI returnT)))))))
+## (:: @ map _def.fuse))
+## _ (generation.save! true ["" class-name]
+## [class-name
+## (_def.class #$.V1_6 #$.Public $.finalC
+## class-name (list)
+## super-class super-interfaces
+## (|>> (///function.with-environment total-environment)
+## (..with-anonymous-init class total-environment super-class inputsTI)
+## method-definitions))])]
+## (anonymous-instance class total-environment)))]))
(def: bundle::class
Bundle
(<| (bundle.prefix "class")
(|> (: Bundle bundle.empty)
- (bundle.install "anonymous" class::anonymous)
+ ## TODO: Uncomment ASAP
+ ## (bundle.install "anonymous" class::anonymous)
)))
(def: #export bundle