Browse Source

Improve error messages for the 'meas' command.

pre-master-46
Holger Vogt 6 years ago
parent
commit
94d5ad312e
  1. 6
      src/frontend/com_measure2.c
  2. 6
      src/frontend/measure.c

6
src/frontend/com_measure2.c

@ -1169,7 +1169,7 @@ measure_parse_stdParams(
wl = wl->wl_next;
continue;
} else {
sprintf(errbuf, "bad syntax of ??\n");
sprintf(errbuf, "bad syntax. equal sign missing ?\n");
return 0;
}
}
@ -1179,7 +1179,7 @@ measure_parse_stdParams(
}
else {
if (ft_numparse(&pValue, FALSE, &engVal1) < 0) {
sprintf(errbuf, "bad syntax of ??\n");
sprintf(errbuf, "bad syntax, cannot evaluate right hand side of %s=%s\n", pName, pValue);
return 0;
}
}
@ -1216,7 +1216,7 @@ measure_parse_stdParams(
}
if (pCnt == 0) {
sprintf(errbuf, "bad syntax of ??\n");
sprintf(errbuf, "bad syntax of %s\n", pName);
return 0;
}

6
src/frontend/measure.c

@ -67,6 +67,12 @@ com_meas(wordlist *wl)
May be in the next wl_word */
if (token[strlen(token) - 1] == '=') {
wl_index = wl_index->wl_next;
if (wl_index == NULL) {
line_in = wl_flatten(wl);
fprintf(stderr, "\nError: meas %s failed!\n\n", line_in);
tfree(line_in);
return;
}
vec_found = wl_index->wl_word;
/* token may be already a value, maybe 'LAST', which we have to keep, or maybe a vector */
if (!cieq(vec_found, "LAST")) {

Loading…
Cancel
Save