patrick
/
plasp
Archived
1
0
Fork 0

Minor refactoring.

This commit is contained in:
Patrick Lühne 2016-08-03 00:33:20 +02:00
parent d7b47797df
commit 015c34fc2b
3 changed files with 7 additions and 7 deletions

View File

@ -22,7 +22,7 @@ class PDDLParserPolicy
return std::tolower(c); return std::tolower(c);
} }
static bool isWhiteSpace(char c) static bool isWhiteSpaceCharacter(char c)
{ {
return std::iswspace(c); return std::iswspace(c);
} }

View File

@ -119,7 +119,7 @@ void Parser<ParserPolicy>::skipWhiteSpace()
{ {
check(); check();
while (!atEnd() && ParserPolicy::isWhiteSpace(currentCharacter())) while (!atEnd() && ParserPolicy::isWhiteSpaceCharacter(currentCharacter()))
advance(); advance();
} }
@ -229,7 +229,7 @@ bool Parser<ParserPolicy>::probeNumber()
skipWhiteSpace(); skipWhiteSpace();
while (!ParserPolicy::isWhiteSpace(currentCharacter())) while (!ParserPolicy::isWhiteSpaceCharacter(currentCharacter()))
if (!std::isdigit(currentCharacter())) if (!std::isdigit(currentCharacter()))
{ {
seek(previousPosition); seek(previousPosition);
@ -351,7 +351,7 @@ std::string Parser<ParserPolicy>::parseImpl(Tag<std::string>)
const auto startPosition = position(); const auto startPosition = position();
while (!ParserPolicy::isWhiteSpace(currentCharacter())) while (!ParserPolicy::isWhiteSpaceCharacter(currentCharacter()))
advance(); advance();
const auto endPosition = position(); const auto endPosition = position();
@ -475,7 +475,7 @@ bool Parser<ParserPolicy>::parseImpl(Tag<bool>)
template<class ParserPolicy> template<class ParserPolicy>
bool Parser<ParserPolicy>::testImpl(const std::string &expectedValue) bool Parser<ParserPolicy>::testImpl(const std::string &expectedValue)
{ {
if (!ParserPolicy::isWhiteSpace(expectedValue.front())) if (!ParserPolicy::isWhiteSpaceCharacter(expectedValue.front()))
skipWhiteSpace(); skipWhiteSpace();
const auto match = std::find_if(expectedValue.cbegin(), expectedValue.cend(), const auto match = std::find_if(expectedValue.cbegin(), expectedValue.cend(),

View File

@ -22,7 +22,7 @@ class CaseSensitiveParserPolicy
return c; return c;
} }
static bool isWhiteSpace(char c) static bool isWhiteSpaceCharacter(char c)
{ {
return std::iswspace(c); return std::iswspace(c);
} }
@ -43,7 +43,7 @@ class CaseInsensitiveParserPolicy
return std::tolower(c); return std::tolower(c);
} }
static bool isWhiteSpace(char c) static bool isWhiteSpaceCharacter(char c)
{ {
return std::iswspace(c); return std::iswspace(c);
} }