public ICode Printout() { var code = new CodeSpan(Name); if (Parameters.Any()) { code.Append("<"); code.Append(Parameters, ","); code.Append(">"); } return(code); }
public override ICode Printout() { CodeSpan code = new CodeSpan(this, Name).Prepend(this.Modifier.HasReassignable ? "var " : "let "); if (this.TypeName != null) { code.Append(" of ").Append(this.TypeName); } if (this.InitValue != null) { code.Append(" " + (this.ReadMode == ExpressionReadMode.ReadRequired ? "<-" : "=") + " ").Append(this.InitValue); } if (this.ReadMode == ExpressionReadMode.ReadRequired) { code.Prepend("(").Append(")"); } return(code); }
public override ICode Printout() { var code = new CodeSpan("throw"); if (Expr != null) { code.Append(" ").Append(Expr.Printout()); } return(code); }
public ICode Printout() { var code = new CodeSpan(IsBreak ? "break" : "continue"); if (Label != null) { code.Append(" ").Append(Label); } return(code); }
public override ICode Printout() { var code = new CodeSpan($"new {(this.IsHeapInitialization ? "*" : "")}").Append(allocTypeName).Append("(") .Append(InitConstructorCall.UserArguments, ",") .Append(")"); if (this.objectInitialization.Any()) { code.Append("{").Append(this.objectInitialization, ",").Append("}"); } return(code); }
public ICode Printout() { string variadic_str = this.Variadic.ToString(); if (variadic_str != "") { variadic_str = " " + variadic_str; } var code = new CodeSpan(this.Name).Append(this.IsNameRequired ? ": " : " ").Append(this.ElementTypeName) .Append(variadic_str); if (this.IsOptional) { code.Append(" = ").Append(DefaultValue); } return(code); }