diff --git a/include/plasp/utils/Parser.h b/include/plasp/utils/Parser.h index e76b675..ae30750 100644 --- a/include/plasp/utils/Parser.h +++ b/include/plasp/utils/Parser.h @@ -17,6 +17,9 @@ namespace utils class Parser { + public: + using CharacterType = unsigned char; + public: explicit Parser(std::istream &istream); @@ -35,18 +38,18 @@ class Parser std::string getLine(); private: - static const std::istream_iterator EndOfFile; + static const std::istream_iterator EndOfFile; private: void checkStream() const; void advance(); - bool advanceIf(unsigned char expectedCharacter); + bool advanceIf(CharacterType expectedCharacter); uint64_t parseIntegerBody(); std::istream &m_istream; - std::istream_iterator m_position; + std::istream_iterator m_position; size_t m_row; size_t m_column; diff --git a/src/plasp/utils/Parser.cpp b/src/plasp/utils/Parser.cpp index 13be87a..b3df864 100644 --- a/src/plasp/utils/Parser.cpp +++ b/src/plasp/utils/Parser.cpp @@ -17,7 +17,7 @@ namespace utils // //////////////////////////////////////////////////////////////////////////////////////////////////// -const std::istream_iterator Parser::EndOfFile = std::istream_iterator(); +const std::istream_iterator Parser::EndOfFile = std::istream_iterator(); //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -84,7 +84,7 @@ void Parser::advance() //////////////////////////////////////////////////////////////////////////////////////////////////// -bool Parser::advanceIf(unsigned char expectedCharacter) +bool Parser::advanceIf(CharacterType expectedCharacter) { checkStream(); @@ -198,7 +198,7 @@ uint64_t Parser::parseIntegerBody() uint64_t value = 0; - while (m_position != std::istream_iterator()) + while (m_position != std::istream_iterator()) { const auto character = *m_position;