Fixed parsing issue with unexpected whitespaces in SAS files.
This commit is contained in:
@@ -27,6 +27,11 @@ class PDDLParserPolicy
|
||||
return std::iswspace(c);
|
||||
}
|
||||
|
||||
static bool isBlankCharacter(char c)
|
||||
{
|
||||
return std::isblank(c);
|
||||
}
|
||||
|
||||
static bool isIdentifierCharacter(char c)
|
||||
{
|
||||
return c != '?'
|
||||
|
@@ -72,6 +72,7 @@ class Parser: public Stream, public ParserPolicy
|
||||
std::string parseLine();
|
||||
|
||||
void skipWhiteSpace();
|
||||
void skipBlankSpace();
|
||||
void skipLine();
|
||||
|
||||
private:
|
||||
@@ -124,6 +125,17 @@ void Parser<ParserPolicy>::skipWhiteSpace()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<class ParserPolicy>
|
||||
void Parser<ParserPolicy>::skipBlankSpace()
|
||||
{
|
||||
check();
|
||||
|
||||
while (!atEnd() && ParserPolicy::isBlankCharacter(currentCharacter()))
|
||||
advance();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<class ParserPolicy>
|
||||
void Parser<ParserPolicy>::skipLine()
|
||||
{
|
||||
|
@@ -27,6 +27,11 @@ class CaseSensitiveParserPolicy
|
||||
return std::iswspace(c);
|
||||
}
|
||||
|
||||
static bool isBlankCharacter(char c)
|
||||
{
|
||||
return std::isblank(c);
|
||||
}
|
||||
|
||||
static bool isIdentifierCharacter(char c)
|
||||
{
|
||||
return std::isgraph(c);
|
||||
@@ -48,6 +53,11 @@ class CaseInsensitiveParserPolicy
|
||||
return std::iswspace(c);
|
||||
}
|
||||
|
||||
static bool isBlankCharacter(char c)
|
||||
{
|
||||
return std::isblank(c);
|
||||
}
|
||||
|
||||
static bool isIdentifierCharacter(char c)
|
||||
{
|
||||
return std::isgraph(c);
|
||||
|
Reference in New Issue
Block a user