Loyc.Syntax.LNodePrinter.PrintMultiple C# (CSharp) Method

PrintMultiple() public static method

Converts a sequences of LNodes to strings, adding a line separator between each.
The newline between two nodes is suppressed if the second node has a #trivia_appendStatement attribute.
public static PrintMultiple ( ILNodePrinter printer, IEnumerable nodes, StringBuilder sb, IMessageSink sink, ParsingMode mode, ILNodePrinterOptions options ) : StringBuilder
printer ILNodePrinter Printer to be used for each single LNode.
nodes IEnumerable
sb StringBuilder
sink IMessageSink
mode ParsingMode
options ILNodePrinterOptions
return StringBuilder
		public static StringBuilder PrintMultiple(ILNodePrinter printer, IEnumerable<LNode> nodes, StringBuilder sb, IMessageSink sink, ParsingMode mode, ILNodePrinterOptions options)
		{
			sb = sb ?? new StringBuilder();
			var lineSeparator = (options != null ? options.NewlineString : null) ?? "\n";
			bool first = true;
			foreach (LNode node in nodes) {
				if (!first)
					sb.Append(node.AttrNamed(CodeSymbols.TriviaAppendStatement) == null ? lineSeparator : " ");
				printer.Print(node, sb, sink, mode, options);
				first = false;
			}
			return sb;
		}
	}