| 989 | } |
| 990 | |
| 991 | void ParserState::IncludeFile( const InlineString& fileName ) |
| 992 | { |
| 993 | extern CachingIncludeHandler g_includeHandler; |
| 994 | |
| 995 | std::string path( fileName.start + 1, fileName.end - 1 ); |
| 996 | if( auto file = g_includeHandler.Open( path.c_str(), m_fileStack.back().code.start + 1 ) ) |
| 997 | { |
| 998 | FileContents fileContents; |
| 999 | |
| 1000 | size_t len = file->fullPath.size(); |
| 1001 | char* fullPath = AllocateString( len ); |
| 1002 | memcpy( fullPath, file->fullPath.data(), len ); |
| 1003 | fileContents.location.fileName = MakeInlineString( fullPath, fullPath + len ); |
| 1004 | |
| 1005 | fileContents.location.lineNumber = 0; |
| 1006 | fileContents.code = MakeInlineString( file->data - 1, file->data + file->size ); |
| 1007 | fileContents.position = file->data - 1; |
| 1008 | fileContents.isMacro = false; |
| 1009 | |
| 1010 | m_fileStack.push_back( fileContents ); |
| 1011 | } |
| 1012 | else |
| 1013 | { |
| 1014 | ShowMessage( EC_FILE_NOT_FOUND, path.c_str() ); |
| 1015 | } |
| 1016 | } |
| 1017 | |
| 1018 | void ParserState::ParseDefine( const PreprocessorDefine& define, const FileLocation& location, const std::vector<InlineString>& arguments ) |
| 1019 | { |
nothing calls this directly
no test coverage detected