Skip to content

Commit

Permalink
Add newlines to evals and support eval-file
Browse files Browse the repository at this point in the history
  • Loading branch information
Olical committed Sep 14, 2024
1 parent 8ee786b commit a0621d1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
11 changes: 9 additions & 2 deletions fnl/conjure/client/fennel/nfnl.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,23 @@

(fn eval-str [opts]
(let [eval (repl.new)
results (eval opts.code)
results (eval (.. opts.code "\n"))
result-strs (core.map fennel.view results)
lines (text.split-lines (str.join "\n" result-strs))]
(log.append lines)))

(fn eval-file [opts]
(set opts.code (core.slurp opts.file-path))

(when opts.code
(eval-str opts)))

(comment
(+ 10 20))

{: comment-node?
: form-node?
: buf-suffix
: comment-prefix
: eval-str}
: eval-str
: eval-file}
12 changes: 10 additions & 2 deletions lua/conjure/client/fennel/nfnl.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a0621d1

Please sign in to comment.