mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Improve Error Reporting of SemVer Parser
This commit is contained in:
@@ -25,17 +25,18 @@
|
||||
|
||||
#include <liblangutil/Token.h>
|
||||
#include <libsolutil/Assertions.h>
|
||||
#include <liblangutil/Exceptions.h>
|
||||
|
||||
#include <string>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace solidity::langutil
|
||||
{
|
||||
|
||||
class SemVerError: public util::Exception
|
||||
struct SemVerError: public util::Exception
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
#undef major
|
||||
@@ -87,8 +88,8 @@ class SemVerMatchExpressionParser
|
||||
public:
|
||||
SemVerMatchExpressionParser(std::vector<Token> _tokens, std::vector<std::string> _literals);
|
||||
|
||||
/// Returns an expression if it was parseable, or nothing otherwise.
|
||||
std::optional<SemVerMatchExpression> parse();
|
||||
/// Returns an expression if it was parsable, or throws a SemVerError otherwise.
|
||||
SemVerMatchExpression parse();
|
||||
|
||||
private:
|
||||
void reset();
|
||||
|
||||
Reference in New Issue
Block a user