mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Introduce TokenTraits::isYulKeyword helper
This commit is contained in:
parent
8402baa45b
commit
2ebc4bb9a7
@ -152,6 +152,11 @@ static Token keywordByName(string const& _name)
|
||||
return it == keywords.end() ? Token::Identifier : it->second;
|
||||
}
|
||||
|
||||
bool isYulKeyword(string const& _literal)
|
||||
{
|
||||
return _literal == "leave" || isYulKeyword(keywordByName(_literal));
|
||||
}
|
||||
|
||||
tuple<Token, unsigned int, unsigned int> fromIdentifierOrKeyword(string const& _literal)
|
||||
{
|
||||
auto positionM = find_if(_literal.begin(), _literal.end(), ::isdigit);
|
||||
|
@ -327,6 +327,8 @@ namespace TokenTraits
|
||||
tok == Token::TrueLiteral || tok == Token::FalseLiteral || tok == Token::HexStringLiteral || tok == Token::Hex;
|
||||
}
|
||||
|
||||
bool isYulKeyword(std::string const& _literal);
|
||||
|
||||
inline Token AssignmentToBinaryOp(Token op)
|
||||
{
|
||||
solAssert(isAssignmentOp(op) && op != Token::Assign, "");
|
||||
|
Loading…
Reference in New Issue
Block a user