We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35cdbcc commit 1f5c7e7Copy full SHA for 1f5c7e7
src/wisp.wisp
@@ -34,12 +34,13 @@
34
[source options]
35
(let [channel (or (:print options) :code)
36
output (compile source options)
37
- content (cond
38
- (= channel :code) (:code output)
39
- (= channel :forms) (map (fn [item]
40
- (str (pr-str (:form item)) "\n"))
41
- (:ast output))
42
- :else (pr-str (get output channel) 2 2))]
+ content (if (= channel :code)
+ (:code output)
+ (JSON.stringify (get output channel) 2 2))]
+ (if (:ast options) (map (fn [item]
+ (.write process.stdout
+ (str (pr-str item.form) "\n")))
43
+ output.ast))
44
(if (and (:output options) (:source-uri options) content)
45
(writeFileSync (path.join (:output options) ;; `join` relies on `path`
46
(str (basename (:source-uri options) ".wisp") ".js"))
0 commit comments