From 78d490d5e414c80c1d6c42311f64afaaf8ec8199 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 28 Jan 2010 09:31:29 -0500 Subject: [PATCH] Preproc: Strip all CRs up front --- src/V3PreProc.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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) {