if (endPosition == startPosition + 1 && isWhitespace) //Has no text yet, and is another whitespace
{
startPosition = endPosition;
continue;
continue;
}
switch (currentPart)
{
{
case ParserPart.None:
if ((!isEscaped && currentChar == '\"'))
{
currentPart = ParserPart.DoubleQuotedParameter;
startPosition = endPosition;
if (isDoubleQuoted) //Already marked as double quoted -> reached the end of the quote/argument
{
string temp = input.Substring(startPosition + 1, endPosition - startPosition - 2); //-2 to ignore the last double quote
argList.Add(temp);
currentPart = ParserPart.None;
startPosition = endPosition;
isDoubleQuoted = false;
}
else
currentPart = ParserPart.DoubleQuotedParameter;
}
else if ((!isEscaped && currentChar == '\''))
{
currentPart = ParserPart.QuotedParameter;
startPosition = endPosition;
}
else if ((!isEscaped && isWhitespace) || endPosition >= inputLength)
{
else if ((!isEscaped && isWhitespace && !isDoubleQuoted) || endPosition >= inputLength) //Reached a whitespace in a non double quoted argument or the end of the input