From 3459052ae83ac08082855d41e21c297ac5f852b5 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 24 May 2017 23:03:15 +0100 Subject: [PATCH] Add scanner helpers to ParserBase --- libsolidity/parsing/ParserBase.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libsolidity/parsing/ParserBase.h b/libsolidity/parsing/ParserBase.h index 768b3bbfd..18b39a5e8 100644 --- a/libsolidity/parsing/ParserBase.h +++ b/libsolidity/parsing/ParserBase.h @@ -24,6 +24,7 @@ #include #include +#include #include namespace dev @@ -46,11 +47,14 @@ protected: /// End position of the current token int endPosition() const; - ///@{ ///@name Helper functions /// If current token value is not _value, throw exception otherwise advance token. 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