diff --git a/base/netfile.c b/base/netfile.c index e6f13d8..77350a4 100644 --- a/base/netfile.c +++ b/base/netfile.c @@ -329,7 +329,7 @@ int GetNextLineNoNewline(char *delimiter) for (s = line; *s != '\0'; s++) { if (*s == '`') { w = s + 1; - while (isalnum(*w)) w++; + while (isalnum(*w) || (*w == '_') || (*w == '$')) w++; e = *w; *w = '\0'; kl = (struct property *)HashLookup(s + 1, definitions); @@ -365,7 +365,7 @@ int GetNextLineNoNewline(char *delimiter) for (s = line; *s != '\0'; s++) { if (*s == '`') { w = s + 1; - while (isalnum(*w)) w++; + while (isalnum(*w) || (*w == '_') || (*w == '$')) w++; e = *w; *w = '\0'; kl = (struct property *)HashLookup(s + 1, definitions); @@ -496,6 +496,21 @@ void GetNextLine(char *delimiter) } while (nexttok == NULL); } +/*----------------------------------------------------------------------*/ +/* Return a pointer to the line at the position of nexttok */ +/*----------------------------------------------------------------------*/ + +char *GetLineAtTok() +{ + char *lpos; + + if (nexttok == NULL) return NULL; + if (line == NULL) return NULL; + + lpos = strstr(line, nexttok); + return lpos; +} + /*----------------------------------------------------------------------*/ /* if nexttok is already NULL, force scanner to read new line */ /*----------------------------------------------------------------------*/ diff --git a/base/netfile.h b/base/netfile.h index 3fe7ffe..32e0437 100644 --- a/base/netfile.h +++ b/base/netfile.h @@ -31,6 +31,7 @@ extern struct hashdict *definitions; extern char *nexttok; #define SKIPTO(a) do {SkipTok(NULL);} while (!match(nexttok,a)) extern char *strdtok(char *pstring, char *delim1, char *delim2); +extern char *GetLineAtTok(); extern void SkipTok(char *delimiter); extern void SkipTokNoNewline(char *delimiter); extern void SkipTokComments(char *delimiter); diff --git a/base/verilog.c b/base/verilog.c index 0acce53..80a91d7 100644 --- a/base/verilog.c +++ b/base/verilog.c @@ -1115,10 +1115,17 @@ skip_endmodule: kl->slop.dval = 0.01; // One percent default } else { - /* Treat the parameter as a string */ + char *toks; + + /* Treat the parameter as a string; BUT pull everything to */ + /* EOL, not just the current token. */ + toks = GetLineAtTok(); + kl->type = PROP_STRING; - kl->pdefault.string = strsave(nexttok); + kl->pdefault.string = strsave(toks); kl->slop.dval = 0.0; + + SkipNewLine(VLOG_DELIMITERS); } if (kl) HashPtrInstall(kl->key, kl, &verilogdefs); }