Merge branch 'master' into netgen-1.5
This commit is contained in:
commit
f2368ca223
|
|
@ -599,7 +599,7 @@ void SpiceTokNoNewline(void)
|
||||||
{
|
{
|
||||||
int contline;
|
int contline;
|
||||||
|
|
||||||
if ((nexttok = strdtok(NULL, WHITESPACE_DELIMITER, NULL)) != NULL) return;
|
if ((nexttok = strdtok0(NULL, WHITESPACE_DELIMITER, NULL, FALSE)) != NULL) return;
|
||||||
|
|
||||||
while (nexttok == NULL) {
|
while (nexttok == NULL) {
|
||||||
contline = getc(infile);
|
contline = getc(infile);
|
||||||
|
|
@ -701,7 +701,7 @@ void SpiceSkipNewLine(void)
|
||||||
/* the boundary between two-character and one-character delimiters. */
|
/* 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 *stoken = NULL;
|
||||||
static char *sstring = 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 */
|
/* should know whether it is parsing SPICE or verilog and handle the syntax */
|
||||||
/* accordingly (needs to be done). */
|
/* accordingly (needs to be done). */
|
||||||
|
|
||||||
if (*s == '\\') {
|
if (isverilog && (*s == '\\')) {
|
||||||
s++;
|
s++;
|
||||||
while (*s != '\0') {
|
while (*s != '\0') {
|
||||||
if ((*s == ' ') || ((*s == '\\') && (*(s + 1) == '\0'))) {
|
if ((*s == ' ') || ((*s == '\\') && (*(s + 1) == '\0'))) {
|
||||||
|
|
@ -817,6 +817,17 @@ char *strdtok(char *pstring, char *delim1, char *delim2)
|
||||||
return sstring;
|
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)
|
void InputParseError(FILE *f)
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ extern struct hashdict *definitions;
|
||||||
|
|
||||||
extern char *nexttok;
|
extern char *nexttok;
|
||||||
#define SKIPTO(a) do {SkipTok(NULL);} while (!match(nexttok,a))
|
#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 *strdtok(char *pstring, char *delim1, char *delim2);
|
||||||
extern char *GetLineAtTok();
|
extern char *GetLineAtTok();
|
||||||
extern void SkipTok(char *delimiter);
|
extern void SkipTok(char *delimiter);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue