File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 20
20
[options]
21
21
(with-stream-content process.stdin
22
22
compile-string
23
- options))
23
+ (conj {} options)))
24
+ ; ; (conj {:source-uri options}) causes segfault for some reason
24
25
25
26
(defn compile-file
26
27
[path options]
33
34
[source options]
34
35
(let [channel (or (:print options) :code )
35
36
output (compile source options)
36
- content (if (= channel :code )
37
- (:code output)
38
- (JSON.stringify (get output channel) 2 2 ))]
39
- (if (:ast options) (map (fn [item]
40
- (.write process.stdout
41
- (str (pr-str item.form) " \n " )))
42
- output.ast))
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 ))]
43
43
(if (and (:output options) (:source-uri options) content)
44
44
(writeFileSync (path.join (:output options) ; ; `join` relies on `path`
45
45
(str (basename (:source-uri options) " .wisp" ) " .js" ))
You can’t perform that action at this time.
0 commit comments