From 1b097fd3c795dc5f0e100858a45b2efd8efc59b8 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 26 Jan 2017 13:45:23 +0100 Subject: Proper error reporting for assembly mode. --- solc/CommandLineInterface.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'solc') diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index e49e8517..0a6c17fe 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -921,6 +921,7 @@ bool CommandLineInterface::assemble() m_assemblyStacks[src.first].assemble(); } for (auto const& stack: m_assemblyStacks) + { for (auto const& error: stack.second.errors()) SourceReferenceFormatter::printExceptionInformation( cerr, @@ -928,6 +929,9 @@ bool CommandLineInterface::assemble() (error->type() == Error::Type::Warning) ? "Warning" : "Error", [&](string const& _source) -> Scanner const& { return *scanners.at(_source); } ); + if (!Error::containsOnlyWarnings(stack.second.errors())) + successful = false; + } return successful; } -- cgit v1.2.3 From 8e29d636f710819d082e7b01de42da960d9f5b51 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 26 Jan 2017 13:47:57 +0100 Subject: Header cleanup. --- solc/CommandLineInterface.cpp | 47 ++++++++++++++++++++++--------------------- solc/CommandLineInterface.h | 8 +++++--- 2 files changed, 29 insertions(+), 26 deletions(-) (limited to 'solc') diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index 0a6c17fe..771621d0 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -22,28 +22,8 @@ */ #include "CommandLineInterface.h" -#ifdef _WIN32 // windows - #include - #define isatty _isatty - #define fileno _fileno -#else // unix - #include -#endif -#include -#include -#include - -#include -#include -#include - #include "solidity/BuildInfo.h" -#include -#include -#include -#include -#include -#include + #include #include #include @@ -54,9 +34,31 @@ #include #include #include -#include #include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#ifdef _WIN32 // windows + #include + #define isatty _isatty + #define fileno _fileno +#else // unix + #include +#endif +#include +#include +#include + using namespace std; namespace po = boost::program_options; @@ -907,7 +909,6 @@ void CommandLineInterface::writeLinkedFiles() bool CommandLineInterface::assemble() { - //@TODO later, we will use the convenience interface and should also remove the include above bool successful = true; map> scanners; for (auto const& src: m_sourceCodes) diff --git a/solc/CommandLineInterface.h b/solc/CommandLineInterface.h index b8fc1823..bcfc43d7 100644 --- a/solc/CommandLineInterface.h +++ b/solc/CommandLineInterface.h @@ -21,12 +21,14 @@ */ #pragma once -#include -#include -#include #include #include +#include +#include + +#include + namespace dev { namespace solidity -- cgit v1.2.3