Improve error message by adding the sourcing netlist line
This commit is contained in:
parent
1877ce88bd
commit
b51f041b29
|
|
@ -57,6 +57,7 @@ typedef struct { /* the input scanner data structure */
|
||||||
char *dyncategory;
|
char *dyncategory;
|
||||||
int hs_compatibility; /* allow extra keywords */
|
int hs_compatibility; /* allow extra keywords */
|
||||||
int linecount; /* number of lines in deck */
|
int linecount; /* number of lines in deck */
|
||||||
|
char* cardline; /* line of card treated currently */
|
||||||
} dico_t;
|
} dico_t;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -672,6 +672,7 @@ nupa_eval(struct card *card)
|
||||||
|
|
||||||
dicoS->srcline = linenum;
|
dicoS->srcline = linenum;
|
||||||
dicoS->oldline = orig_linenum;
|
dicoS->oldline = orig_linenum;
|
||||||
|
dicoS->cardline = s;
|
||||||
|
|
||||||
c = dicoS->dyncategory[linenum];
|
c = dicoS->dyncategory[linenum];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -229,14 +229,16 @@ message(dico_t *dico, const char *fmt, ...)
|
||||||
if (ft_ngdebug) {
|
if (ft_ngdebug) {
|
||||||
fprintf
|
fprintf
|
||||||
(stderr,
|
(stderr,
|
||||||
"Netlist line no. %d, new internal line no. %d:\n",
|
"Error in netlist line no. %d, new internal line no. %d:\n"
|
||||||
dico->oldline, dico->srcline);
|
"%s\n\n",
|
||||||
|
dico->srcline, dico->oldline, dico->cardline);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fprintf
|
fprintf
|
||||||
(stderr,
|
(stderr,
|
||||||
"Netlist line no. %d:\n",
|
"Error in netlist line no. %d:\n"
|
||||||
dico->oldline);
|
"%s\n\n",
|
||||||
|
dico->srcline, dico->oldline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
|
@ -273,6 +275,7 @@ initdico(dico_t *dico)
|
||||||
dico->hs_compatibility = 1;
|
dico->hs_compatibility = 1;
|
||||||
else
|
else
|
||||||
dico->hs_compatibility = 0;
|
dico->hs_compatibility = 0;
|
||||||
|
dico->cardline = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue