summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
80ebf10)
And now document the use of $&+ for recipes.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
&$- Stops dollar-doubling
Both are idempotent and local to the file or context.
&$- Stops dollar-doubling
Both are idempotent and local to the file or context.
+This is useful both for make macrology involving $(eval ...), and
+possibly for helping write complicated recipes involving shell
+variables, inline Perl code, etc.
+
Sometimes we will show $'s being doubled inside another construct.
This means the content of the construct is $-doubled: $-doubling is
locally enabled, and restored afterwards.
Sometimes we will show $'s being doubled inside another construct.
This means the content of the construct is $-doubled: $-doubling is
locally enabled, and restored afterwards.
&-expansions not mentioned here
&\$ => $
&-expansions not mentioned here
&\$ => $
-&$( => $(
-&$NN => $(NN) where N are digits
+&$( => ${ (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
or places where this might imply $-quadrupling. (There is no way to
A few contexts do not support $-doubling, such as directive arguments
or places where this might imply $-quadrupling. (There is no way to
elsif (s{^\$\-}{}) { $ddbl=undef; }
elsif (s{^\$\+}{}) { $ddbl=1; }
elsif (s{^\$\(}{}) {
elsif (s{^\$\-}{}) { $ddbl=undef; }
elsif (s{^\$\+}{}) { $ddbl=1; }
elsif (s{^\$\(}{}) {
- ddbl_only($&); oud "\$(";
+ ddbl_only($&); oud "\${";
$note_varref->($2,!!$1) if m{^($esc)?([^()\$]+\))};
}
$note_varref->($2,!!$1) if m{^($esc)?([^()\$]+\))};
}
- elsif (s{^\$(\d+)}{}) { ddbl_only($&); oud "\$($1)"; }
+ elsif (s{^\$(\d+)}{}) { ddbl_only($&); oud "\${$1}"; }
elsif (s{^\$\{}{}) {
err 'macro invocation cannot be re-$-doubled' if $ddbl;
od '${eval ${call ';
elsif (s{^\$\{}{}) {
err 'macro invocation cannot be re-$-doubled' if $ddbl;
od '${eval ${call ';