Fixed whitespace issue in typing sections and added test cases.

This commit is contained in:
2017-06-18 05:18:52 +02:00
parent 6ce4eecb18
commit 230844c3ae
6 changed files with 59 additions and 3 deletions

View File

@@ -214,7 +214,12 @@ std::string Tokenizer<TokenizerPolicy>::getIdentifier()
const auto character = currentCharacter();
if (!TokenizerPolicy::isIdentifierCharacter(character))
{
if (value.empty())
throw TokenizerException(location(), "could not parse identifier");
return value;
}
value.push_back(character);
advance();