mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Preproc: fix pass-through of `line enter-exit codes.
Internals: Merge Verilog-Perl preproc changes through d450722.
This commit is contained in:
+3
-8
@@ -675,12 +675,7 @@ void V3PreProcImp::insertUnreadbackAtBol(const string& text) {
|
||||
|
||||
void V3PreProcImp::addLineComment(int enter_exit_level) {
|
||||
if (lineDirectives()) {
|
||||
char numbuf[20]; sprintf(numbuf, "%d", m_lexp->m_curFilelinep->lineno());
|
||||
char levelbuf[20]; sprintf(levelbuf, "%d", enter_exit_level);
|
||||
string cmt = ((string)"`line "+numbuf
|
||||
+" \""+m_lexp->m_curFilelinep->filename()+"\" "
|
||||
+levelbuf+"\n");
|
||||
insertUnreadbackAtBol(cmt);
|
||||
insertUnreadbackAtBol(m_lexp->curFilelinep()->lineDirectiveStrg(enter_exit_level));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -742,7 +737,7 @@ int V3PreProcImp::getRawToken() {
|
||||
if (isEof()) return (VP_EOF);
|
||||
|
||||
// Snarf next token from the file
|
||||
m_fileline = m_lexp->m_curFilelinep; // Remember token start location
|
||||
m_fileline = m_lexp->curFilelinep(); // Remember token start location
|
||||
V3PreLex::s_currentLexp = m_lexp; // Tell parser where to get/put data
|
||||
int tok = yylex();
|
||||
|
||||
@@ -799,7 +794,7 @@ int V3PreProcImp::getToken() {
|
||||
goto next_tok;
|
||||
}
|
||||
if (tok==VP_LINE) {
|
||||
addLineComment(0);
|
||||
addLineComment(m_lexp->m_enterExit);
|
||||
goto next_tok;
|
||||
}
|
||||
// Deal with some special parser states
|
||||
|
||||
Reference in New Issue
Block a user