Add support for here-string

This commit is contained in:
George Fleming
2016-02-23 15:10:32 -08:00
parent a494516c5d
commit e92c1e80cc
+22 -7
View File
@@ -177,6 +177,11 @@ OPTIONS
/// </summary>
private string partialLine = string.Empty;
/// <summary>
/// To keep track of here-strings
/// </summary>
private bool hereString = false;
/// <summary>
/// Gets or sets a value indicating whether the host application
/// should exit.
@@ -391,15 +396,24 @@ OPTIONS
catch (IncompleteParseException e)
{
incompleteLine = true;
cmd = cmd.Trim();
partialLine += cmd;
while (partialLine[partialLine.Length - 1] == '`')
{
Console.WriteLine("Trimming...");
partialLine = partialLine.Remove(partialLine.Length - 1);
}
partialLine += " ";
if (hereString || cmd.EndsWith("@\"") || cmd.EndsWith("@\'"))
{
hereString = true;
partialLine += System.Environment.NewLine;
}
else
{
while (partialLine[partialLine.Length - 1] == '`')
{
partialLine = partialLine.Remove(partialLine.Length - 1);
}
partialLine += " ";
}
}
finally
@@ -416,6 +430,7 @@ OPTIONS
if (!incompleteLine)
{
partialLine = string.Empty;
hereString = false;
}
}
}