mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Handle any import set in lib:import->library-name
This commit is contained in:
parent
940c045176
commit
0b4bb36ec0
1 changed files with 14 additions and 8 deletions
|
@ -68,6 +68,20 @@
|
|||
(define (lib:name ast)
|
||||
(lib:list->import-set (cadr ast)))
|
||||
|
||||
;; Convert an import-set to its corresponding library name.
|
||||
;; These are not always the same thing, but each import-set
|
||||
;; does reference a specific library.
|
||||
(define (lib:import->library-name import)
|
||||
(cond
|
||||
((or (tagged-list? 'only import)
|
||||
(tagged-list? 'except import)
|
||||
(tagged-list? 'prefix import)
|
||||
(tagged-list? 'rename import))
|
||||
(cadr import))
|
||||
(else
|
||||
import)))
|
||||
|
||||
|
||||
;; Convert name (as list of symbols) to a mangled string
|
||||
(define (lib:name->string name)
|
||||
(apply string-append (map mangle (lib:import->library-name name))))
|
||||
|
@ -205,14 +219,6 @@
|
|||
(close-input-port fp)
|
||||
imports))
|
||||
|
||||
(define (lib:import->library-name import)
|
||||
(cond
|
||||
((or (tagged-list? 'only import)
|
||||
(tagged-list? 'except import))
|
||||
(cadr import))
|
||||
(else
|
||||
import)))
|
||||
|
||||
;; Read export list for a given import
|
||||
(define (lib:import->export-list import)
|
||||
(let* ((lib-name (lib:import->library-name import))
|
||||
|
|
Loading…
Add table
Reference in a new issue