mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Add MISINDENT lint warning for misleading indentation.
This commit is contained in:
@@ -433,6 +433,12 @@ string FileLine::source() const VL_MT_SAFE {
|
||||
} // LCOV_EXCL_STOP
|
||||
return m_contentp->getLine(m_contentLineno);
|
||||
}
|
||||
string FileLine::sourcePrefix(int toColumn) const VL_MT_SAFE {
|
||||
const std::string src = source();
|
||||
if (toColumn > static_cast<int>(src.length())) toColumn = static_cast<int>(src.length());
|
||||
if (toColumn < 1) return "";
|
||||
return src.substr(0, toColumn - 1);
|
||||
}
|
||||
string FileLine::prettySource() const VL_MT_SAFE {
|
||||
string out = source();
|
||||
// Drop ignore trailing newline
|
||||
|
||||
Reference in New Issue
Block a user