mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
test: check the error texts
by changing parseAnalyseAndReturnError to return the whole Error, not just the type
This commit is contained in:
parent
a7c2509adf
commit
ab3db782ae
@ -23,6 +23,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <regex>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <libdevcore/Exceptions.h>
|
#include <libdevcore/Exceptions.h>
|
||||||
#include <libevmasm/SourceLocation.h>
|
#include <libevmasm/SourceLocation.h>
|
||||||
@ -57,6 +58,14 @@ public:
|
|||||||
|
|
||||||
Type type() const { return m_type; }
|
Type type() const { return m_type; }
|
||||||
std::string const& typeName() const { return m_typeName; }
|
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
|
/// helper functions
|
||||||
static Error const* containsErrorOfType(ErrorList const& _list, Error::Type _type)
|
static Error const* containsErrorOfType(ErrorList const& _list, Error::Type _type)
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user