2009-04-22 20:55:03 -04:00
|
|
|
; -*- scheme -*-
|
|
|
|
|
2009-08-02 00:06:07 -04:00
|
|
|
(if (not (bound? 'top-level-value)) (set! top-level-value %eval))
|
|
|
|
(if (not (bound? 'set-top-level-value!)) (set! set-top-level-value! set))
|
2009-08-12 00:56:32 -04:00
|
|
|
(if (not (bound? 'eof-object?)) (set! eof-object? (lambda (x) #f)))
|
2009-04-22 20:55:03 -04:00
|
|
|
|
2019-08-13 16:07:44 -04:00
|
|
|
(load "dump.scm")
|
2019-08-09 08:21:56 -04:00
|
|
|
;(load "compiler.scm")
|
2009-04-22 20:55:03 -04:00
|
|
|
|
2019-08-13 16:07:44 -04:00
|
|
|
(define (compile-file->buffer inf)
|
|
|
|
(let ((in (file inf :read))
|
|
|
|
(out (buffer)))
|
2009-04-22 20:55:03 -04:00
|
|
|
(let next ((E (read in)))
|
|
|
|
(if (not (io.eof? in))
|
2019-08-13 16:07:44 -04:00
|
|
|
(begin (write (compile-thunk (expand E)) out)
|
|
|
|
(newline out)
|
2019-08-09 10:18:36 -04:00
|
|
|
(next (read in)))))
|
2019-08-13 16:07:44 -04:00
|
|
|
(io.close in)
|
|
|
|
(io.seek out 0)
|
|
|
|
out))
|
2009-04-22 20:55:03 -04:00
|
|
|
|
|
|
|
(for-each (lambda (file)
|
2019-08-13 16:07:44 -04:00
|
|
|
(dump-buffer-as-c-literal (compile-file->buffer file)))
|
2019-08-09 10:18:36 -04:00
|
|
|
(cdr *argv*))
|