mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 05:47:42 +02:00
Make PPerror message more verbose:
give hint to buggy line segment
This commit is contained in:
@@ -27,6 +27,8 @@
|
|||||||
while (0)
|
while (0)
|
||||||
|
|
||||||
static void PPerror (YYLTYPE *locp, char **line, struct pnode **retval, char const *);
|
static void PPerror (YYLTYPE *locp, char **line, struct pnode **retval, char const *);
|
||||||
|
|
||||||
|
static char *keepline;
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%name-prefix "PP"
|
%name-prefix "PP"
|
||||||
@@ -96,6 +98,7 @@
|
|||||||
{
|
{
|
||||||
$$.num = 0.0;
|
$$.num = 0.0;
|
||||||
yylloc.start = yylloc.stop = NULL;
|
yylloc.start = yylloc.stop = NULL;
|
||||||
|
keepline = *line;
|
||||||
};
|
};
|
||||||
|
|
||||||
%%
|
%%
|
||||||
@@ -170,6 +173,8 @@ PPerror (YYLTYPE *locp, char **line, struct pnode **retval, char const *s)
|
|||||||
NG_IGNORE(locp);
|
NG_IGNORE(locp);
|
||||||
NG_IGNORE(line);
|
NG_IGNORE(line);
|
||||||
NG_IGNORE(retval);
|
NG_IGNORE(retval);
|
||||||
|
char *tmpstr = strstr(keepline, *line);
|
||||||
fprintf (stderr, "%s: %s\n", __func__, s);
|
size_t len = strlen(keepline);
|
||||||
|
fprintf (stderr, "%s: %s in line segment\n %s\nnear\n %*s\n",
|
||||||
|
__func__, s, keepline, len, strstr(keepline, *line));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user