Ejemplo n.º 1
0
        public string Print(LNode node, IMessageSink msgs = null, object mode = null, string indentString = "\t", string lineSeparator = "\n")
        {
            var sb = new StringBuilder();

            EcsNodePrinter.Printer(node, sb, msgs ?? MessageSink.Current, mode, indentString, lineSeparator);
            return(sb.ToString());
        }
Ejemplo n.º 2
0
 public void Print(LNode node, StringBuilder target, IMessageSink sink = null, ParsingMode mode = null, ILNodePrinterOptions options = null)
 {
     if (_usePlainCsPrinter)
     {
         EcsNodePrinter.PrintPlainCSharp(node, target, sink, mode, options);
     }
     else
     {
         EcsNodePrinter.PrintECSharp(node, target, sink, mode, options);
     }
 }
Ejemplo n.º 3
0
 protected override void StartToken(char nextCh)
 {
     if (_newlinePending)
     {
         Newline();
     }
     if ((EcsNodePrinter.IsIdentContChar(_lastCh) || _lastCh == '#') &&
         (EcsNodePrinter.IsIdentContChar(nextCh) || nextCh == '@'))
     {
         _out.Write(' ');
     }
     else if ((_lastCh == '#' && nextCh == '#') || (_lastCh == '+' && nextCh == '+') ||
              (_lastCh == '-' && nextCh == '-') ||
              (_lastCh == '.' && (nextCh == '.' || char.IsDigit(nextCh))) ||
              (_lastCh == '/' && nextCh == '*'))
     {
         _out.Write(' ');
     }
 }