private void WriteVariant(TextWriter writer, Variant variant) { PascalSyntax.WriteList(writer, ",", variant.TagValues); writer.Write(" : ("); PascalSyntax.WriteList(writer, ";", variant.Fields, Record.WriteField); writer.Write(")"); }
public void Write(TextWriter writer) { writer.Write("case "); if (VariantTag != null) { writer.Write(VariantTag); writer.Write(" :"); } TagType.Write(writer); writer.Write(" of "); PascalSyntax.WriteList(writer, "; ", Variants, WriteVariant); }
public static void Write(TextWriter writer, ParameterDeclaration decl) { if (decl.ByReference) { writer.Write("var"); writer.Write(" "); } PascalSyntax.WriteList(writer, ", ", decl.ParameterNames, (w, s) => w.Write(s)); writer.Write(" : "); if (decl.Type == null) { writer.Write("(NULL)"); } else { decl.Type.Write(writer); } }