~bouncepaw/agidel-syntrans

1a055e58f8237690331300baa20cdcc4b12d1ba2 — Timur Ismagilov 5 years ago 1ef73b2
Add `main` to `run` syntrans
1 files changed, 14 insertions(+), 3 deletions(-)

M run.scm
M run.scm => run.scm +14 -3
@@ 10,6 10,17 @@
         (srfi 69)
         (clojurian syntax)
         format)
 
 (define (main source-tree plugin-list)
   source-tree))

 ;; `source-tree` is a LIST, not a STRING!
 ;; This functions outputs a string though.
 (define (main source-tree plugins)
   ;; Import all plugins, prefixing Agidel macros from them with '/agidel/.
   (->> plugins
        (map (lambda (p)
               `(prefix ,(symbol-append 'agidel-plugin. p) /agidel/)))
        (cons 'import)
        eval)
   ;; Eval it, convert to string.
   (-> source-tree
       eval
       (string-join "\n" 'infix)))