Added missing method implementation to tokenizer.
This commit is contained in:
parent
f349b5e351
commit
8288345bcb
@ -61,8 +61,8 @@ class Tokenizer: public Stream, public TokenizerPolicy
|
|||||||
|
|
||||||
// TODO: refactor
|
// TODO: refactor
|
||||||
std::string getIdentifier();
|
std::string getIdentifier();
|
||||||
bool testIdentifierAndReturn(const std::string &identifier);
|
|
||||||
bool testIdentifierAndSkip(const std::string &identifier);
|
bool testIdentifierAndSkip(const std::string &identifier);
|
||||||
|
bool testIdentifierAndReturn(const std::string &identifier);
|
||||||
|
|
||||||
// TODO: remove
|
// TODO: remove
|
||||||
bool probeNumber();
|
bool probeNumber();
|
||||||
@ -223,6 +223,20 @@ std::string Tokenizer<TokenizerPolicy>::getIdentifier()
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
template<class TokenizerPolicy>
|
||||||
|
bool Tokenizer<TokenizerPolicy>::testIdentifierAndReturn(const std::string &expectedValue)
|
||||||
|
{
|
||||||
|
const auto previousPosition = position();
|
||||||
|
|
||||||
|
const auto result = testIdentifierAndSkip(expectedValue);
|
||||||
|
|
||||||
|
seek(previousPosition);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
template<class TokenizerPolicy>
|
template<class TokenizerPolicy>
|
||||||
bool Tokenizer<TokenizerPolicy>::testIdentifierAndSkip(const std::string &expectedValue)
|
bool Tokenizer<TokenizerPolicy>::testIdentifierAndSkip(const std::string &expectedValue)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user