mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 18:13:50 +02:00
Support preprocessing __LINE__
This commit is contained in:
+4
-1
@@ -221,7 +221,10 @@ void FileLine::lineDirective(const char* textp, int& enterExitRef) {
|
||||
bool fail = false;
|
||||
const char* const ln = textp;
|
||||
while (*textp && !std::isspace(*textp)) ++textp;
|
||||
if (std::isdigit(*ln)) {
|
||||
if (0 == strncmp(ln, "`__LINE__", strlen("`__LINE__"))) {
|
||||
// Special case - see docs - don't change other than accounting for `line itself
|
||||
lineno(lineno() + 1);
|
||||
} if (std::isdigit(*ln)) {
|
||||
lineno(std::atoi(ln));
|
||||
} else {
|
||||
fail = true;
|
||||
|
||||
Reference in New Issue
Block a user