aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-10-05 17:58:25 +0800
committerchriseth <c@ethdev.com>2016-10-25 19:45:50 +0800
commit762f7ac2508d119d1d1b66002c5498663a8d482f (patch)
tree6371ca861d6de7717d1bf6070df87ccb4d6c3d0a /libsolidity/interface
parent2f7c847ce40fe6726d270a2997b380177ab6e03e (diff)
downloaddexon-solidity-762f7ac2508d119d1d1b66002c5498663a8d482f.tar.gz
dexon-solidity-762f7ac2508d119d1d1b66002c5498663a8d482f.tar.zst
dexon-solidity-762f7ac2508d119d1d1b66002c5498663a8d482f.zip
Suggest correct version for pragma and complain about pre-release version.
Diffstat (limited to 'libsolidity/interface')
-rw-r--r--libsolidity/interface/CompilerStack.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp
index 476721db..efbbd237 100644
--- a/libsolidity/interface/CompilerStack.cpp
+++ b/libsolidity/interface/CompilerStack.cpp
@@ -21,8 +21,10 @@
* Full-stack compiler that converts a source code string to bytecode.
*/
-#include <boost/algorithm/string.hpp>
-#include <boost/filesystem.hpp>
+#include <libsolidity/interface/CompilerStack.h>
+
+#include <libsolidity/interface/Version.h>
+#include <libsolidity/analysis/SemVerHandler.h>
#include <libsolidity/ast/AST.h>
#include <libsolidity/parsing/Scanner.h>
#include <libsolidity/parsing/Parser.h>
@@ -32,12 +34,15 @@
#include <libsolidity/analysis/DocStringAnalyser.h>
#include <libsolidity/analysis/SyntaxChecker.h>
#include <libsolidity/codegen/Compiler.h>
-#include <libsolidity/interface/CompilerStack.h>
#include <libsolidity/interface/InterfaceHandler.h>
#include <libsolidity/formal/Why3Translator.h>
#include <libdevcore/SHA3.h>
+#include <boost/algorithm/string.hpp>
+#include <boost/filesystem.hpp>
+
+
using namespace std;
using namespace dev;
using namespace dev::solidity;
@@ -100,6 +105,13 @@ bool CompilerStack::parse()
m_errors.clear();
m_parseSuccessful = false;
+ if (SemVerVersion{string(VersionString)}.isPrerelease())
+ {
+ auto err = make_shared<Error>(Error::Type::Warning);
+ *err << errinfo_comment("This is a pre-release compiler version, please do not use it in production.");
+ m_errors.push_back(err);
+ }
+
vector<string> sourcesToParse;
for (auto const& s: m_sources)
sourcesToParse.push_back(s.first);