Commit | Line | Data |
---|---|---|
811d10f5 | 1 | (use-modules (language tree-il)) |
9c35c579 AW |
2 | (let ((source (list-ref (command-line) 1)) |
3 | (target (list-ref (command-line) 2))) | |
4 | (let ((in (open-input-file source)) | |
5 | (out (open-output-file (string-append target ".tmp")))) | |
6 | (write '(eval-when (compile) (set-current-module (resolve-module '(guile)))) | |
7 | out) | |
8 | (newline out) | |
9 | (let loop ((x (read in))) | |
10 | (if (eof-object? x) | |
11 | (begin | |
12 | (close-port out) | |
13 | (close-port in)) | |
14 | (begin | |
811d10f5 | 15 | (write (tree-il->scheme |
71f46dbd | 16 | (sc-expand x 'c '(compile load eval))) |
9c35c579 AW |
17 | out) |
18 | (newline out) | |
19 | (loop (read in)))))) | |
20 | (system (format #f "mv -f ~s.tmp ~s" target target))) |