From: Luke Lau Date: Wed, 17 Jul 2019 23:35:35 +0000 (+0100) Subject: Split out compiler into codegen and main X-Git-Url: https://git.lukelau.me/?p=scheme.git;a=commitdiff_plain;h=05e0f42eb4a44694b96297ce50b5a27eb6bb9f71 Split out compiler into codegen and main --- diff --git a/compiler.scm b/codegen.scm similarity index 100% rename from compiler.scm rename to codegen.scm diff --git a/main.scm b/main.scm new file mode 100644 index 0000000..29c03e5 --- /dev/null +++ b/main.scm @@ -0,0 +1,6 @@ +(load "codegen.scm") + +(compile-to-binary + (if (>= (length (command-line)) 1) + (call-with-input-file (cadr (command-line)) read) + (read))) diff --git a/sample.scm b/sample.scm new file mode 100644 index 0000000..75e6043 --- /dev/null +++ b/sample.scm @@ -0,0 +1 @@ +(let ((a 3) (b 4)) (+ a b))