+Trace function, +Constants
[lineal.git] / src / webui / compile-ps.lisp
blob387a2ee06be634c3d8b2aa09702fe7bfe3cc6b74
2 ;V Compile given ParenScript file.V
3 (defun compile-ps (ps-path js-path)
4 (when (and (probe-file js-path)
5 (< (file-write-date ps-path)
6 (file-write-date js-path)))
7 (return-from compile-ps))
8 (format t "Generating: ~A~%" (namestring js-path))
9 (with-open-file (ps-strm ps-path)
10 (with-open-file (js-strm js-path :direction :output
11 :if-exists :supersede)
12 (loop :for lis = (read ps-strm nil nil)
13 :while lis
14 :do (princ (eval (list 'ps lis)) js-strm)
15 :do (terpri js-strm)))))
17 (defun recompile-ps ()
18 (ensure-directories-exist
19 (make-pathname
20 :directory '(:relative "http_root" "jsfiles")))
21 (mapc
22 (lambda (name)
23 (compile-ps
24 (make-pathname
25 :directory '(:relative "src" "webui" "psfiles")
26 :name name :type "lisp")
27 (make-pathname
28 :directory '(:relative "http_root" "jsfiles")
29 :name name :type "js")))
30 '("calcupage"
31 "connects"
32 "matrix-edit")))