diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2016-11-22 18:07:23 +0800 |
---|---|---|
committer | Yoichi Hirai <i@yoichihirai.com> | 2016-11-24 00:38:41 +0800 |
commit | 2faaddca05549ecf3e716ec83faeffde6e8d4c2f (patch) | |
tree | 349820685dc3caa7301a28e5e12d520cf59b3596 /libsolidity/interface | |
parent | cace51fc470f2ff75e52637e10aa5100f3ca5be6 (diff) | |
download | dexon-solidity-2faaddca05549ecf3e716ec83faeffde6e8d4c2f.tar dexon-solidity-2faaddca05549ecf3e716ec83faeffde6e8d4c2f.tar.gz dexon-solidity-2faaddca05549ecf3e716ec83faeffde6e8d4c2f.tar.bz2 dexon-solidity-2faaddca05549ecf3e716ec83faeffde6e8d4c2f.tar.lz dexon-solidity-2faaddca05549ecf3e716ec83faeffde6e8d4c2f.tar.xz dexon-solidity-2faaddca05549ecf3e716ec83faeffde6e8d4c2f.tar.zst dexon-solidity-2faaddca05549ecf3e716ec83faeffde6e8d4c2f.zip |
interface: fix the substring search
Diffstat (limited to 'libsolidity/interface')
-rw-r--r-- | libsolidity/interface/Exceptions.cpp | 7 | ||||
-rw-r--r-- | libsolidity/interface/Exceptions.h | 9 |
2 files changed, 8 insertions, 8 deletions
diff --git a/libsolidity/interface/Exceptions.cpp b/libsolidity/interface/Exceptions.cpp index 90a680b4..f4ce8bc8 100644 --- a/libsolidity/interface/Exceptions.cpp +++ b/libsolidity/interface/Exceptions.cpp @@ -56,3 +56,10 @@ Error::Error(Type _type): m_type(_type) break; } } + +bool Error::searchForSubstring(const std::string& _substr) const +{ + if (const std::string* str = boost::get_error_info<errinfo_comment>(*this)) + return str->find(_substr) != std::string::npos; + return _substr.empty(); +} diff --git a/libsolidity/interface/Exceptions.h b/libsolidity/interface/Exceptions.h index 78eb88aa..a9769944 100644 --- a/libsolidity/interface/Exceptions.h +++ b/libsolidity/interface/Exceptions.h @@ -23,7 +23,6 @@ #pragma once #include <string> -#include <regex> #include <utility> #include <libdevcore/Exceptions.h> #include <libevmasm/SourceLocation.h> @@ -58,13 +57,7 @@ public: Type type() const { return m_type; } std::string const& typeName() const { return m_typeName; } - bool regex_search(const std::string& _reg) const - { - if (std::string const* str = boost::get_error_info<errinfo_comment>(*this)) - return std::regex_search(*str, std::regex(_reg)); - else - return false; - } + bool searchForSubstring(const std::string& _substr) const; /// helper functions static Error const* containsErrorOfType(ErrorList const& _list, Error::Type _type) |