mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 18:13:50 +02:00
Fix escaped identifiers with '.' causing conflicts, bug83.
This commit is contained in:
@@ -431,6 +431,23 @@ void V3OutFile::putBreak () {
|
||||
}
|
||||
}
|
||||
|
||||
void V3OutFile::putsQuoted(const char* strg) {
|
||||
// Quote \ and " for use inside C programs
|
||||
// Don't use to quote a filename for #include - #include doesn't \ escape.
|
||||
putcNoTracking('"');
|
||||
for (const char* cp=strg; *cp; cp++) {
|
||||
if (*cp == '\\') {
|
||||
putcNoTracking('\\');
|
||||
putcNoTracking('\\');
|
||||
} else if (*cp == '"') {
|
||||
putcNoTracking('\\');
|
||||
putcNoTracking('"');
|
||||
} else {
|
||||
putcNoTracking (*cp);
|
||||
}
|
||||
}
|
||||
putcNoTracking('"');
|
||||
}
|
||||
void V3OutFile::putsNoTracking (const char *strg) {
|
||||
// Don't track {}'s, probably because it's a $display format string
|
||||
for (const char* cp=strg; *cp; cp++) {
|
||||
|
||||
Reference in New Issue
Block a user