diff options
author | LuxLang | 2015-10-01 12:50:27 -0400 |
---|---|---|
committer | LuxLang | 2015-10-01 12:50:27 -0400 |
commit | 3e2ce4d30fd457205b0d0268d870d47a8d1ec738 (patch) | |
tree | 580b42a5024c8767b2f2dd78a77a9911593acb77 /src/lux.clj | |
parent | e543739f21e03be7cc0192bf510f350f7065bfa5 (diff) | |
parent | 6fcf9690f914e9b8b4f0ab767164bc97aeb12ca4 (diff) |
Merge pull request #12 from LuxLang/v0.3
V0.3
Diffstat (limited to 'src/lux.clj')
-rw-r--r-- | src/lux.clj | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/src/lux.clj b/src/lux.clj index 7e3627cd7..4b1c15ef7 100644 --- a/src/lux.clj +++ b/src/lux.clj @@ -1,24 +1,33 @@ -;; Copyright (c) Eduardo Julian. All rights reserved. -;; The use and distribution terms for this software are covered by the -;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) -;; which can be found in the file epl-v10.html at the root of this distribution. -;; By using this software in any fashion, you are agreeing to be bound by -;; the terms of this license. -;; You must not remove this notice, or any other, from this software. +;; Copyright (c) Eduardo Julian. All rights reserved. +;; This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +;; If a copy of the MPL was not distributed with this file, +;; You can obtain one at http://mozilla.org/MPL/2.0/. (ns lux (:gen-class) - (:require [lux.base :as &] + (:require [lux.base :as & :refer [|let |do return fail return* fail* |case]] + [lux.compiler.base :as &compiler-base] [lux.compiler :as &compiler] - :reload-all)) + [lux.packager.lib :as &lib] + :reload-all) + (:import (java.io File))) -(defn -main [& [program-module & _]] - (if program-module - (time (&compiler/compile-program program-module)) - (println "Please provide a module name to compile.")) +(defn -main [& args] + (|case (&/->list args) + (&/$Cons "compile" (&/$Cons program-module (&/$Nil))) + (if program-module + (time (&compiler/compile-program program-module)) + (println "Please provide a module name to compile.")) + + (&/$Cons "lib" (&/$Cons lib-module (&/$Nil))) + (&lib/package lib-module (new File &compiler-base/input-dir)) + + _ + (println "Can't understand command.")) (System/exit 0) ) (comment - (-main "program") + (-main "compile" "program") + (-main "lib" "lux") ) |