From 423ac382f9e73bf1ca7fc6b400f98db087cd7d22 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 5 Jun 2024 09:21:25 -0500 Subject: Write executable This involved moving `src' to `lib' and making `bin'. `bin' holds the program, which only imports `jimmy.main' from lib. --- lib/main.scm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lib/main.scm (limited to 'lib/main.scm') diff --git a/lib/main.scm b/lib/main.scm new file mode 100644 index 0000000..b97d66a --- /dev/null +++ b/lib/main.scm @@ -0,0 +1,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)))) -- cgit 1.4.1-21-gabe81