diff options
author | Eduardo Julian | 2016-10-25 19:45:47 -0400 |
---|---|---|
committer | Eduardo Julian | 2016-10-25 19:45:47 -0400 |
commit | 531f6cb72aa17eea2f8add050f21ed88e2bb1b32 (patch) | |
tree | 563454c10450ca73eec0cb26a8e502f0aa6859b3 /src/lux.clj | |
parent | 378d152a0d57449286f5758bdd00088529c36b4f (diff) |
- Improved the way resources and source code are handled.
Diffstat (limited to 'src/lux.clj')
-rw-r--r-- | src/lux.clj | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/lux.clj b/src/lux.clj index 73e8e9126..a8efa19f7 100644 --- a/src/lux.clj +++ b/src/lux.clj @@ -9,19 +9,30 @@ [lux.compiler.base :as &compiler-base] [lux.compiler :as &compiler] [lux.repl :as &repl] + [clojure.string :as string] :reload-all) (:import (java.io File))) +(def unit-separator (str (char 31))) + +(defn ^:private process-dirs + "(-> Text (List Text))" + [resources-dirs] + (-> resources-dirs + (string/replace unit-separator "\n") + string/split-lines + &/->list)) + (defn -main [& args] (|case (&/->list args) - (&/$Cons "release" (&/$Cons program-module source-dirs)) - (time (&compiler/compile-program &/$Release program-module source-dirs)) + (&/$Cons "release" (&/$Cons program-module (&/$Cons resources-dirs (&/$Cons source-dirs (&/$Nil))))) + (time (&compiler/compile-program &/$Release program-module (process-dirs resources-dirs) (process-dirs source-dirs))) - (&/$Cons "debug" (&/$Cons program-module source-dirs)) - (time (&compiler/compile-program &/$Debug program-module source-dirs)) + (&/$Cons "debug" (&/$Cons program-module (&/$Cons resources-dirs (&/$Cons source-dirs (&/$Nil))))) + (time (&compiler/compile-program &/$Debug program-module (process-dirs resources-dirs) (process-dirs source-dirs))) - (&/$Cons "repl" source-dirs) - (&repl/repl source-dirs) + (&/$Cons "repl" (&/$Cons source-dirs (&/$Nil))) + (&repl/repl (process-dirs source-dirs)) _ (println "Can't understand command."))) |