public static void RunFunction(string function, Token[] functionArguments) { string output = GetOutput(functionArguments); FunctionName result; Enum.TryParse(function, out result); if (result == FunctionName.PRINT) { Console.Write(output); } else if (result == FunctionName.PRINTN) { Console.WriteLine(output); } else if (result == FunctionName.UPDATE) { UpdateVariable(functionArguments); } else if (result == FunctionName.JUMPTO) { LinePointer.InsertJump(GetLineJumpNumber(functionArguments)); } else if (result == FunctionName.JUMPONCE) { LinePointer.InsertJumpOnce(GetLineJumpNumber(functionArguments)); } else if (result == FunctionName.RETURN) { ReturnPointer(functionArguments); } }
public void Jumpto(Token[] args) { int linenumber = GetLineJumpNumber(args); LinePointer.InsertJump(linenumber); }