chiark / gitweb /
Warnings: Track settings of variables
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 28 Dec 2019 12:27:40 +0000 (12:27 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 30 Dec 2019 11:35:16 +0000 (11:35 +0000)
Where the variable tracking does not involve &-escapes, or only
involves &-escapes which work like a prefix so the processor does not
have the whole variable name, we do this separately from processing.

This is simpler because we can look ahead more.  It also avoids
disturbing the processing logic (which needs to be precisely accurate,
unlike this variable tracking).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
generate

index 03aabb056787e4e98a1d6d6f6167ec32b24620ec..cbc91721473a7bc4de563ea0f6842d3e25aec0b5 100755 (executable)
--- a/generate
+++ b/generate
@@ -245,6 +245,10 @@ sub process_input_mk ($$$$) {
     };
 
     while (<$input>) {
+       if (m#^\s*($esc)?(\w+)\s*(?:=|\+=|\?=|:=)# ||
+           m#^\s*(?:$esc\:macro|define)\s+($esc)?(\S+)\s#) {
+           $note_varref->($2,!!$1);
+       }
        if (s#^\s*$esc\:changequote\s+(\S+)\s+$##) {
            $$esclitr = $1;
            $set_esc->();