diff --git a/VERSION b/VERSION index e5777e5..d7965c4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.294 +1.5.295 diff --git a/base/netfile.c b/base/netfile.c index ff1781b..421acfa 100644 --- a/base/netfile.c +++ b/base/netfile.c @@ -599,7 +599,7 @@ void SpiceTokNoNewline(void) { int contline; - if ((nexttok = strdtok(NULL, WHITESPACE_DELIMITER, NULL)) != NULL) return; + if ((nexttok = strdtok0(NULL, WHITESPACE_DELIMITER, NULL, FALSE)) != NULL) return; while (nexttok == NULL) { contline = getc(infile); @@ -701,7 +701,7 @@ void SpiceSkipNewLine(void) /* the boundary between two-character and one-character delimiters. */ /*----------------------------------------------------------------------*/ -char *strdtok(char *pstring, char *delim1, char *delim2) +char *strdtok0(char *pstring, char *delim1, char *delim2, char isverilog) { static char *stoken = NULL; static char *sstring = NULL; @@ -746,7 +746,7 @@ char *strdtok(char *pstring, char *delim1, char *delim2) /* should know whether it is parsing SPICE or verilog and handle the syntax */ /* accordingly (needs to be done). */ - if (*s == '\\') { + if (isverilog && (*s == '\\')) { s++; while (*s != '\0') { if ((*s == ' ') || ((*s == '\\') && (*(s + 1) == '\0'))) { @@ -817,6 +817,17 @@ char *strdtok(char *pstring, char *delim1, char *delim2) return sstring; } +/*----------------------------------------------------------------------*/ +/* strdtok() is the original string tokenizer. It calls strdtok0() */ +/* with isverilog=TRUE, so that tokens are parsed as (potentially) */ +/* verilog names, which includes verilog backslash notation. */ +/*----------------------------------------------------------------------*/ + +char *strdtok(char *pstring, char *delim1, char *delim2) +{ + return strdtok0(pstring, delim1, delim2, TRUE); +} + /*----------------------------------------------------------------------*/ void InputParseError(FILE *f) diff --git a/base/netfile.h b/base/netfile.h index 84227ad..459712f 100644 --- a/base/netfile.h +++ b/base/netfile.h @@ -36,6 +36,7 @@ extern struct hashdict *definitions; extern char *nexttok; #define SKIPTO(a) do {SkipTok(NULL);} while (!match(nexttok,a)) +extern char *strdtok0(char *pstring, char *delim1, char *delim2, char isverilog); extern char *strdtok(char *pstring, char *delim1, char *delim2); extern char *GetLineAtTok(); extern void SkipTok(char *delimiter);