From 022ada35548ef5e0e3b9614f9bb96de9d2137ced Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 10 May 2018 00:04:20 -0400 Subject: - Re-named "Compiler" type to "Lux". --- new-luxc/project.clj | 2 +- new-luxc/source/luxc/lang/init.lux | 2 +- new-luxc/source/luxc/lang/macro.lux | 2 +- new-luxc/source/luxc/lang/translation.lux | 8 ++++---- .../source/luxc/lang/translation/js/imports.jvm.lux | 4 ++-- .../source/luxc/lang/translation/jvm/common.jvm.lux | 3 +-- .../source/luxc/lang/translation/jvm/imports.jvm.lux | 18 +++++++++--------- new-luxc/source/luxc/repl.lux | 8 ++++---- new-luxc/test/test/luxc/common.lux | 6 +++--- 9 files changed, 26 insertions(+), 27 deletions(-) (limited to 'new-luxc') diff --git a/new-luxc/project.clj b/new-luxc/project.clj index 674fdc506..b92276a50 100644 --- a/new-luxc/project.clj +++ b/new-luxc/project.clj @@ -20,7 +20,7 @@ :dependencies [;; JVM Bytecode [org.ow2.asm/asm-all "5.0.3"] - ;; LUA + ;; Lua [net.sandius.rembulan/rembulan-runtime "0.1-SNAPSHOT"] [net.sandius.rembulan/rembulan-stdlib "0.1-SNAPSHOT"] [net.sandius.rembulan/rembulan-compiler "0.1-SNAPSHOT"] diff --git a/new-luxc/source/luxc/lang/init.lux b/new-luxc/source/luxc/lang/init.lux index 73b2baf0a..da8fc9c07 100644 --- a/new-luxc/source/luxc/lang/init.lux +++ b/new-luxc/source/luxc/lang/init.lux @@ -34,7 +34,7 @@ #.mode #.Build}) (def: #export (compiler host) - (-> Top Compiler) + (-> Top Lux) {#.info ..info #.source dummy-source #.cursor .dummy-cursor diff --git a/new-luxc/source/luxc/lang/macro.lux b/new-luxc/source/luxc/lang/macro.lux index cde3209fc..043f0df93 100644 --- a/new-luxc/source/luxc/lang/macro.lux +++ b/new-luxc/source/luxc/lang/macro.lux @@ -30,6 +30,6 @@ (host.array-write +0 (:! Object inputs)) (host.array-write +1 (:! Object compiler)))] apply-method)] - (:! (e.Error [Compiler (List Code)]) + (:! (e.Error [Lux (List Code)]) output)))))) }) diff --git a/new-luxc/source/luxc/lang/translation.lux b/new-luxc/source/luxc/lang/translation.lux index cd9214885..4cab6d682 100644 --- a/new-luxc/source/luxc/lang/translation.lux +++ b/new-luxc/source/luxc/lang/translation.lux @@ -67,7 +67,7 @@ (wrap [annsI (:! Code annsV)]))) (def: (switch-compiler new-compiler) - (-> Compiler (Meta Aliases)) + (-> Lux (Meta Aliases)) (function (_ old-compiler) ((do macro.Monad [this macro.current-module] @@ -75,7 +75,7 @@ new-compiler))) (def: #export (translate translate-module aliases code) - (-> (-> Text Compiler (Process Compiler)) Aliases Code (Meta Aliases)) + (-> (-> Text Lux (Process Lux)) Aliases Code (Meta Aliases)) (case code (^code ("lux module" (~ annsC))) (do macro.Monad @@ -184,7 +184,7 @@ (def: no-aliases Aliases (dict.new text.Hash)) (def: #export (translate-module source-dirs target-dir module-name compiler) - (-> (List File) File Text Compiler (Process Compiler)) + (-> (List File) File Text Lux (Process Lux)) (do io.Monad [[file-name file-content] (&io.read source-dirs module-name) #let [module-hash (text/hash file-content) @@ -241,7 +241,7 @@ )) (def: (initialize sources target) - (-> (List File) File (Process Compiler)) + (-> (List File) File (Process Lux)) (do io.Monad [compiler (case (runtimeT.translate ## (initL.compiler (io.run js.init)) (initL.compiler (io.run hostL.init-host)) diff --git a/new-luxc/source/luxc/lang/translation/js/imports.jvm.lux b/new-luxc/source/luxc/lang/translation/js/imports.jvm.lux index 64f10dabc..cbd4b2752 100644 --- a/new-luxc/source/luxc/lang/translation/js/imports.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/js/imports.jvm.lux @@ -30,9 +30,9 @@ (def: import (s.Syntax Import) (s.tuple (p.seq s.text s.text))) (def: #export (translate-imports translate-module annotations) - (-> (-> Text Compiler (Process Compiler)) + (-> (-> Text Lux (Process Lux)) Code - (Meta (Process Compiler))) + (Meta (Process Lux))) (do macro.Monad [_ (moduleL.set-annotations annotations) current-module macro.current-module-name diff --git a/new-luxc/source/luxc/lang/translation/jvm/common.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/common.jvm.lux index 524433214..29db94d07 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/common.jvm.lux @@ -116,8 +116,7 @@ (def: #export $Object $.Type ($t.class "java.lang.Object" (list))) (def: #export (load-definition compiler) - (-> Compiler - (-> Ident Blob (Error Top))) + (-> Lux (-> Ident Blob (Error Top))) (function (_ (^@ def-ident [def-module def-name]) def-bytecode) (let [normal-name (format (lang.normalize-name def-name) (%n (text/hash def-name))) class-name (format (text.replace-all "/" "." def-module) "." normal-name)] diff --git a/new-luxc/source/luxc/lang/translation/jvm/imports.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/imports.jvm.lux index 44314fcf2..de75a4d75 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/imports.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/imports.jvm.lux @@ -45,7 +45,7 @@ (def: import (s.Syntax Import) (s.tuple (p.seq s.text s.text))) (def: compilations - (Var (Dict Text (CompletableFuture (Error Compiler)))) + (Var (Dict Text (CompletableFuture (Error Lux)))) (stm.var (dict.new text.Hash))) (def: (promise-to-future promise) @@ -61,12 +61,12 @@ (:: io.Monad map (|>> #e.Success))) (def: (translate-dependency translate-module dependency compiler) - (-> (-> Text Compiler (Process Compiler)) - (-> Text Compiler (IO (Future (Error Compiler))))) + (-> (-> Text Lux (Process Lux)) + (-> Text Lux (IO (Future (Error Lux))))) (<| (Future::get []) promise-to-future (do promise.Monad - [[new? future] (stm.commit (: (STM [Bool (CompletableFuture (Error Compiler))]) + [[new? future] (stm.commit (: (STM [Bool (CompletableFuture (Error Lux))]) (do stm.Monad [current-compilations (stm.read compilations)] (case (dict.get dependency current-compilations) @@ -75,7 +75,7 @@ #.None (do @ - [#let [pending (: (CompletableFuture (Error Compiler)) + [#let [pending (: (CompletableFuture (Error Lux)) (CompletableFuture::new []))] _ (stm.write (dict.put dependency pending current-compilations) compilations)] @@ -104,15 +104,15 @@ from-current))) (def: (merge-compilers current-module dependency total) - (-> Text Compiler Compiler Compiler) + (-> Text Lux Lux Lux) (|> total (update@ #.modules (merge-modules current-module (get@ #.modules dependency))) (set@ #.seed (get@ #.seed dependency)))) (def: #export (translate-imports translate-module annotations) - (-> (-> Text Compiler (Process Compiler)) + (-> (-> Text Lux (Process Lux)) Code - (Meta (Process Compiler))) + (Meta (Process Lux))) (do macro.Monad [_ (moduleL.set-annotations annotations) current-module macro.current-module-name @@ -124,7 +124,7 @@ (#e.Error error) (&.throw Invalid-Imports (%code (code.tuple imports))))) - dependencies (monad.map @ (: (-> [Text Text] (Meta (IO (Future (Error Compiler))))) + dependencies (monad.map @ (: (-> [Text Text] (Meta (IO (Future (Error Lux))))) (function (_ [dependency alias]) (do @ [_ (&.assert Module-Cannot-Import-Itself current-module diff --git a/new-luxc/source/luxc/repl.lux b/new-luxc/source/luxc/repl.lux index cdc61ab22..fbf1a336e 100644 --- a/new-luxc/source/luxc/repl.lux +++ b/new-luxc/source/luxc/repl.lux @@ -55,7 +55,7 @@ (def: no-aliases Aliases (dict.new text.Hash)) (def: (initialize source-dirs target-dir console) - (-> (List File) File Console (Task Compiler)) + (-> (List File) File Console (Task Lux)) (do promise.Monad [output (promise.future (do io.Monad @@ -200,7 +200,7 @@ (recur tail variantV))))))))) (def: (tagged-representation compiler representation) - (-> Compiler (Poly Representation) (Poly Representation)) + (-> Lux (Poly Representation) (Poly Representation)) (do p.Monad [[name anonymous] poly.named] (case (macro.run compiler (macro.tags-of name)) @@ -237,7 +237,7 @@ (format "[" tuple-body "]")))))) (def: (representation compiler) - (-> Compiler (Poly Representation)) + (-> Lux (Poly Representation)) (p.rec (function (_ representation) ($_ p.either @@ -263,7 +263,7 @@ )))) (def: (represent compiler type value) - (-> Compiler Type Top Text) + (-> Lux Type Top Text) (case (poly.run type (representation compiler)) (#e.Success representation) (representation value) diff --git a/new-luxc/test/test/luxc/common.lux b/new-luxc/test/test/luxc/common.lux index b5754b088..01e3d1aaa 100644 --- a/new-luxc/test/test/luxc/common.lux +++ b/new-luxc/test/test/luxc/common.lux @@ -61,7 +61,7 @@ (do-template [ ] [(def: #export - (IO Compiler) + (IO Lux) (do io.Monad [host ] (wrap (initL.compiler host))))] @@ -78,7 +78,7 @@ ) (def: (runner translate-runtime translate-expression eval init) - (All [a] (-> (Meta Top) (-> Synthesis (Meta a)) (-> a (Meta Top)) (IO Compiler) + (All [a] (-> (Meta Top) (-> Synthesis (Meta a)) (-> a (Meta Top)) (IO Lux) Runner)) (function (_ synthesis) (|> (do macro.Monad @@ -89,7 +89,7 @@ (macro.run (io.run init))))) (def: (definer translate-runtime translate-expression eval init translate-def) - (All [a] (-> (Meta Top) (-> Synthesis (Meta a)) (-> a (Meta Top)) (IO Compiler) + (All [a] (-> (Meta Top) (-> Synthesis (Meta a)) (-> a (Meta Top)) (IO Lux) (-> Text Type a Code (Meta Top)) Definer)) (function (_ [module-name def-name] synthesis) -- cgit v1.2.3