Coverage report: /home/ellis/comp/core/lib/organ/document.lisp
Kind | Covered | All | % |
expression | 0 | 40 | 0.0 |
branch | 0 | 4 | 0.0 |
Key
Not instrumented
Conditionalized out
Executed
Not executed
Both branches taken
One branch taken
Neither branch taken
1
;;; lib/organ/document.lisp --- Org Document API
3
;; Top-level file object
7
;; ORG-DOCUMENT is the top-level Lisp representation of a complete Org-mode
13
(defclass org-document ()
14
((meta :initform nil :initarg :meta :type (or null org-zeroth-section) :accessor doc-meta)
15
(tree :initform nil :initarg :tree :type (or (vector org-heading) null) :accessor doc-tree)))
17
(defaccessor ast ((self org-document)) (doc-tree self))
19
(defmethod org-create ((type (eql :document)) &rest initargs)
20
(apply #'make-instance (sym-to-org-class-name type) initargs))
22
(defmethod org-parse ((type (eql :document)) (input pathname))
23
(if (probe-file input)
24
(let ((res (org-create type)))
25
(with-open-file (fstream input)
26
(setf (doc-meta res) (org-parse :meta fstream)
29
(loop for c = (peek-char nil fstream nil nil)
30
while (and c (char= c #\*))
31
collect (org-parse :heading fstream))
32
'(vector org-heading)))
34
(org-file-missing input)))