Instruction AnalyseReturn(Tokenizer.Token[] Tokens, int index, out int tokenCount) { InstructionReturn instructionReturn = new InstructionReturn(); int tokenCount_rightValue = 0; Tokenizer.Token[] instructionTokens = GetTokensTo(Tokens, index + 1, (t) => t.TokenName == Tokenizer.TokenName.LineEnd); instructionReturn.ValueInstruction = AnalyseInstruction(instructionTokens, 0, out tokenCount_rightValue); tokenCount = 2 + instructionTokens.Length; return(instructionReturn); }
InstructionResult ExecuteInstructionReturn(Instruction instruction) { InstructionReturn instructionVariableValue = instruction as InstructionReturn; Value value = null; if (instructionVariableValue.ValueInstruction != null) { value = ExecuteInstruction(instructionVariableValue.ValueInstruction).Value; } return(new InstructionResult() { Value = value, Return = true }); }