mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add scanner helpers to ParserBase
This commit is contained in:
parent
2fefe3b549
commit
3459052ae8
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <libsolidity/interface/Exceptions.h>
|
#include <libsolidity/interface/Exceptions.h>
|
||||||
|
#include <libsolidity/parsing/Scanner.h>
|
||||||
#include <libsolidity/parsing/Token.h>
|
#include <libsolidity/parsing/Token.h>
|
||||||
|
|
||||||
namespace dev
|
namespace dev
|
||||||
@ -46,11 +47,14 @@ protected:
|
|||||||
/// End position of the current token
|
/// End position of the current token
|
||||||
int endPosition() const;
|
int endPosition() const;
|
||||||
|
|
||||||
|
|
||||||
///@{
|
///@{
|
||||||
///@name Helper functions
|
///@name Helper functions
|
||||||
/// If current token value is not _value, throw exception otherwise advance token.
|
/// If current token value is not _value, throw exception otherwise advance token.
|
||||||
void expectToken(Token::Value _value);
|
void expectToken(Token::Value _value);
|
||||||
|
Token::Value currentToken() const { return m_scanner->currentToken(); }
|
||||||
|
Token::Value peekNextToken() const { return m_scanner->peekNextToken(); }
|
||||||
|
std::string currentLiteral() const { return m_scanner->currentLiteral(); }
|
||||||
|
Token::Value advance() { return m_scanner->next(); }
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
/// Creates a @ref ParserError and annotates it with the current position and the
|
/// Creates a @ref ParserError and annotates it with the current position and the
|
||||||
|
Loading…
Reference in New Issue
Block a user