From: Ian Jackson Date: Thu, 26 Dec 2019 01:32:43 +0000 (+0000) Subject: Error handling: Fix messages resulting from bad directive arguments X-Git-Tag: subdirmk/0.3~50 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?p=subdirmk.git;a=commitdiff_plain;h=ecbc3dad2da6cddc7562ce77807231d995f6353a;ds=sidebyside Error handling: Fix messages resulting from bad directive arguments "Unknown directive" is not necessarily accurate; another possibility is that the directive is known but didn't match the parsing regexp because of problems with the arguments. Signed-off-by: Ian Jackson --- diff --git a/generate b/generate index 747a79b..4a04506 100755 --- a/generate +++ b/generate @@ -241,7 +241,7 @@ sub process_input_mk ($$$$) { } elsif (s#^\s*$esc\:(?=(-?)include|macro)##) { $buffering_output=''; } elsif (m#^\s*$esc\:([a-z][-0-9a-z_]*)#) { - err "unknown directive &:$1"; + err "unknown directive &:$1 or bad argumnt syntax"; } elsif (s{^\s*${esc}TARGETS(?:_([0-9a-zA-Z_]+))?(?=\W)}{}) { my $t = $1 // 'all'; od target_varname($var_prefix, $t); @@ -311,7 +311,7 @@ sub process_input_mk ($$$$) { od "define $1\n"; $push_nest->('macro', 1, '&:macro'); } else { - die "internal error ($_?)"; + err "bad directive argument syntax"; } } }