about summary refs log tree commit diff stats
path: root/lib/main.scm
blob: b97d66a8b644aa4c2937f802662fa4e7d2936dec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
(declare (module (jimmy main)))

(import scheme (chicken base)
        (chicken port)
        (jimmy util)
        (jimmy read)
        (jimmy emit)
        (jimmy wrap))

(define-public (jimmy #!optional file template)
  (parameterize ((current-input-port
                  (if file
                      (open-input-file file)
                      (current-input-port))))
    (let ((doc (parse))
          (post-proc (if template
                         (cut wrap-with <> template)
                         emit-string)))
      (post-proc doc))))