From 2f2126e0e8b67b63c08ad2d86e07f076233bb2bb Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 14 Jun 2019 22:33:01 -0700 Subject: compile-file: translate --lisp option in hash bang. * share/txr/stdlib/compiler.tl (usr:compile-file): Edit the hash-bang line to replace the --lisp option with --compiled. This supports the situation when a TXR Lisp hash bang script that is unsuffixed is compiled to an unsuffixed compiled script. --- share/txr/stdlib/compiler.tl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl index 441f2c5e..233ef129 100644 --- a/share/txr/stdlib/compiler.tl +++ b/share/txr/stdlib/compiler.tl @@ -1662,7 +1662,10 @@ (out (new list-builder))) (iflet ((line (get-line in-stream)) ((starts-with "#!" line))) - (put-line line out-stream) + (progn + (set line `@line `) + (upd line (regsub #/--lisp[^\-]/ (ret `--compiled@[@1 -1]`))) + (put-line (butlast line) out-stream)) (seek-stream in-stream 0 :from-start)) (labels ((compile-form (unex-form) (let ((form (macroexpand unex-form))) -- cgit v1.2.3