mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
WIP-3
This commit is contained in:
@@ -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; }
|
||||
|
||||
@@ -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) \
|
||||
|
||||
Reference in New Issue
Block a user