aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/verilog/preproc.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-08-14 22:26:30 +0200
committerClifford Wolf <clifford@clifford.at>2014-08-14 22:26:30 +0200
commit6d56172c0d16f80742c1c4588929d1805e3dd650 (patch)
treeb59b06a6a3aee1841c6d083a23239b5e9ec81f28 /frontends/verilog/preproc.cc
parent85e3cc12ac44c44178185b918aa2a7fe9ca89918 (diff)
downloadyosys-6d56172c0d16f80742c1c4588929d1805e3dd650.tar.gz
yosys-6d56172c0d16f80742c1c4588929d1805e3dd650.tar.bz2
yosys-6d56172c0d16f80742c1c4588929d1805e3dd650.zip
Fixed line numbers when using here-doc macros
Diffstat (limited to 'frontends/verilog/preproc.cc')
-rw-r--r--frontends/verilog/preproc.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/frontends/verilog/preproc.cc b/frontends/verilog/preproc.cc
index 7935fbc34..ae139741a 100644
--- a/frontends/verilog/preproc.cc
+++ b/frontends/verilog/preproc.cc
@@ -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') {