mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #2444 from ethereum/parser-scanner
Avoid including Scanner.h in ParserBase.h
This commit is contained in:
commit
f9144ae5a4
@ -26,6 +26,7 @@
|
|||||||
#include <libsolidity/codegen/Compiler.h>
|
#include <libsolidity/codegen/Compiler.h>
|
||||||
#include <libsolidity/interface/Version.h>
|
#include <libsolidity/interface/Version.h>
|
||||||
#include <libsolidity/interface/ErrorReporter.h>
|
#include <libsolidity/interface/ErrorReporter.h>
|
||||||
|
#include <libsolidity/parsing/Scanner.h>
|
||||||
#include <libsolidity/inlineasm/AsmParser.h>
|
#include <libsolidity/inlineasm/AsmParser.h>
|
||||||
#include <libsolidity/inlineasm/AsmCodeGen.h>
|
#include <libsolidity/inlineasm/AsmCodeGen.h>
|
||||||
#include <libsolidity/inlineasm/AsmAnalysis.h>
|
#include <libsolidity/inlineasm/AsmAnalysis.h>
|
||||||
|
@ -43,6 +43,26 @@ int ParserBase::endPosition() const
|
|||||||
return m_scanner->currentLocation().end;
|
return m_scanner->currentLocation().end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Token::Value ParserBase::currentToken() const
|
||||||
|
{
|
||||||
|
return m_scanner->currentToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
Token::Value ParserBase::peekNextToken() const
|
||||||
|
{
|
||||||
|
return m_scanner->peekNextToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string ParserBase::currentLiteral() const
|
||||||
|
{
|
||||||
|
return m_scanner->currentLiteral();
|
||||||
|
}
|
||||||
|
|
||||||
|
Token::Value ParserBase::advance()
|
||||||
|
{
|
||||||
|
return m_scanner->next();
|
||||||
|
}
|
||||||
|
|
||||||
void ParserBase::expectToken(Token::Value _value)
|
void ParserBase::expectToken(Token::Value _value)
|
||||||
{
|
{
|
||||||
Token::Value tok = m_scanner->currentToken();
|
Token::Value tok = m_scanner->currentToken();
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <libsolidity/parsing/Scanner.h>
|
|
||||||
#include <libsolidity/parsing/Token.h>
|
#include <libsolidity/parsing/Token.h>
|
||||||
|
|
||||||
namespace dev
|
namespace dev
|
||||||
@ -51,10 +50,10 @@ protected:
|
|||||||
///@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 currentToken() const;
|
||||||
Token::Value peekNextToken() const { return m_scanner->peekNextToken(); }
|
Token::Value peekNextToken() const;
|
||||||
std::string currentLiteral() const { return m_scanner->currentLiteral(); }
|
std::string currentLiteral() const;
|
||||||
Token::Value advance() { return m_scanner->next(); }
|
Token::Value advance();
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
/// 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