mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 00:07:36 +02:00
WIP
This commit is contained in:
parent
f51a680eef
commit
d2019bb284
3 changed files with 13 additions and 4 deletions
|
@ -147,6 +147,10 @@
|
|||
(error `(Unhandled expansion ,expanded))))))))
|
||||
(trace:info "---------------- after macro expansion:")
|
||||
(trace:info input-program) ;pretty-print
|
||||
; TODO:
|
||||
;(set! input-program (macro:cleanup input-program))
|
||||
;(trace:info "---------------- after macro expansion cleanup:")
|
||||
;(trace:info input-program) ;pretty-print
|
||||
|
||||
;; Separate global definitions from the rest of the top-level code
|
||||
(set! input-program
|
||||
|
|
|
@ -101,6 +101,11 @@
|
|||
|
||||
(define (macro:cleanup expr)
|
||||
(define (clean expr bv) ;; Bound variables
|
||||
(newline)
|
||||
(display "/* macro:cleanup->clean\n ")
|
||||
(write expr)
|
||||
(newline)
|
||||
(display "*/ ")
|
||||
(cond
|
||||
((const? expr) expr)
|
||||
;((prim? expr) expr)
|
||||
|
@ -141,8 +146,8 @@
|
|||
(map (lambda (e) (clean e bv))
|
||||
expr))
|
||||
(else
|
||||
(error "macro cleanup unexpected expression: " expr)))
|
||||
(clean expr '())))
|
||||
(error "macro cleanup unexpected expression: " expr))))
|
||||
(clean expr '()))
|
||||
|
||||
; TODO: get macro name, transformer
|
||||
; TODO: let-syntax forms
|
||||
|
|
|
@ -605,8 +605,8 @@
|
|||
(let ((renamed (gensym identifier)))
|
||||
(env:define-variable! renamed identifier use-env)
|
||||
;(env:define-variable! renamed val mac-env)
|
||||
(Cyc-write `(ER rename ,identifier to ,renamed) (current-output-port))
|
||||
(Cyc-display "\n" (current-output-port))
|
||||
;(Cyc-write `(ER rename ,identifier to ,renamed) (current-output-port))
|
||||
;(Cyc-display "\n" (current-output-port))
|
||||
renamed)
|
||||
;identifier ;; TESTING!
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue