summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-07-21 08:12:05 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-07-21 08:12:05 -0700
commit87e9245c2b379f47cd075b2a1331e8a93f18f577 (patch)
tree6f72132b97653522c824faaebbb804c5225eb6b8
parent3c08aa530dd76642b88a89ae4c2b3c9b9d0d05e5 (diff)
downloadtxr-87e9245c2b379f47cd075b2a1331e8a93f18f577.tar.gz
txr-87e9245c2b379f47cd075b2a1331e8a93f18f577.tar.bz2
txr-87e9245c2b379f47cd075b2a1331e8a93f18f577.zip
compiler: try unsuffixed path before adding .tl
* stdlib/compiler.tl (open-compile-streams): If the in-path is unsuffixed, try opening it without adding any suffix first. If that fails, then try .tl in that order. * txr.1: Documented.
-rw-r--r--stdlib/compiler.tl4
-rw-r--r--txr.18
2 files changed, 6 insertions, 6 deletions
diff --git a/stdlib/compiler.tl b/stdlib/compiler.tl
index 585712f9..c7ac6009 100644
--- a/stdlib/compiler.tl
+++ b/stdlib/compiler.tl
@@ -2255,8 +2255,8 @@
(".txr" (error "~s: cannot compile TXR files" 'compile-file))
(".tl" (set in-stream (ignerr (open-file in-path))
out-path (or out-path `@{ip-nosuff}.tlo`)))
- (t (set in-stream (or (ignerr (open-file `@{in-path}.tl`))
- (ignerr (open-file in-path)))
+ (t (set in-stream (or (ignerr (open-file in-path))
+ (ignerr (open-file `@{in-path}.tl`)))
out-path (or out-path `@{in-path}.tlo`))))
(unless in-stream
diff --git a/txr.1 b/txr.1
index b90aade3..6d7aaab1 100644
--- a/txr.1
+++ b/txr.1
@@ -86002,12 +86002,12 @@ or
.code .txr
then it is considered suffixed, otherwise it is considered unsuffixed.
If it is suffixed, then the actual pathname is the same as the tentative pathname.
-In the unsuffixed case, two possible actual input pathnames are formed. First,
+In the unsuffixed case, two possible actual input pathnames are considered.
+First, if the unsuffixed path refers to a file that can be opened, then that
+unsuffixed path is taken as actual path. Otherwise,
the suffix
.code .tl
-is added to the tentative pathname. If that path exists, it is taken
-taken as the actual path. Otherwise, the unmodified tentative path
-is taken as the actual input path.
+is added to the tentative pathname, and that becomes the actual path.
If the actual path ends in the suffix
.code .txr