File tree Expand file tree Collapse file tree 11 files changed +38
-10
lines changed
saw-user-manual/appendices Expand file tree Collapse file tree 11 files changed +38
-10
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,9 @@ This release supports [version
197197* Fix a bug that would cause SAW to crash when loading an instantiation of a
198198 parameterized Cryptol module that contains newtypes or enums (#2673 ).
199199
200+ * Fix a bug that would cause SAW to completely ignore the paths specified in
201+ the ` SAW_IMPORT_PATH ` /` --import-path ` options.
202+
200203# Version 1.4 -- date still TBD
201204
202205This release supports [ version
Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ command-line options:
2121: Specify a colon-delimited list of paths to search for Java classes.
2222
2323` -i path, --import-path=path `
24- : Specify a colon-delimited list of paths to search for imports.
24+ : Specify a colon-delimited list of paths to search for imports. Note that
25+ paths can also be specified using the ` SAW_IMPORT_PATH ` environment variable.
2526
2627` -t, --extra-type-checking `
2728: Perform extra type checking of intermediate values.
@@ -70,7 +71,9 @@ SAW also uses several environment variables for configuration:
7071 searched to find a Java executable.
7172
7273` SAW_IMPORT_PATH `
73- : Specify a colon-delimited list of directory paths to search for imports.
74+ : Specify a colon-delimited list of directory paths to search for imports. Note
75+ that paths can also be specified using the ` -i ` /` --import-path ` command-line
76+ options.
7477
7578` SAW_JDK_JAR `
7679: Specify the path of the ` .jar ` file containing the core Java
Original file line number Diff line number Diff line change 2424# - the devel version can then be bumped to the current day if needed
2525#
2626
27- # BSD/Linux: date +%s -d "09/29 /2025 00:00:00 GMT"
28- # OSX: date -j -f "%m/%d/%Y %H:%M:%S %Z" "9/29 /2025 00:00:00 GMT" +%s
29- SOURCE_DATE_EPOCH =1759104000
27+ # BSD/Linux: date +%s -d "10/30 /2025 00:00:00 GMT"
28+ # OSX: date -j -f "%m/%d/%Y %H:%M:%S %Z" "10/30 /2025 00:00:00 GMT" +%s
29+ SOURCE_DATE_EPOCH =1761782400
Original file line number Diff line number Diff line change 1+ let a = 1;
Original file line number Diff line number Diff line change 1+ let b = 2;
Original file line number Diff line number Diff line change 1+ let c = 3;
Original file line number Diff line number Diff line change 1+ include "a.saw";
2+ include "b.saw";
3+ include "c.saw";
4+
5+ print a;
6+ print b;
7+ print c;
Original file line number Diff line number Diff line change 1+ set -e
2+
3+ # All of the following are equivalent, and they should all succeed.
4+ SAW_IMPORT_PATH=b_dir:c_dir1/c_dir2 $SAW test.saw
5+ $SAW --import-path b_dir:c_dir1/c_dir2 test.saw
6+ $SAW -i b_dir:c_dir1/c_dir2 test.saw
7+ $SAW --import-path b_dir --import-path c_dir1/c_dir2 test.saw
8+ $SAW -i b_dir -i c_dir1/c_dir2 test.saw
Original file line number Diff line number Diff line change @@ -8,8 +8,7 @@ Stability : provisional
88{-# LANGUAGE CPP #-}
99
1010module SAWScript.Import
11- ( loadFile
12- , findAndLoadFile
11+ ( findAndLoadFile
1312 ) where
1413
1514import qualified Data.Text.IO as TextIO (readFile )
@@ -24,6 +23,7 @@ import SAWCentral.Options
2423import SAWScript.Parser
2524import SAWScript.Token (Token )
2625
26+ -- | Load the 'Stmt's in a @.saw@ file.
2727loadFile :: Options -> FilePath -> IO [Stmt ]
2828loadFile opts fname = do
2929 printOutLn opts Info $ " Loading file " ++ show fname
@@ -53,6 +53,10 @@ parseFile tokens = do
5353 Left err -> Left err
5454 Right stmts -> Right stmts
5555
56+ -- | Find a file, potentially looking in a list of multiple search paths (as
57+ -- specified via the @SAW_IMPORT_PATH@ environment variable or
58+ -- @-i@/@--import-path@ command-line options). If the file was successfully
59+ -- found, load it. If not, raise an error.
5660findAndLoadFile :: Options -> FilePath -> IO [Stmt ]
5761findAndLoadFile opts fp = do
5862 let paths = importPath opts
You can’t perform that action at this time.
0 commit comments