class.lisp
28 lines
| 1.2 KiB
| text/x-common-lisp
|
CommonLispLexer
/ src / class.lisp
r11 | ||||
(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))) | ||||
r23 | (defun read-code-from-string (string) | |||
(with-input-from-string (in string) | ||||
`(progn | ||||
,@(loop :for form := (read in nil :eof) | ||||
:until (eq form :eof) | ||||
:collect form)))) | ||||
(defun load-src (filename) | ||||
(alexandria:read-file-into-string (src-file filename)))) | ||||
r11 | ||||
(defclass compiler () | ||||
r23 | ((body :accessor body :initform #.(load-src "extras/body.html")) | |||
(css :accessor css :initform (list #.(load-src "extras/default.css"))) | ||||
(js :accessor js :initform '#.(mapcar #'read-code-from-string | ||||
(mapcar #'load-src | ||||
(list "src/intrinsics.ps" | ||||
"src/api.ps" | ||||
"src/main.ps")))) | ||||
r11 | (compile :accessor compile-only :initarg :compile) | |||
(target :accessor target :initarg :target) | ||||
(beautify :accessor beautify :initarg :beautify))) | ||||