예제 #1
0
		protected LNode OnNewLine(LNode node)
		{
			return node.PlusAttrBefore(F.TriviaNewline);
		}
예제 #2
0
		public LNode Attr(LNode attr, LNode node)
		{
			return node.PlusAttrBefore(attr);
		}
예제 #3
0
		/// <summary>Adds a leading newline to the node if the first attribute isn't a newline.</summary>
		/// <remarks>By convention, in Loyc languages, top-level nodes and nodes within 
		/// braces have an implicit newline, such that a leading blank line appears
		/// if you add <see cref="CodeSymbols.TriviaNewline"/>. For all other nodes,
		/// this method just ensures there is a line break.</remarks>
		public LNode OnNewLine(LNode node)
		{
			if (node.Attrs[0, Missing_].IsIdNamed(S.TriviaNewline))
				return node;
			return node.PlusAttrBefore(TriviaNewline);
		}
예제 #4
0
 protected LNode OnNewLine(LNode node)
 {
     return(node.PlusAttrBefore(F.TriviaNewline));
 }