patrick
/
plasp
Archived
1
0
Fork 0

Made the section skipping function a proper function.

This commit is contained in:
Patrick Lühne 2016-06-08 00:14:43 +02:00
parent 9360f4295a
commit ee9626e4d2
1 changed files with 15 additions and 16 deletions

View File

@ -16,27 +16,26 @@ namespace pddl
//
////////////////////////////////////////////////////////////////////////////////////////////////////
const auto skipSection =
[](utils::Parser &parser)
inline void skipSection(utils::Parser &parser)
{
size_t openParentheses = 1;
while (true)
{
size_t openParentheses = 1;
const auto character = parser.currentCharacter();
parser.advance();
while (true)
if (character == '(')
openParentheses++;
else if (character == ')')
{
const auto character = parser.currentCharacter();
parser.advance();
openParentheses--;
if (character == '(')
openParentheses++;
else if (character == ')')
{
openParentheses--;
if (openParentheses == 0)
return;
}
if (openParentheses == 0)
return;
}
};
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////