Fixed line numbers when using here-doc macros

This commit is contained in:
Clifford Wolf 2014-08-14 22:26:30 +02:00
parent 85e3cc12ac
commit 6d56172c0d
1 changed files with 9 additions and 4 deletions

View File

@ -343,10 +343,15 @@ std::string frontend_verilog_preproc(FILE *f, std::string filename, const std::m
} else {
if (state != 2)
state = 3;
if (tok == "\n" && !here_doc_mode) {
return_char('\n');
break;
}
if (tok == "\n") {
if (here_doc_mode) {
value += " ";
newline_count++;
} else {
return_char('\n');
break;
}
} else
if (tok == "\\") {
char ch = next_char();
if (ch == '\n') {