Coverage report: /home/ellis/comp/core/lib/obj/tree/node.lisp

KindCoveredAll%
expression310 30.0
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; lib/obj/tree/node.lisp --- Tree Nodes
2
 
3
 ;; SBCL provides excellent support for the ANSI CL built-in types such as
4
 ;; vector/array, list, hash-table. We don't need to provide much in terms of
5
 ;; additional support for these. There are some internal SBCL collections such
6
 ;; as RBTREE, AVLTREE and BROTHERTREE which we expose here and provide
7
 ;; additional support for.
8
 
9
 ;;; Code:
10
 (in-package :obj/tree)
11
 
12
 (deftype keytype () 'sb-vm:word)
13
 
14
 (defstruct (tree-node (:copier nil)
15
                  (:constructor make-tree-node (key)))
16
   (key 0 :type keytype))
17
 
18
 (defstruct (unary-node (:include tree-node))
19
   (child nil :type t))
20
 
21
 (defstruct (binary-node (:include tree-node)
22
                        (:copier nil)
23
                        (:constructor make-binary-node (key left right)))
24
   left right)
25
 
26
 ;; temporary nodes eliminated when a tree is compiled
27
 (defstruct (ternary-node (:include binary-node)
28
                          (:copier nil)
29
                          (:constructor make-ternary-node (left key1 middle key2 right)))
30
   key1 middle key2)
31
 
32
 (defstruct (avl-node (:include tree-node)
33
                      (:copier nil)
34
                      (:constructor make-avl-node (key data left right)))
35
   data left right)
36