Create separate OpSource for each included file

This commit is contained in:
Greg Fischer 2018-12-06 11:13:15 -07:00
parent 9ed38739b9
commit d445bb2867
6 changed files with 131 additions and 104 deletions

View file

@ -653,6 +653,7 @@ int TPpContext::CPPinclude(TPpToken* ppToken)
epilogue << (res->headerData[res->headerLength - 1] == '\n'? "" : "\n") <<
"#line " << directiveLoc.line + forNextLine << " " << directiveLoc.getStringNameOrNum() << "\n";
pushInput(new TokenizableIncludeFile(directiveLoc, prologue.str(), res, epilogue.str(), this));
parseContext.intermediate.addIncludeText(res->headerName.c_str(), res->headerData, res->headerLength);
// There's no "current" location anymore.
parseContext.setCurrentColumn(0);
} else {