mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 20:00:19 +02:00
* module/ice-9/compile-psyntax.scm: Pretty-print psyntax-pp.scm, given that we are going to compile it anyway. * module/ice-9/psyntax-pp.scm: Regenerated.
20 lines
761 B
Scheme
20 lines
761 B
Scheme
(use-modules (language tree-il) (ice-9 pretty-print))
|
|
(let ((source (list-ref (command-line) 1))
|
|
(target (list-ref (command-line) 2)))
|
|
(let ((in (open-input-file source))
|
|
(out (open-output-file (string-append target ".tmp"))))
|
|
(write '(eval-when (compile) (set-current-module (resolve-module '(guile))))
|
|
out)
|
|
(newline out)
|
|
(let loop ((x (read in)))
|
|
(if (eof-object? x)
|
|
(begin
|
|
(close-port out)
|
|
(close-port in))
|
|
(begin
|
|
(pretty-print (tree-il->scheme
|
|
(sc-expand x 'c '(compile load eval)))
|
|
out)
|
|
(newline out)
|
|
(loop (read in))))))
|
|
(system (format #f "mv -f ~s.tmp ~s" target target)))
|