diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2016-11-16 02:07:33 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2016-11-24 00:38:41 +0800 |
commit | ab3db782ae9193839a354a626a7d8ee7bdfad63a (patch) | |
tree | 9104bfcbb2418fd3c96186aba96909eff1915ef6 /libsolidity | |
parent | a7c2509adfe57f106cb87ed024925751732b5412 (diff) | |
download | dexon-solidity-ab3db782ae9193839a354a626a7d8ee7bdfad63a.tar dexon-solidity-ab3db782ae9193839a354a626a7d8ee7bdfad63a.tar.gz dexon-solidity-ab3db782ae9193839a354a626a7d8ee7bdfad63a.tar.bz2 dexon-solidity-ab3db782ae9193839a354a626a7d8ee7bdfad63a.tar.lz dexon-solidity-ab3db782ae9193839a354a626a7d8ee7bdfad63a.tar.xz dexon-solidity-ab3db782ae9193839a354a626a7d8ee7bdfad63a.tar.zst dexon-solidity-ab3db782ae9193839a354a626a7d8ee7bdfad63a.zip |
test: check the error texts
by changing parseAnalyseAndReturnError to return the whole Error, not just the type
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/interface/Exceptions.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libsolidity/interface/Exceptions.h b/libsolidity/interface/Exceptions.h index 81716c41..6f38cba2 100644 --- a/libsolidity/interface/Exceptions.h +++ b/libsolidity/interface/Exceptions.h @@ -23,6 +23,7 @@ #pragma once #include <string> +#include <regex> #include <utility> #include <libdevcore/Exceptions.h> #include <libevmasm/SourceLocation.h> @@ -57,6 +58,14 @@ public: Type type() const { return m_type; } std::string const& typeName() const { return m_typeName; } + template <typename T> + bool regex_search(T&& _reg) const + { + if (std::string const* str = boost::get_error_info<errinfo_comment>(*this)) + return std::regex_search(*str, std::regex(std::forward<T>(_reg))); + else + return false; + } /// helper functions static Error const* containsErrorOfType(ErrorList const& _list, Error::Type _type) |