aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--project.clj3
-rw-r--r--src/me/arrdem/decomp/core.clj13
2 files changed, 8 insertions, 8 deletions
diff --git a/project.clj b/project.clj
index fd8f2ac..a4a61ea 100644
--- a/project.clj
+++ b/project.clj
@@ -1,10 +1,9 @@
-(defproject me.arrdem.decomp "0.1.0"
+(defproject me.arrdem.decomp "0.1.1"
:description "an HTML to Compojure translator"
:url "http://github.com/arrdem/decomp"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.4.0"]
- [org.clojure/tools.cli "0.2.2"]
[factual/fnparse "2.3.0"]
[lexington "0.1.1"]]
:main me.arrdem.decomp.core)
diff --git a/src/me/arrdem/decomp/core.clj b/src/me/arrdem/decomp/core.clj
index 1e0f289..b2a3431 100644
--- a/src/me/arrdem/decomp/core.clj
+++ b/src/me/arrdem/decomp/core.clj
@@ -1,13 +1,12 @@
(ns me.arrdem.decomp.core
(:require [clojure.pprint :refer [pprint]]
[me.arrdem.decomp.parser :refer [build-ast]]
- [me.arrdem.decomp.lexer :refer [html]]
- [clojure.tools.cli :refer [cli]])
+ [me.arrdem.decomp.lexer :refer [html]])
(:gen-class :main true))
-(defn process-string [s]
- (pprint (build-ast (html s))))
+(def process-string
+ (comp html build-ast))
(defn -main
"The only valid arguments are targeted files. If there are no targeted files
@@ -15,6 +14,8 @@ then decomp will target stdin as its token source."
[& args]
(if-not (empty? args)
(doseq [f args]
- (pprint (build-ast (html (slurp f)))))
+ (pprint (process-string (slurp f)))
+ (println ""))
- (pprint (build-ast (html (slurp (java.io.BufferedReader. *in*)))))))
+ (do (pprint (process-string (slurp (java.io.BufferedReader. *in*))))
+ (println ""))))