Add unallocated node type
This commit is contained in:
parent
4a63f28a63
commit
ba13ba5dbd
3 changed files with 119 additions and 15 deletions
12
printer.rkt
12
printer.rkt
|
@ -114,13 +114,15 @@
|
|||
(: ppr-node (-> Node ISeq))
|
||||
(define (ppr-node a)
|
||||
(cond
|
||||
[(integer? a)
|
||||
[(integer-node? a)
|
||||
(iseq-append "NNum " (number->string a))]
|
||||
[(not (eq? (car a) 'define))
|
||||
(let ([fun (first a)]
|
||||
[arg (second a)])
|
||||
[(ap-node? a)
|
||||
(let ([fun (ap-fun a)]
|
||||
[arg (ap-arg a)])
|
||||
(iseq-append "NAp " (ppr-addr fun) " " (ppr-addr arg)))]
|
||||
[else (iseq-append "NSupercomb " (symbol->string (caadr a)))]))
|
||||
[(sc-node? a) (iseq-append "NSupercomb " (symbol->string (caadr a)))]
|
||||
[(indirect-node? a) (iseq-append "Indirect " (ppr-addr (indirect-addr a)))]
|
||||
[else (error "Impossible: Undefined node encountered")]))
|
||||
|
||||
(: ppr-stack-node (-> Heap Node ISeq))
|
||||
(define (ppr-stack-node heap node)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue