chiark / gitweb /
Syntax: Incompatible change: Use &{ not &${ for macros
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Jan 2020 13:26:26 +0000 (13:26 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Jan 2020 13:59:05 +0000 (13:59 +0000)
This will be more orthogonal with $( which will come in a moment.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
README
generate
tests/filter/Dir.sd.mk
tests/filter/extract-doctests

diff --git a/README b/README
index 4493a0d..b42356d 100644 (file)
--- a/README
+++ b/README
@@ -219,7 +219,7 @@ STUFF $ THINGS      ..      STUFF $$ THINGS
 &:endm         ..      endef
        NAME is processed for &
 
-&${..$..}      =>      ${eval ${call ..$$..}}
+&{..$..}       =>      ${eval ${call ..$$..}}
        (matches { } pairs to find the end)
        content is $-doubled (unless it contains &$- to turn that off)
 
index bcbbf79..c2dc42d 100755 (executable)
--- a/generate
+++ b/generate
@@ -371,11 +371,11 @@ sub process_input_mk ($$$$) {
                $note_varref->($2,!!$1) if m{^($esc)?([^()\$]+\))};
            }
            elsif (s{^\$(\d+)}{}) { ddbl_only($&); oud "\${$1}"; }
-           elsif (s{^\$\{}{}) {
+           elsif (s{^\{}{}) {
                err 'macro invocation cannot be re-$-doubled' if $ddbl;
                od '${eval ${call ';
                $evalcall_brackets = 1;
-               $push_nest->('eval',1, '&${...}');
+               $push_nest->('eval',1, '&{...}');
                $note_varref->($2,!!$1) if m{^\s*($esc)?([^,{}\$]+)};
            } elsif (s{^([~^]?)(?=[ \t])}{}) {
                my $prefix = $pfxmap{$1} // die "internal error ($1?)";
index a9da21f..f5e2868 100644 (file)
@@ -14,7 +14,7 @@ WARN += 3
 # &$NOWARN1 $(NOWARN1)
 # &$NOWARN2 $(NOWARN2)
 
-&${ some-macro, 42, $x, { &$- $(foreach something) } }
+&{ some-macro, 42, $x, { &$- $(foreach something) } }
 
 $&FBAR
 
index 130c237..e4141e6 100755 (executable)
@@ -147,7 +147,7 @@ sub writeout ($) {
                      # adhoc: skip &:macro in already-doubling part
                      return 0 if $e->{In} =~ m{^\&\:macro};
                      # adhoc: skip &${ ie eval in already-doubling part
-                     return 0 if $e->{In} =~ m{^\&\$\{};
+                     return 0 if $e->{In} =~ m{^\&\{};
                      return 0 if $e->{CQ};
                      return $e->{DD} || !grep {
                          # If there are two entries with the same In,