#1666 CommandFile: Add line numbers to parse messages

This commit is contained in:
Jacob Støren
2017-06-29 17:44:05 +02:00
parent 352e044bbf
commit 1de6986ba2
7 changed files with 100 additions and 22 deletions

View File

@@ -37,22 +37,21 @@ std::vector<RicfCommandObject*> RicfCommandFileReader::readCommands(QTextStream&
while ( !inputStream.atEnd() )
{
inputStream.skipWhiteSpace();
errorMessageContainer->skipWhiteSpaceWithLineNumberCount(inputStream);
// Read command name
QString commandName;
bool foundStartBracet = false;
{
inputStream.skipWhiteSpace();
errorMessageContainer->skipWhiteSpaceWithLineNumberCount(inputStream);
while ( !inputStream.atEnd() )
{
QChar currentChar;
inputStream >> currentChar;
currentChar = errorMessageContainer->readCharWithLineNumberCount(inputStream);
if ( currentChar.isSpace() )
{
inputStream.skipWhiteSpace();
errorMessageContainer->skipWhiteSpaceWithLineNumberCount(inputStream);
QChar isBracket('a');
inputStream >> isBracket;
isBracket = errorMessageContainer->readCharWithLineNumberCount(inputStream);
if ( isBracket != QChar('(') )
{
// Error, could not find start bracket for command
@@ -84,7 +83,7 @@ std::vector<RicfCommandObject*> RicfCommandFileReader::readCommands(QTextStream&
bool isOutsideQuotes = true;
while ( !inputStream.atEnd() )
{
inputStream >> currentChar;
currentChar = errorMessageContainer->readCharWithLineNumberCount(inputStream);
if ( isOutsideQuotes )
{
if ( currentChar == QChar(')') )
@@ -105,7 +104,7 @@ std::vector<RicfCommandObject*> RicfCommandFileReader::readCommands(QTextStream&
if ( currentChar == QChar('\\') )
{
inputStream >> currentChar;
currentChar = errorMessageContainer->readCharWithLineNumberCount(inputStream);
}
}
}