mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Mark the empty version pragma as invalid
This commit is contained in:
@@ -151,6 +151,9 @@ optional<SemVerMatchExpression> SemVerMatchExpressionParser::parse()
|
||||
{
|
||||
reset();
|
||||
|
||||
if (m_tokens.empty())
|
||||
return nullopt;
|
||||
|
||||
try
|
||||
{
|
||||
while (true)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <liblangutil/Token.h>
|
||||
#include <libsolutil/Assertions.h>
|
||||
|
||||
#include <string>
|
||||
#include <optional>
|
||||
@@ -84,9 +85,11 @@ struct SemVerMatchExpression
|
||||
class SemVerMatchExpressionParser
|
||||
{
|
||||
public:
|
||||
SemVerMatchExpressionParser(std::vector<Token> _tokens, std::vector<std::string> _literals):
|
||||
SemVerMatchExpressionParser(std::vector<Token> _tokens, std::vector<std::string> _literals):
|
||||
m_tokens(std::move(_tokens)), m_literals(std::move(_literals))
|
||||
{}
|
||||
{
|
||||
solAssert(m_tokens.size() == m_literals.size(), "");
|
||||
}
|
||||
|
||||
/// Returns an expression if it was parseable, or nothing otherwise.
|
||||
std::optional<SemVerMatchExpression> parse();
|
||||
|
||||
Reference in New Issue
Block a user