forked from coalton-lang/coalton
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoalton-asdf.lisp
More file actions
40 lines (31 loc) · 1.35 KB
/
Copy pathcoalton-asdf.lisp
File metadata and controls
40 lines (31 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
;;; Coalton ASDF extensions
;;;
;;; This class is defined in the ASDF package, so that the keyword :coalton-file works.
;;;
;;; see: https://github.com/fare/asdf/blob/master/doc/best_practices.md#using-asdf-extensions
(in-package :asdf)
;; .ct is a special extension for Coalton files that are written as
;; .lisp files.
(defclass ct-file (cl-source-file)
((type :initform "ct")))
(defmethod perform :around ((o compile-op) (c ct-file))
(let ((*readtable* (named-readtables:ensure-readtable 'coalton:coalton)))
(call-next-method)))
(defmethod perform :around ((o load-source-op) (c ct-file))
(let ((*readtable* (named-readtables:ensure-readtable 'coalton:coalton)))
(call-next-method)))
;; .coal is a special extension for Coalton files written in native
;; Coalton syntax.
;;
;; XXX: Should we just make this "coalton" instead of "coalton-file"?
(defclass coalton-file (cl-source-file)
((type :initform "coal")))
(defmethod perform ((o compile-op) (c coalton-file))
(let ((coal-file (first (input-files o c)))
(fasl-file (first (output-files o c))))
(call-with-around-compile-hook
c (lambda (&rest flags)
(declare (ignore flags))
(coalton-impl/entry:compile (coalton-impl/source:make-source-file coal-file)
:load nil
:output-file fasl-file)))))