From f99c7def1e8afb27b0df6c605ff6847f676d6bfe Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 9 Dec 2019 16:31:59 +0000 Subject: [PATCH] Syntax: Provide &$VARIABLE Testing is done by the doctests. Signed-off-by: Ian Jackson --- README | 3 +++ generate | 1 + 2 files changed, 4 insertions(+) diff --git a/README b/README index 4da4091..6bc8e82 100644 --- a/README +++ b/README @@ -251,6 +251,9 @@ So pathname syntax is a subset of: &\& => & general escaping mechanism &\$ => $ +&$VARIABLE => $(sub_dir_VARIABLE) or $(TOP_VARIABLE) + VARIABLE is ASCII starting with a letter and matching \w+ + & thing thing... & &^ thing thing... & &~ thing thing... & diff --git a/generate b/generate index dd6df29..e7da435 100755 --- a/generate +++ b/generate @@ -162,6 +162,7 @@ sub process_input_mk ($$$$$$$$$) { $targets->{$t} //= [ ]; } elsif (m{^(?=$caps_re)}) { o $var_prefix } + elsif (s{^\$([A-Za-z]\w+)}{}) { o "\$(${var_prefix}$1)" } elsif (s{^([~^]?)(?=$lc_re)}{}) { o $pfxmap{$1} } elsif (s{^_}{}) { o $var_prefix } elsif (s{^=}{}) { o $var_prefix_name } -- 2.30.2