forked from emacs-elsa/Elsa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelsa-check.el
30 lines (21 loc) · 860 Bytes
/
elsa-check.el
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
(require 'eieio)
(eval-and-compile (setq eieio-backward-compatibility nil))
(require 'dash)
(require 'elsa-reader)
(require 'elsa-scope)
(defclass elsa-check () () :abstract t
:documentation
"A check is essentially a callback run at every node of the AST.
A check has to implement two methods:
- `elsa-check-should-run' to decide if the check should process
the current node.
- `elsa-check-check' which performs the actual computation.")
;; (elsa-checks :: (list (class elsa-check)))
(defvar elsa-checks nil)
(cl-defgeneric elsa-check-should-run ((this elsa-check) (form elsa-form) (scope elsa-scope) (state elsa-state))
"Decide if the check should run on FORM."
nil)
(cl-defgeneric elsa-check-check ((this elsa-check) (form elsa-form) (scope elsa-scope) (state elsa-state))
"Run THIS check on FORM in SCOPE."
nil)
(provide 'elsa-check)