Swapped order of printwords and printwordcount, (Closes #8)
Some checks failed
continuous-integration/appveyor/branch AppVeyor build failed
Some checks failed
continuous-integration/appveyor/branch AppVeyor build failed
This commit is contained in:
parent
8774264207
commit
0fd02dd9ac
@ -87,10 +87,10 @@ namespace Assignment_1
|
|||||||
Environment.Exit(0);
|
Environment.Exit(0);
|
||||||
}
|
}
|
||||||
ConsoleKeyInfo ck = new();
|
ConsoleKeyInfo ck = new();
|
||||||
while (ck.Key != ConsoleKey.Y || ck.Key != ConsoleKey.N)
|
while (ck.Key != ConsoleKey.Y && ck.Key != ConsoleKey.N)
|
||||||
{
|
{
|
||||||
Console.WriteLine("\nWould you like to parse more programs? Y/n:");
|
Console.WriteLine("\nWould you like to parse another program? Y/n:");
|
||||||
ck = Console.ReadKey();
|
ck = Console.ReadKey(true);
|
||||||
}
|
}
|
||||||
if (ck.Key == ConsoleKey.N)
|
if (ck.Key == ConsoleKey.N)
|
||||||
{
|
{
|
||||||
@ -100,10 +100,10 @@ namespace Assignment_1
|
|||||||
{
|
{
|
||||||
// Need the logic to prep the next source stream
|
// Need the logic to prep the next source stream
|
||||||
ck = new();
|
ck = new();
|
||||||
while (ck.Key != ConsoleKey.Y || ck.Key != ConsoleKey.N)
|
while (ck.Key != ConsoleKey.Y && ck.Key != ConsoleKey.N)
|
||||||
{
|
{
|
||||||
Console.WriteLine("\nWould you like to pipe data from source file? Y/n:");
|
Console.WriteLine("\nWould you like to pipe data from source file? Y/n:");
|
||||||
ck = Console.ReadKey();
|
ck = Console.ReadKey(true);
|
||||||
}
|
}
|
||||||
if (ck.Key == ConsoleKey.N)
|
if (ck.Key == ConsoleKey.N)
|
||||||
{
|
{
|
||||||
@ -127,8 +127,6 @@ namespace Assignment_1
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// GC already done, just loop back to program start
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,7 +207,7 @@ namespace Assignment_1
|
|||||||
switch ((Statements)statementType)
|
switch ((Statements)statementType)
|
||||||
{
|
{
|
||||||
case Statements.exit:
|
case Statements.exit:
|
||||||
result = Exit(source, initSourceLength);
|
result = Exit(source, initSourceLength, dynamicInput);
|
||||||
break;
|
break;
|
||||||
case Statements.append:
|
case Statements.append:
|
||||||
result = AppendSet(source);
|
result = AppendSet(source);
|
||||||
@ -232,10 +230,10 @@ namespace Assignment_1
|
|||||||
case Statements.printlength:
|
case Statements.printlength:
|
||||||
result = Print(source, 1);
|
result = Print(source, 1);
|
||||||
break;
|
break;
|
||||||
case Statements.printwordcount:
|
case Statements.printwords:
|
||||||
result = Print(source, 2);
|
result = Print(source, 2);
|
||||||
break;
|
break;
|
||||||
case Statements.printwords:
|
case Statements.printwordcount:
|
||||||
result = Print(source, 3);
|
result = Print(source, 3);
|
||||||
break;
|
break;
|
||||||
case Statements.set:
|
case Statements.set:
|
||||||
@ -445,11 +443,11 @@ namespace Assignment_1
|
|||||||
|
|
||||||
return () => Console.WriteLine(consoleOutput.ToString());
|
return () => Console.WriteLine(consoleOutput.ToString());
|
||||||
}
|
}
|
||||||
Action Exit(Stream source, long initialStreamLength)
|
Action Exit(Stream source, long initialStreamLength, bool isDynamicInput=false)
|
||||||
{
|
{
|
||||||
Action exitAction = () =>
|
Action exitAction = () =>
|
||||||
{
|
{
|
||||||
if (source.Length != initialStreamLength)
|
if (source.Length != initialStreamLength && isDynamicInput)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Commands list has been modified; would you like to save it to a file?");
|
Console.WriteLine("Commands list has been modified; would you like to save it to a file?");
|
||||||
string commandState = "";
|
string commandState = "";
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"newProfile1": {
|
"newProfile1": {
|
||||||
"commandName": "Executable",
|
"commandName": "Executable",
|
||||||
"executablePath": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
|
"executablePath": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
|
||||||
"commandLineArgs": "-command \"& type .\\outtest.txt | & '.\\Assignment 1.exe'\""
|
"commandLineArgs": "-command \"& type .\\ExampleOutput.txt | & '.\\Assignment 1.exe'\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user