diff options
Diffstat (limited to 'solc/jsonCompiler.cpp')
-rw-r--r-- | solc/jsonCompiler.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/solc/jsonCompiler.cpp b/solc/jsonCompiler.cpp index ef69105e..0f95ebe5 100644 --- a/solc/jsonCompiler.cpp +++ b/solc/jsonCompiler.cpp @@ -1,18 +1,18 @@ /* - This file is part of cpp-ethereum. + This file is part of solidity. - cpp-ethereum is free software: you can redistribute it and/or modify + solidity is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - cpp-ethereum is distributed in the hope that it will be useful, + solidity is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>. + along with solidity. If not, see <http://www.gnu.org/licenses/>. */ /** * @author Christian <c@ethdev.com> @@ -27,6 +27,7 @@ #include <libdevcore/Common.h> #include <libdevcore/CommonData.h> #include <libdevcore/CommonIO.h> +#include <libdevcore/JSON.h> #include <libevmasm/Instruction.h> #include <libevmasm/GasMeter.h> #include <libsolidity/parsing/Scanner.h> @@ -189,6 +190,10 @@ string compile(StringMap const& _sources, bool _optimize, CStyleReadFileCallback { errors.append(formatError(exception, "Internal compiler error", scannerFromSourceName)); } + catch (UnimplementedFeatureError const& exception) + { + errors.append(formatError(exception, "Unimplemented feature", scannerFromSourceName)); + } catch (Exception const& exception) { errors.append("Exception during compilation: " + boost::diagnostic_information(exception)); @@ -209,7 +214,7 @@ string compile(StringMap const& _sources, bool _optimize, CStyleReadFileCallback for (string const& contractName: compiler.contractNames()) { Json::Value contractData(Json::objectValue); - contractData["interface"] = compiler.interface(contractName); + contractData["interface"] = dev::jsonCompactPrint(compiler.interface(contractName)); contractData["bytecode"] = compiler.object(contractName).toHex(); contractData["runtimeBytecode"] = compiler.runtimeObject(contractName).toHex(); contractData["opcodes"] = solidity::disassemble(compiler.object(contractName).bytecode); @@ -270,7 +275,7 @@ string compile(StringMap const& _sources, bool _optimize, CStyleReadFileCallback try { - return Json::FastWriter().write(output); + return dev::jsonCompactPrint(output); } catch (...) { @@ -288,7 +293,7 @@ string compileMulti(string const& _input, bool _optimize, CStyleReadFileCallback errors.append("Error parsing input JSON: " + reader.getFormattedErrorMessages()); Json::Value output(Json::objectValue); output["errors"] = errors; - return Json::FastWriter().write(output); + return dev::jsonCompactPrint(output); } else { |