From c6e0abe539310d9c3a612dd92f59d106aa8674c7 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 11 Dec 2019 13:24:47 +0000 Subject: [PATCH] Syntax: Introduce &:changequote Incompatible change. Signed-off-by: Ian Jackson --- README | 12 ++++++------ generate | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README b/README index 3390adf..006b57f 100644 --- a/README +++ b/README @@ -266,11 +266,11 @@ So pathname syntax is a subset of: &# delete everything to end of line (useful if the RHS contains unrecognised & constructions) -&!STUFF +&:changequote STUFF changes the escape sequence from & to literally STUFF STUFF may be any series of of non-whitespace characters, - and is terminated by EOL or lwsp. &!STUFF and the lwsp - are discarded. + and is terminated by EOL or lwsp. The whole line is + discarded. After this, write STUFF instead of &, everywhere. The effect is global and lasts until the next setting. @@ -278,9 +278,9 @@ So pathname syntax is a subset of: it back before using &:include. Notably - STUFFSTUFF => STUFFSTUFF - \STUFF => STUFF - STUFF!& set escape back to & + STUFFSTUFF => STUFFSTUFF + \STUFF => STUFF + STUFF:changequote & => set escape back to & &TARGETS_things Handled specially. If mentioned, declares that this diff --git a/generate b/generate index c17d5f7..351926b 100755 --- a/generate +++ b/generate @@ -176,9 +176,6 @@ sub process_input_mk ($$$$$$$$) { } elsif (s{^![ \t]+}{}) { o $_; $_ = ''; - } elsif (s{^!(\S+)(?:[ \t]+|$)}{}) { - $$esclitr = $1; - $set_esc->(); } else { die "bad escape $$esclitr$_ "; } @@ -192,6 +189,9 @@ sub process_input_mk ($$$$$$$$) { $var_prefix, $targets, $subf, $esclitr, $1); o "\n"; + } elsif (m#^changequote\s+(\S+)\s+$#) { + $$esclitr = $1; + $set_esc->(); } else { die "unknown directive $_ "; } -- 2.30.2