[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 50/58: compile: Add '-x' flag.
From: |
Andy Wingo |
Subject: |
[Guile-commits] 50/58: compile: Add '-x' flag. |
Date: |
Tue, 7 Aug 2018 06:58:38 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 44cdabd9e3b8bc7baca4e6b7506b950dd7cbadd4
Author: Ludovic Courtès <address@hidden>
Date: Thu Jul 19 17:54:30 2018 +0200
compile: Add '-x' flag.
* module/scripts/compile.scm (%options, compile): Add '-x'.
* doc/ref/api-evaluation.texi (Compilation): Document it.
---
doc/ref/api-evaluation.texi | 6 ++++++
module/scripts/compile.scm | 5 +++++
2 files changed, 11 insertions(+)
diff --git a/doc/ref/api-evaluation.texi b/doc/ref/api-evaluation.texi
index 98593ce..60f7fec 100644
--- a/doc/ref/api-evaluation.texi
+++ b/doc/ref/api-evaluation.texi
@@ -658,6 +658,12 @@ Write output bytecode to @var{ofile}. By convention,
bytecode file
names end in @code{.go}. When @option{-o} is omitted, the output file
name is as for @code{compile-file} (see below).
address@hidden -x @var{extension}
+Recognize @var{extension} as a valid source file name extension.
+
+For example, to compile R6RS code, you might want to pass @command{-x
+.sls} so that files ending in @file{.sls} can be found.
+
@item -W @var{warning}
@itemx address@hidden
@cindex warnings, compiler
diff --git a/module/scripts/compile.scm b/module/scripts/compile.scm
index 5aa58d3..924456e 100644
--- a/module/scripts/compile.scm
+++ b/module/scripts/compile.scm
@@ -68,6 +68,10 @@
(if (assoc-ref result 'output-file)
(fail "`-o' option cannot be specified more than once")
(alist-cons 'output-file arg result))))
+ (option '(#\x) #t #f
+ (lambda (opt name arg result)
+ (set! %load-extensions (cons arg %load-extensions))
+ result))
(option '(#\W "warn") #t #f
(lambda (opt name arg result)
@@ -197,6 +201,7 @@ Compile each Guile source file FILE into a Guile object.
-L, --load-path=DIR add DIR to the front of the module load path
-o, --output=OFILE write output to OFILE
+ -x EXTENSION add EXTENSION to the set of source file extensions
-W, --warn=WARNING emit warnings of type WARNING; use `--warn=help'
for a list of available warnings
- [Guile-commits] 58/58: Add missing include to adapt to recent merge from master, (continued)
- [Guile-commits] 58/58: Add missing include to adapt to recent merge from master, Andy Wingo, 2018/08/07
- [Guile-commits] 53/58: r6rs-ports: 'put-bytevector' accepts 64-bit integers., Andy Wingo, 2018/08/07
- [Guile-commits] 47/58: Update release docs., Andy Wingo, 2018/08/07
- [Guile-commits] 42/58: vm: Fix stack-marking bug in multi-threaded programs., Andy Wingo, 2018/08/07
- [Guile-commits] 52/58: compile: Update copyright year., Andy Wingo, 2018/08/07
- [Guile-commits] 25/58: Add SRFI 71: Extended LET-syntax for multiple values., Andy Wingo, 2018/08/07
- [Guile-commits] 37/58: types: Recognize 'scm_t_port_type' and decode port type name., Andy Wingo, 2018/08/07
- [Guile-commits] 48/58: Make srfi-71 visible through 'cond-expand'., Andy Wingo, 2018/08/07
- [Guile-commits] 46/58: build: Really build srfi/srfi-71.scm., Andy Wingo, 2018/08/07
- [Guile-commits] 43/58: Serialize accesses to submodule hash tables., Andy Wingo, 2018/08/07
- [Guile-commits] 50/58: compile: Add '-x' flag.,
Andy Wingo <=
- [Guile-commits] 57/58: Merge branch 'master' into lightning, Andy Wingo, 2018/08/07
- [Guile-commits] 44/58: Update copyright years in '--version' and the manual., Andy Wingo, 2018/08/07
- [Guile-commits] 55/58: srfi-19: Remove unused procedure., Andy Wingo, 2018/08/07
- [Guile-commits] 35/58: web: Export http-request., Andy Wingo, 2018/08/07
- [Guile-commits] 56/58: Fix R6RS call-with-{input, output}-file to open textual ports., Andy Wingo, 2018/08/07
- [Guile-commits] 54/58: Add -Wshadowed-toplevel., Andy Wingo, 2018/08/07