From 50bb24af5e84b9fea7fa4132227c9ce2462dede6 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 29 Mar 2017 14:54:34 +0100 Subject: Include source mapping identifier --- libsolidity/interface/StandardCompiler.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp index 390332e8..82a4ce7b 100644 --- a/libsolidity/interface/StandardCompiler.cpp +++ b/libsolidity/interface/StandardCompiler.cpp @@ -135,6 +135,16 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input) Json::Value output = Json::objectValue; + output["sources"] = Json::objectValue; + unsigned sourceIndex = 0; + for (auto const& source: m_compilerStack.sourceNames()) + { + Json::Value sourceResult = Json::objectValue; + sourceResult["id"] = sourceIndex++; + // @TODO add ast + output["sources"][source] = sourceResult; + } + Json::Value contractsOutput = Json::objectValue; for (string const& contractName: m_compilerStack.contractNames()) { -- cgit