예제 #1
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(' ');
     }
 }
예제 #2
0
		void CheckIsComplexIdentifier(bool? result, LNode expr)
		{
			var np = new EcsNodePrinter(expr, null);
			_testNum++;
			var is1 = np.IsComplexIdentifier(expr);
			var is2 = np.IsComplexIdentifierOrNull(expr.Target);
			if (result == null && !is1 && is2)
				return;
			else if (result == is1 && result == is2)
				return;

			Assert.Fail(string.Format(
				"IsComplexIdentifier: fail on test #{0} '{1}'. Expected {2}, got {3}/{4}",
				_testNum, expr.ToString(), result, is1, is2));
		}