diff --git a/src/V3PreProc.cpp b/src/V3PreProc.cpp index 1047d26ff..c7429b2a8 100644 --- a/src/V3PreProc.cpp +++ b/src/V3PreProc.cpp @@ -593,6 +593,15 @@ void V3PreProcImp::openFile(FileLine* fl, V3InFilter* filterp, const string& fil return; } + // Filter all DOS CR's en-mass. This avoids bugs with lexing CRs in the wrong places. + // This will also strip them from strings, but strings aren't supposed to be multi-line without a "\" + string wholefilecr; + size_t wholesize = wholefile.length(); + for (size_t i=0; i4)?1:0; - unputString(wholefile,true); + unputString(wholefilecr,true); } void V3PreProcImp::insertUnreadbackAtBol(const string& text) {