chiark / gitweb /
Syntax: Incompatible change: &$( does not do daft { thing
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Jan 2020 14:13:03 +0000 (14:13 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Jan 2020 14:13:03 +0000 (14:13 +0000)
It is silly for &$( to expand to ${.  That requires the input to
contain non-matched kinds of brackets.

The shell compatibility is not needed.  In a shell rune, you can write
&\$thing since the { } are not normally needed there at all.  If they
are then now &\${thing} is necessary.  It would be possible to steal
"&${" (or allow only "&$(") but that seems less good.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
README
generate

diff --git a/README b/README
index d85a688..e5a415f 100644 (file)
--- a/README
+++ b/README
@@ -239,7 +239,7 @@ $   =>      $$      including $'s produced by other
                         &-expansions not mentioned here
 
 &\$    =>      $
-&$(    =>      ${      (expands to { } so it is useable for shell too)
+&$(    =>      $(
 &$NN   =>      ${NN}   where N are digits
 
 A few contexts do not support $-doubling, such as directive arguments
index b564260..b682299 100755 (executable)
--- a/generate
+++ b/generate
@@ -367,7 +367,7 @@ sub process_input_mk ($$$$) {
            elsif (s{^\$\-}{}) { $ddbl=undef; }
            elsif (s{^\$\+}{}) { $ddbl=1; }
            elsif (s{^\$\(}{}) {
-               ddbl_only($&); oud "\${";
+               ddbl_only($&); oud "\$(";
                $note_varref->($2,!!$1) if m{^($esc)?([^()\$]+\))};
            }
            elsif (s{^\$(\d+)}{}) { ddbl_only($&); oud "\${$1}"; }