Multiline and nested ifs now possible

This commit is contained in:
Lukasz Baldyga committed 2020-11-30 21:04:33 +00:00
1 parent affc6d6e53
commit 97fb3a04ca
1 file changed
+8
@@ -252,6 +252,14 @@ namespace Advanced_Software_Engineering {
} else throw new Exception(command + " has an incorrect number of parameters");
break;
//exit flow
case "end":
if (parameterLength == 0) {
if (currentChunk == null) throw new Exception("Cannot end at chunk level 0"); //Todo, describe better
verbChunks.Remove(currentChunk);
return currentChunk;
} else throw new Exception(command + " doesn't take parameters");
default:
throw new Exception("Unknown command or cannot parse");
}