Add more SATISFY diagnostics.
All checks were successful
Remind unit tests / tests (push) Successful in 34s

This commit is contained in:
Dianne Skoll
2024-08-27 15:02:11 -04:00
parent 98e491ed1d
commit b794a45c3f
3 changed files with 33789 additions and 771 deletions

View File

@@ -75,9 +75,28 @@ ensure_satnode_mentions_trigdate_aux(expr_node *node)
static void ensure_satnode_mentions_trigdate(expr_node *node) static void ensure_satnode_mentions_trigdate(expr_node *node)
{ {
int mentioned; int mentioned;
if (node->type == N_CONSTANT) { char const *str;
if (node->type == N_CONSTANT || node->type == N_SHORT_STR) {
if (node->type == N_CONSTANT) {
if (node->u.value.type == INT_TYPE) {
if (node->u.value.v.val == 0) {
Wprint("SATISFY: constant 0 will never be true");
}
return;
}
if (node->u.value.type != STR_TYPE) {
return;
}
str = node->u.value.v.str;
} else {
str = node->u.name;
}
if (!*str) {
Wprint("SATISFY: constant \"\" will never be true");
}
return; return;
} }
mentioned = ensure_satnode_mentions_trigdate_aux(node); mentioned = ensure_satnode_mentions_trigdate_aux(node);
if (!mentioned) { if (!mentioned) {
Wprint("SATISFY: expression has no reference to trigdate() or $T..."); Wprint("SATISFY: expression has no reference to trigdate() or $T...");

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long