chiark / gitweb /
README: v2: Draft - Introduce &. and friends wip.v2a
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 10 Dec 2019 01:21:43 +0000 (01:21 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 11 Dec 2019 13:39:51 +0000 (13:39 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
README

diff --git a/README b/README
index 6dd1a05a97e3f7aec6a5f6af7e668b20636001f2..6ab45b9a3d2d80cbce38962b2fa009ed6ea3eaca 100644 (file)
--- a/README
+++ b/README
@@ -218,27 +218,37 @@ empty string).
        The assumption is that filenames are usually lowercase and
        variables usually uppercase.  Otherwise, use another syntax:
 
+&/             =>      sub/dir/                        or nothing
 &_             =>      sub_dir_                        or TOP_
-&=_            =>      sub_dir                         or TOP
+&.             =>      sub/dir                         or .
+       (This implies that `&./' works roughly like `&/', although
+       it can produce a needless `./')
 
-&/             =>      sub/dir/                        or nothing
-&=/            =>      sub/dir                         or .
+&=             =>      sub_dir                         or TOP
+^^^ rarely needed.  TBD, maybe one of
+       &._ &_. &\_ &% &$_
+       &<varnameprefix>  &[varnameprefix]
+       $(patsubst %_,&_,%)
 
 &^lc           =>      $(top_srcdir)/sub/dir/lc
 &^/            =>      $(top_srcdir)/sub/dir/
+&^.            =>      $(top_srcdir)/sub/dir
 
 &~lc           =>      $(top_srcdir)/lc
 &~/            =>      $(top_srcdir)/
+&~.            =>      $(top_srcdir)
 
 In general:
-    =  return subdir without delimiter (not allowed with `^' `~')
     ^   pathname of this subdirectory in source tree
     ~   pathname of top level of source tree
-    /  terminates the escape (needed if next is not lwsp or space)
+    /  terminates the path escape } needed if next is
+    _   terminates the var escape  } not lwsp or space)
+    .   terminates path escape giving dir name (excluding /)
+    =  terminates var escape giving only prefix part (rarely needed)
   lwsp  starts multi-word processing (see below)
 
 So pathname syntax is a subset of:
-    '&' [ '^' | '~' ] [ lc | '/' ]
+    '&' [ '^' | '~' ] [ lc | '/' | '.' | '=' ]
 
 &&             =>      &&              for convenience in shell runes
 &@             =>      &               general escaping mechanism