mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-11 14:57:36 +02:00
Refactoring and TODO
This commit is contained in:
parent
420098fb1e
commit
c8c8ad6e3f
1 changed files with 5 additions and 11 deletions
16
cyclone.scm
16
cyclone.scm
|
@ -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))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue