mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Use version string (including prerelease) for pragma matching.
This commit is contained in:
parent
3c412ed2f6
commit
d87450b9b2
@ -75,12 +75,13 @@ bool SyntaxChecker::visit(PragmaDirective const& _pragma)
|
|||||||
vector<string> literals(_pragma.literals().begin() + 1, _pragma.literals().end());
|
vector<string> literals(_pragma.literals().begin() + 1, _pragma.literals().end());
|
||||||
SemVerMatchExpressionParser parser(tokens, literals);
|
SemVerMatchExpressionParser parser(tokens, literals);
|
||||||
auto matchExpression = parser.parse();
|
auto matchExpression = parser.parse();
|
||||||
SemVerVersion currentVersion{string(VersionNumber)};
|
SemVerVersion currentVersion{string(VersionString)};
|
||||||
if (!matchExpression.matches(currentVersion))
|
if (!matchExpression.matches(currentVersion))
|
||||||
syntaxError(
|
syntaxError(
|
||||||
_pragma.location(),
|
_pragma.location(),
|
||||||
"Source file requires different compiler version (current compiler is " +
|
"Source file requires different compiler version (current compiler is " +
|
||||||
string(VersionNumber) + ")."
|
string(VersionString) + " - note that nightly builds are considered to be "
|
||||||
|
"strictly less than the released version"
|
||||||
);
|
);
|
||||||
m_versionPragmaFound = true;
|
m_versionPragmaFound = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user