134 |
foreach (@{$request{'macro'}}) |
foreach (@{$request{'macro'}}) |
135 |
{ |
{ |
136 |
if (! exists ${$req->macro}{$_}) |
if (! exists ${$req->macro}{$_}) |
137 |
{ |
{ |
138 |
${$req->macro}{$_} = 1; |
${$req->macro}{$_} = 1; |
139 |
$req->valid (0); |
$req->valid (0); |
140 |
} |
} |
141 |
} |
} |
142 |
|
|
143 |
# It would be great to have $REQ check that it up to date wrt its |
# It would be great to have $REQ check that it up to date wrt its |
864 |
} |
} |
865 |
# $x, no separator given. |
# $x, no separator given. |
866 |
elsif (s/^\$([fldn\$])//) |
elsif (s/^\$([fldn\$])//) |
867 |
{ |
{ |
868 |
$res .= $escape{$1}; |
$res .= $escape{$1}; |
869 |
} |
} |
870 |
# $.x or ${sep}x. |
# $.x or ${sep}x. |
888 |
} |
} |
889 |
} |
} |
890 |
elsif (/^(\$.)/) |
elsif (/^(\$.)/) |
891 |
{ |
{ |
892 |
error "invalid escape: $1"; |
error "invalid escape: $1"; |
893 |
} |
} |
894 |
else |
else |
895 |
{ |
{ |
896 |
s/^([^\$]+)//; |
s/^([^\$]+)//; |
897 |
$res .= $1; |
$res .= $1; |
898 |
} |
} |
899 |
} |
} |
900 |
|
|
901 |
$_ = $underscore; |
$_ = $underscore; |
935 |
# and no new line remains. |
# and no new line remains. |
936 |
define([_at_at], |
define([_at_at], |
937 |
[at_ifelse([$#], [1], [], |
[at_ifelse([$#], [1], [], |
938 |
[$#], [2], [[[$2]]], |
[$#], [2], [[[$2]]], |
939 |
[[[$2]][$1]$0([$1], at_shift(at_shift($@)))])]) |
[[[$2]][$1]$0([$1], at_shift(at_shift($@)))])]) |
940 |
|
|
941 |
define([_at_percent], |
define([_at_percent], |
942 |
[at_ifelse([$#], [1], [], |
[at_ifelse([$#], [1], [], |
943 |
[$#], [2], [at_flatten([$2])], |
[$#], [2], [at_flatten([$2])], |
944 |
[at_flatten([$2])[$1]$0([$1], at_shift(at_shift($@)))])]) |
[at_flatten([$2])[$1]$0([$1], at_shift(at_shift($@)))])]) |
945 |
|
|
946 |
define([_at_star], |
define([_at_star], |
947 |
[at_ifelse([$#], [1], [], |
[at_ifelse([$#], [1], [], |
948 |
[$#], [2], [[$2]], |
[$#], [2], [[$2]], |
949 |
[[$2][$1]$0([$1], at_shift(at_shift($@)))])]) |
[[$2][$1]$0([$1], at_shift(at_shift($@)))])]) |
950 |
|
|
951 |
# FLATTEN quotes its result. |
# FLATTEN quotes its result. |
952 |
# Note that the second pattern is `newline, tab or space'. Don't lose |
# Note that the second pattern is `newline, tab or space'. Don't lose |
953 |
# the tab! |
# the tab! |
954 |
define([at_flatten], |
define([at_flatten], |
955 |
[at_patsubst(at_patsubst(at_patsubst(at_patsubst([[[[$1]]]], [\\\n]), |
[at_patsubst(at_patsubst(at_patsubst(at_patsubst([[[[$1]]]], [\\\n]), |
956 |
[[\n\t ]+], [ ]), |
[[\n\t ]+], [ ]), |
957 |
[ *\(.\)$], [\1]), |
[ *\(.\)$], [\1]), |
958 |
[^ *\(.*\)], [[\1]])]) |
[^ *\(.*\)], [[\1]])]) |
959 |
|
|
960 |
define([at_args], [at_shift(at_shift(at_shift(at_shift(at_shift($@)))))]) |
define([at_args], [at_shift(at_shift(at_shift(at_shift(at_shift($@)))))]) |