Pull out ReadFile from CompilerStack

This commit is contained in:
Alex Beregszaszi
2017-04-10 12:49:47 +01:00
parent fefb3fad6f
commit 623b8eb107
5 changed files with 57 additions and 20 deletions
+2 -2
View File
@@ -130,7 +130,7 @@ string compile(StringMap const& _sources, bool _optimize, CStyleReadFileCallback
{
Json::Value output(Json::objectValue);
Json::Value errors(Json::arrayValue);
CompilerStack::ReadFileCallback readCallback;
ReadFile::Callback readCallback;
if (_readCallback)
{
readCallback = [=](string const& _path)
@@ -138,7 +138,7 @@ string compile(StringMap const& _sources, bool _optimize, CStyleReadFileCallback
char* contents_c = nullptr;
char* error_c = nullptr;
_readCallback(_path.c_str(), &contents_c, &error_c);
CompilerStack::ReadFileResult result;
ReadFile::Result result;
result.success = true;
if (!contents_c && !error_c)
{