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 d85a68804c4e4bf8adff2480fc37fcf9bcef0ed7..e5a415f8196c8088ee74d9c312e5ae6e0defad62 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 b564260dea4c02e4385fc0b36974e04efbddf718..b682299d870a8ca0ade4a14321f0a1f3845dcc5e 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}"; }