mirror of
https://github.com/open-simh/simtools.git
synced 2026-01-11 23:53:02 +00:00
Always list lines that have an error
This commit is contained in:
parent
c42c5732b3
commit
aa8d5fdfef
22
listing.c
22
listing.c
@ -30,16 +30,26 @@ FILE *lstfile = NULL;
|
||||
|
||||
int list_pass_0 = 0;/* Also list what happens during the first pass */
|
||||
|
||||
static int errline = 0; /* Set if current line has an error */
|
||||
|
||||
/* maybe_list returns TRUE if listing may happen for this line. */
|
||||
|
||||
static int can_list(
|
||||
void)
|
||||
{
|
||||
int ok = lstfile != NULL &&
|
||||
(pass > 0 || list_pass_0);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
/* do_list returns TRUE if listing is enabled. */
|
||||
|
||||
static int dolist(
|
||||
void)
|
||||
{
|
||||
int ok = lstfile != NULL &&
|
||||
(pass > 0 || list_pass_0) &&
|
||||
list_level > 0;
|
||||
int ok = can_list () &&
|
||||
(list_level > 0 || errline);
|
||||
|
||||
return ok;
|
||||
}
|
||||
@ -50,9 +60,11 @@ void list_source(
|
||||
STREAM *str,
|
||||
char *cp)
|
||||
{
|
||||
if (dolist()) {
|
||||
if (can_list()) {
|
||||
int len = strcspn(cp, "\n");
|
||||
|
||||
/* Not an error yet */
|
||||
errline = 0;
|
||||
/* Save the line text away for later... */
|
||||
if (listline)
|
||||
free(listline);
|
||||
@ -165,6 +177,8 @@ void report(
|
||||
if (!pass && list_pass_0 < 2)
|
||||
return; /* Don't report now. */
|
||||
|
||||
errline = 1;
|
||||
|
||||
if (str) {
|
||||
name = str->name;
|
||||
line = str->line;
|
||||
|
||||
@ -4,13 +4,13 @@
|
||||
4 ;
|
||||
5
|
||||
6 ; This should get listed (list_level 1)
|
||||
7 .nlist
|
||||
9 .list
|
||||
10 ; This should get listed (list_level 1)
|
||||
11 .list
|
||||
12 ; This should get listed (list_level 2)
|
||||
13 .nlist
|
||||
14 ; This should get listed (list_level 1)
|
||||
15 .nlist
|
||||
21 .list
|
||||
22 ; This should get listed (list_level 1)
|
||||
22
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user