YAwn: Fix reading of empty values at EOF
@@ -67,7 +67,7 @@ namespace yawn
*/
bool Lexer::isValue (size_t const offset) const
{
- return (input.LA (offset) == ':') && (input.LA (offset + 1) == '\n' || input.LA (offset + 1) == ' ');
+ return (input.LA (offset) == ':') && (input.LA (offset + 1) == '\n' || input.LA (offset + 1) == ' ' || !input.LA (offset + 1));
}
/**
@@ -425,7 +425,7 @@ void Lexer::scanValue ()
ELEKTRA_LOG_DEBUG ("Scan value");
forward (1);
tokens.push_back (createToken (Token::VALUE, location, input.getText (input.index () - 1)));
- forward (1);
+ if (input.LA (1)) forward (1);
if (simpleKey.first == nullptr)
{
throw runtime_error ("Unable to locate key for value");
