mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-16 09:17:35 +02:00
Added (lib:get-all)
This commit is contained in:
parent
b5ddcf0dee
commit
1c0bd864c6
1 changed files with 9 additions and 0 deletions
|
@ -38,6 +38,7 @@
|
||||||
lib:import->export-list
|
lib:import->export-list
|
||||||
lib:resolve-imports
|
lib:resolve-imports
|
||||||
lib:resolve-meta
|
lib:resolve-meta
|
||||||
|
lib:get-all
|
||||||
lib:get-all-import-deps
|
lib:get-all-import-deps
|
||||||
lib:get-dep-list
|
lib:get-dep-list
|
||||||
lib:imports->idb
|
lib:imports->idb
|
||||||
|
@ -82,6 +83,14 @@
|
||||||
;; TODO: most of these below assume 0 or 1 instances of the directive.
|
;; TODO: most of these below assume 0 or 1 instances of the directive.
|
||||||
;; may need to replace some of these later with filter operations to
|
;; may need to replace some of these later with filter operations to
|
||||||
;; support more than 1 instance.
|
;; support more than 1 instance.
|
||||||
|
|
||||||
|
;; Get all instances of given tagged list from a library definition,
|
||||||
|
;; and collect the contents of them into a single list.
|
||||||
|
(define (lib:get-all ast tag)
|
||||||
|
(foldr append '()
|
||||||
|
(map cdr
|
||||||
|
(filter (lambda (l) (tagged-list? 'import l)) (cddr ast)))))
|
||||||
|
|
||||||
(define (lib:raw-exports ast)
|
(define (lib:raw-exports ast)
|
||||||
(lib:result
|
(lib:result
|
||||||
(let ((code (assoc 'export (cddr ast))))
|
(let ((code (assoc 'export (cddr ast))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue