Add unit tests for IncludingStreamProxy

This commit is contained in:
Jan
2021-02-11 13:44:18 +01:00
parent e99e66cec5
commit 8b8f1d4f2a
4 changed files with 195 additions and 11 deletions

View File

@ -37,6 +37,13 @@ bool IncludingStreamProxy::ExtractIncludeFilename(const ParserLine& line, const
{
auto currentPos = includeDirectivePosition;
bool isDoubleQuotes;
while(isspace(line.m_line[currentPos]))
{
if(currentPos++ >= line.m_line.size())
throw ParsingException(TokenPos(line.m_filename, line.m_line_number, currentPos), INCLUDE_QUOTES_ERROR);
}
if (line.m_line[currentPos] == '"')
isDoubleQuotes = true;
else if (line.m_line[currentPos] == '<')