mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-12 23:37:38 +02:00
Added debug code for compiled macros
This commit is contained in:
parent
71e07d864b
commit
bda12755c1
1 changed files with 26 additions and 0 deletions
26
cyclone.scm
26
cyclone.scm
|
@ -100,6 +100,32 @@
|
||||||
;; in final compiled program
|
;; in final compiled program
|
||||||
;(set! input-program (add-libs input-program))
|
;(set! input-program (add-libs input-program))
|
||||||
|
|
||||||
|
;; JAE DEBUG code, remove (or refactor) once working
|
||||||
|
(trace:info "JAE DEBUG - compiled macros")
|
||||||
|
(trace:info
|
||||||
|
(filter
|
||||||
|
(lambda (v)
|
||||||
|
(cond
|
||||||
|
((equal? (car v) 'my-or)
|
||||||
|
(trace:info (list 'my-or (car v) (cdr v) (macro? (Cyc-get-cvar (cdr v)))))
|
||||||
|
#t)
|
||||||
|
(else #f)))
|
||||||
|
;(macro? (cdr v)))
|
||||||
|
(Cyc-global-vars)))
|
||||||
|
; TODO: should be able to use this to find all the compiled macros
|
||||||
|
(let ((macros (filter
|
||||||
|
(lambda (v)
|
||||||
|
(macro? (Cyc-get-cvar (cdr v))))
|
||||||
|
(Cyc-global-vars))))
|
||||||
|
(trace:info (map
|
||||||
|
(lambda (v)
|
||||||
|
; TODO: can prepend these macros to *defined-macros*, but
|
||||||
|
; also need to use Cyc-get-cvar to deref before using macro
|
||||||
|
; during expansion
|
||||||
|
(cons (car v) (cdr v)))
|
||||||
|
macros)))
|
||||||
|
;; END JAE DEBUG
|
||||||
|
|
||||||
(set! input-program (expand input-program))
|
(set! input-program (expand input-program))
|
||||||
(trace:info "---------------- after macro expansion:")
|
(trace:info "---------------- after macro expansion:")
|
||||||
(trace:info input-program) ;pretty-print
|
(trace:info input-program) ;pretty-print
|
||||||
|
|
Loading…
Add table
Reference in a new issue