diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/me/arrdem/decomp/core.clj | 13 |
1 files changed, 7 insertions, 6 deletions
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 "")))) |