This commit is contained in:
Christian Parpart
2020-06-08 10:20:39 +02:00
parent 2130c446e2
commit 1966438472
6 changed files with 35 additions and 7 deletions
+9
View File
@@ -132,6 +132,15 @@ public:
return ElementaryTypeNameToken(m_tokens[Current].token, firstSize, secondSize);
}
/// Tests if current keyword is an identifier and matches the given value @p _name.
///
/// This is best used for directives that cannot be reserved as keywords but
/// in some context should be treated like one.
bool isIdentifier(std::string const& _name) const
{
return currentToken() == Token::Identifier && currentLiteral() == _name;
}
SourceLocation currentLocation() const { return m_tokens[Current].location; }
std::string const& currentLiteral() const { return m_tokens[Current].literal; }
std::tuple<unsigned, unsigned> const& currentTokenInfo() const { return m_tokens[Current].extendedTokenInfo; }
-1
View File
@@ -160,7 +160,6 @@ namespace solidity::langutil
K(External, "external", 0) \
K(Fallback, "fallback", 0) \
K(For, "for", 0) \
K(From, "from", 0) \
K(Function, "function", 0) \
K(Hex, "hex", 0) \
K(If, "if", 0) \