This commit is contained in:
Koz Ross 2017-02-05 15:29:17 +13:00
commit 24ba77f81c
2 changed files with 6 additions and 12 deletions

View file

@ -102,7 +102,7 @@ debug :
# Helper rules (of interest to people hacking on this makefile) # Helper rules (of interest to people hacking on this makefile)
.PHONY: clean bootstrap tags indent debug .PHONY: clean bootstrap tags indent debug test
$(TESTS) : %: %.scm $(TESTS) : %: %.scm
$(CYCLONE) -I . $< $(CYCLONE) -I . $<

View file

@ -287,16 +287,7 @@
;; Read top-level imports from a program and return a cons of: ;; Read top-level imports from a program and return a cons of:
;; - imports ;; - imports
;; - remaining program ;; - remaining program
(define (import-reduction expr) (define (import-reduction expr expander)
; ;; TODO: consolidate this with other macro loading code
; (define rename-env (env:extend-environment '() '() '()))
; (let ((macros (filter
; (lambda (v)
; (Cyc-macro? (Cyc-get-cvar (cdr v))))
; (Cyc-global-vars))))
; (macro:load-env! macros (create-environment '() '())))
; ;;
(define expander (base-expander))
(let ((results (let ((results
(foldl (foldl
(lambda (ex accum) (lambda (ex accum)
@ -350,8 +341,11 @@
(define (run-compiler args cc? append-dirs prepend-dirs) (define (run-compiler args cc? append-dirs prepend-dirs)
(let* ((in-file (car args)) (let* ((in-file (car args))
(in-prog (read-file in-file)) (in-prog (read-file in-file))
;; TODO: expand in-prog, if a library, using lib:cond-expand.
;; TODO: will also need to do below in lib:get-all-import-deps, after reading each library
(expander (base-expander))
(program? (not (library? (car in-prog)))) (program? (not (library? (car in-prog))))
(program:imports/code (if program? (import-reduction in-prog) '())) (program:imports/code (if program? (import-reduction in-prog expander) '()))
(lib-deps (lib-deps
(if (and program? (if (and program?
(not (null? (car program:imports/code)))) (not (null? (car program:imports/code))))