summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--doc/manual.md2
-rw-r--r--doc/nimc.md11
-rw-r--r--lib/system/nimscript.nim1
3 files changed, 14 insertions, 0 deletions
diff --git a/doc/manual.md b/doc/manual.md
index f5ee10fda..c381ab410 100644
--- a/doc/manual.md
+++ b/doc/manual.md
@@ -6676,6 +6676,8 @@ even when one version does not export some of these identifiers.
 
 The `import` statement is only allowed at the top level.
 
+String literals can be used for import/include statements.
+The compiler performs [path substitution](nimc.html#compiler-usage-commandminusline-switches) when used.
 
 Include statement
 -----------------
diff --git a/doc/nimc.md b/doc/nimc.md
index d367c6620..4f715ee83 100644
--- a/doc/nimc.md
+++ b/doc/nimc.md
@@ -32,6 +32,17 @@ Compiler Usage
 
 Command-line switches
 ---------------------
+All options that take a `PATH` or `DIR` argument are subject to path substitution:
+
+- `$nim`: The global nim prefix path
+- `$lib`: The stdlib path
+- `$home` and `~`: The user's home path
+- `$config`: The directory of the module currently being compiled
+- `$projectname`: The project file's name without file extension
+- `$projectpath` and `$projectdir`: The project file's path
+- `$nimcache`: The nimcache path
+
+
 Basic command-line switches are:
 
 .. no syntax highlighting in the below included files at the moment
diff --git a/lib/system/nimscript.nim b/lib/system/nimscript.nim
index 0b49ea2e7..9ce475e5b 100644
--- a/lib/system/nimscript.nim
+++ b/lib/system/nimscript.nim
@@ -86,6 +86,7 @@ proc patchFile*(package, filename, replacement: string) =
   ## is interpreted to be local to the Nimscript file that contains
   ## the call to `patchFile`, Nim's `--path` is not used at all
   ## to resolve the filename!
+  ## The compiler also performs `path substitution <nimc.html#compiler-usage-commandminusline-switches>`_ on `replacement`.
   ##
   ## Example:
   ##