##// END OF EJS Templates
Remove curact, implement selact
Remove curact, implement selact

File last commit:

r25:4adc2646 default
r45:0669fc21 default
Show More
class.lisp
32 lines | 1.3 KiB | text/x-common-lisp | CommonLispLexer
(in-package sugar-qsp)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defun src-file (filename)
(uiop/pathname:merge-pathnames*
filename
(asdf:system-source-directory :sugar-qsp)))
(defun read-code-from-string (string)
(with-input-from-string (in string)
(let ((*package* *package*))
`(progn
,@(loop :for form := (read in nil :eof)
:until (eq form :eof)
:when (eq (first form) 'cl:in-package)
:do (setf *package* (find-package (second form)))
:else
:collect form)))))
(defun load-src (filename)
(alexandria:read-file-into-string (src-file filename))))
(defclass compiler ()
((body :accessor body :initform #.(load-src "extras/body.html"))
(css :accessor css :initform (list #.(load-src "extras/default.css")))
(js :accessor js :initform (reverse
(list
'#.(read-code-from-string (load-src "src/main.ps"))
'#.(read-code-from-string (load-src "src/api.ps"))
'#.(read-code-from-string (load-src "src/intrinsics.ps")))))
(compile :accessor compile-only :initarg :compile)
(target :accessor target :initarg :target)
(beautify :accessor beautify :initarg :beautify)))