Skip to content

Commit

Permalink
Refactor|libcore|Info: Don't throw exceptions when parsing values
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Aug 17, 2015
1 parent c1350c9 commit cf78770
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions doomsday/sdk/libcore/src/data/info.cpp
Expand Up @@ -332,23 +332,20 @@ DENG2_PIMPL(Info)
}

// Check if it is the beginning of a string literal.
// The value will be composed of any number of sub-strings.
if(peekToken() == "\"")
{
try
while(peekToken() == "\"")
{
// The value will be composed of any number of sub-strings.
forever { value.text += parseString(); }
}
catch(de::Error const &)
{
// No more strings to append.
return value;
value.text += parseString();
}
}

// Then it must be a single token.
value = peekToken();
nextToken();
else
{
// Then it must be a single token.
value = peekToken();
nextToken();
}
return value;
}

Expand Down

0 comments on commit cf78770

Please sign in to comment.