Add type db, some nice macro features and a brand new SDL3 example #27
23
sexc.scm
23
sexc.scm
@@ -123,20 +123,21 @@
|
||||
(out-file (if (eq? output 'default)
|
||||
"a.out"
|
||||
output)))
|
||||
;; `process' hands back one record. Its port accessors are named
|
||||
;; from the *child's* point of view, so `process-input-port' is the
|
||||
;; port we write to: the C compiler's stdin.
|
||||
(let* ((proc (process compiler (append (list "-o" out-file "-x" "c")
|
||||
;; The generated C goes to a temporary .c file rather than the
|
||||
;; compiler's stdin
|
||||
(let ((c-file (create-temporary-file "c")))
|
||||
(with-output-to-file c-file
|
||||
(lambda () (emit-c sex-forms)))
|
||||
(let ((proc (process compiler (append (list "-o" out-file)
|
||||
(if (get-arg args 'compile-object #f)
|
||||
(list "-c")
|
||||
(list))
|
||||
(list "-") ; read stdin
|
||||
cc-args)))
|
||||
(cc-stdin (process-input-port proc)))
|
||||
(with-output-to-port cc-stdin
|
||||
(lambda () (emit-c sex-forms)))
|
||||
(close-output-port cc-stdin)
|
||||
(process-wait proc))))
|
||||
(list c-file)
|
||||
cc-args))))
|
||||
(call-with-values (lambda () (process-wait proc))
|
||||
|
|
||||
(lambda status
|
||||
(delete-file* c-file)
|
||||
(apply values status)))))))
|
||||
|
||||
(define (semantic-process-forms raw-forms input-source)
|
||||
(if (eq? input-source 'stdin)
|
||||
|
||||
Reference in New Issue
Block a user
These wait values never become the process exit code:
mainignores whatcompile-to-filereturns, sosexc file.sex -- -bogus-flagprints the cc error and exits 0.sextestthen treats that as a successful compile. Alsodelete-file*only runs after wait; ifemit-cthrows, the temp.cstays in/tmp.