Added efficient probing functions to Parser.

This commit is contained in:
2016-06-08 00:02:40 +02:00
parent 78889e18c6
commit 69ff84eecc
5 changed files with 119 additions and 95 deletions

View File

@@ -53,7 +53,6 @@ class Parser
char currentCharacter() const;
void advance();
bool advanceIf(char expectedCharacter);
bool atEndOfStream() const;
template<typename Type>
@@ -65,6 +64,9 @@ class Parser
template<class CharacterPredicate>
std::string parseIdentifier(CharacterPredicate characterPredicate);
template<typename Type>
bool probe(const Type &expectedValue);
template<typename Type>
void expect(const Type &expectedValue);