public TrackingVariableWriter(GeneratedMethod method) { this._method = method; }
/// <summary> /// Writes a "return [variable.Usage];" code snippet . /// </summary> /// <param name="writer">Where to write to.</param> /// <param name="method">The method the return statement belongs to.</param> /// <param name="variable">The variable to return.</param> public static void Return(this ISourceWriter writer, GeneratedMethod method, Variable variable) { writer.WriteLine(method.AsyncMode == AsyncMode.AsyncTask ? $"return {variable.Usage};" : string.Format(_returnFromResult, variable.Usage)); }
public MethodSourceWriter(IMethodVariables variables, GeneratedMethod method, ISourceWriter inner) { this._variables = variables; this._method = method; this._inner = inner; }