mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 04:25:06 +02:00
Use lib:get-all to read library contents
This allows multiple import, export, and begin directives within a define-library.
This commit is contained in:
parent
4d112824f3
commit
87910d4ffe
1 changed files with 6 additions and 14 deletions
|
@ -90,11 +90,12 @@
|
||||||
(foldr append '()
|
(foldr append '()
|
||||||
(map cdr
|
(map cdr
|
||||||
(filter (lambda (l) (tagged-list? tag l)) (cddr ast)))))
|
(filter (lambda (l) (tagged-list? tag l)) (cddr ast)))))
|
||||||
|
(define (lib:body ast)
|
||||||
|
(lib:get-all ast 'begin))
|
||||||
|
(define (lib:imports ast)
|
||||||
|
(map lib:list->import-set (lib:get-all ast 'import)))
|
||||||
(define (lib:raw-exports ast)
|
(define (lib:raw-exports ast)
|
||||||
(lib:result
|
(lib:get-all ast 'export))
|
||||||
(let ((code (assoc 'export (cddr ast))))
|
|
||||||
(if code (cdr code) #f))))
|
|
||||||
(define (lib:rename-exports ast)
|
(define (lib:rename-exports ast)
|
||||||
(filter
|
(filter
|
||||||
(lambda (ex)
|
(lambda (ex)
|
||||||
|
@ -108,15 +109,6 @@
|
||||||
(caddr ex)
|
(caddr ex)
|
||||||
ex))
|
ex))
|
||||||
(lib:raw-exports ast)))
|
(lib:raw-exports ast)))
|
||||||
(define (lib:imports ast)
|
|
||||||
(lib:result
|
|
||||||
(let ((code (assoc 'import (cddr ast))))
|
|
||||||
(if code (map lib:list->import-set (cdr code))
|
|
||||||
#f))))
|
|
||||||
(define (lib:body ast)
|
|
||||||
(lib:result
|
|
||||||
(let ((code (assoc 'begin (cddr ast))))
|
|
||||||
(if code (cdr code) #f))))
|
|
||||||
(define (lib:includes ast)
|
(define (lib:includes ast)
|
||||||
(map
|
(map
|
||||||
(lambda (inc-lst)
|
(lambda (inc-lst)
|
||||||
|
|
Loading…
Add table
Reference in a new issue