aboutsummaryrefslogtreecommitdiffstats
path: root/solc/jsonCompiler.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-06-08 01:44:32 +0800
committerchriseth <c@ethdev.com>2016-06-09 00:16:46 +0800
commit3150ab2bcfe6ab66d426916fc1a003ae52799b72 (patch)
treeb7fc2c8c910c97c883816364bd62bb7c646dd75b /solc/jsonCompiler.cpp
parent63b63056893717a9ec4565ba6c1e7c746592054b (diff)
downloaddexon-solidity-3150ab2bcfe6ab66d426916fc1a003ae52799b72.tar.gz
dexon-solidity-3150ab2bcfe6ab66d426916fc1a003ae52799b72.tar.zst
dexon-solidity-3150ab2bcfe6ab66d426916fc1a003ae52799b72.zip
Allow remappings to change depending on the context.
Diffstat (limited to 'solc/jsonCompiler.cpp')
-rw-r--r--solc/jsonCompiler.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/solc/jsonCompiler.cpp b/solc/jsonCompiler.cpp
index eaf83705..e8f674a0 100644
--- a/solc/jsonCompiler.cpp
+++ b/solc/jsonCompiler.cpp
@@ -132,26 +132,31 @@ string compile(StringMap const& _sources, bool _optimize, CStyleReadFileCallback
CompilerStack::ReadFileCallback readCallback;
if (_readCallback)
{
- readCallback = [=](string const& _path) -> pair<string, string>
+ readCallback = [=](string const& _path)
{
char* contents_c = nullptr;
char* error_c = nullptr;
_readCallback(_path.c_str(), &contents_c, &error_c);
- string contents;
- string error;
+ CompilerStack::ReadFileResult result;
+ result.success = true;
if (!contents_c && !error_c)
- error = "File not found.";
+ {
+ result.success = false;
+ result.contentsOrErrorMesage = "File not found.";
+ }
if (contents_c)
{
- contents = string(contents_c);
+ result.success = true;
+ result.contentsOrErrorMesage = string(contents_c);
free(contents_c);
}
if (error_c)
{
- error = string(error_c);
+ result.success = false;
+ result.contentsOrErrorMesage = string(error_c);
free(error_c);
}
- return make_pair(move(contents), move(error));
+ return result;
};
}
CompilerStack compiler(true, readCallback);