Made two changes to the verilog token parsing in netfile.c in
response to Mitch Bailey's github issue #82: (1) When skipping comments, skip the contents of "(* ... *)" delimiters as well as "/* ... */" delimiters. (2) When checking for qflow's "\abcd\" names (final space replaced with a backslash for SPICE compatibility of names), make sure that the last "\" is followed by end- of-string. Otherwise names like "\a\bcd " will fail to parse correctly.
This commit is contained in:
parent
cff954f36a
commit
b1374e2bc8
|
|
@ -611,7 +611,8 @@ void SpiceTokNoNewline(void)
|
|||
}
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* Skip to the next token, ignoring any C-style comments. */
|
||||
/* Skip to the next token, ignoring any C-style comments and verilog */
|
||||
/* "(* ... *)"-style comments. */
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
void SkipTokComments(char *delimiter)
|
||||
|
|
@ -627,6 +628,11 @@ void SkipTokComments(char *delimiter)
|
|||
SkipTok(delimiter);
|
||||
if (nexttok) SkipTok(delimiter);
|
||||
}
|
||||
else if (match(nexttok, "(*")) {
|
||||
while (nexttok && !match(nexttok, "*)"))
|
||||
SkipTok(delimiter);
|
||||
if (nexttok) SkipTok(delimiter);
|
||||
}
|
||||
else break;
|
||||
}
|
||||
}
|
||||
|
|
@ -731,7 +737,7 @@ char *strdtok(char *pstring, char *delim1, char *delim2)
|
|||
if (*s == '\\') {
|
||||
s++;
|
||||
while (*s != '\0') {
|
||||
if ((*s == ' ') || (*s == '\\')) {
|
||||
if ((*s == ' ') || ((*s == '\\') && (*(s + 1) == '\0'))) {
|
||||
s++;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue