Fixed counting verilog line numbers for "// synopsys translate_off" sections

This commit is contained in:
Clifford Wolf 2014-07-30 20:18:48 +02:00
parent 6400ae3648
commit 7daad40ca4
2 changed files with 4 additions and 4 deletions

View file

@ -74,21 +74,21 @@ namespace VERILOG_FRONTEND {
%%
"`file_push "[^\n]* {
<INITIAL,SYNOPSYS_TRANSLATE_OFF>"`file_push "[^\n]* {
fn_stack.push_back(current_filename);
ln_stack.push_back(frontend_verilog_yyget_lineno());
current_filename = yytext+11;
frontend_verilog_yyset_lineno(0);
}
"`file_pop"[^\n]*\n {
<INITIAL,SYNOPSYS_TRANSLATE_OFF>"`file_pop"[^\n]*\n {
current_filename = fn_stack.back();
fn_stack.pop_back();
frontend_verilog_yyset_lineno(ln_stack.back());
ln_stack.pop_back();
}
"`line"[ \t]+[^ \t\r\n]+[ \t]+\"[^ \r\n]+\"[^\r\n]*\n {
<INITIAL,SYNOPSYS_TRANSLATE_OFF>"`line"[ \t]+[^ \t\r\n]+[ \t]+\"[^ \r\n]+\"[^\r\n]*\n {
char *p = yytext + 5;
while (*p == ' ' || *p == '\t') p++;
frontend_verilog_yyset_lineno(atoi(p));

View file

@ -300,7 +300,7 @@ std::string frontend_verilog_preproc(FILE *f, std::string filename, const std::m
input_file(fp, fn);
fclose(fp);
} else
output_code.push_back("`file_notfound " + fn + "\n");
output_code.push_back("`file_notfound " + fn);
continue;
}