예제 #1
0
 public static bool IsCharCorrectToAdd(this TextToTokenParserContext context, int i, int length, OperationContext.Context opContext)
 {
     if (context.HasDigitBefore)
     {
         return(false);
     }
     var(start, end) = (i, i + length - 1);
     if (start == 0 || start != 0 && !char.IsDigit(context.Text[start - 1]) ||
         end == context.Text.Length - 1 || end != context.Text.Length - 1 && !char.IsDigit(context.Text[end + 1]))
     {
         if (opContext == OperationContext.Context.ToOpen &&
             (end == context.Text.Length - 1 || context.Text[end + 1] != ' '))
         {
             return(true);
         }
         if (opContext == OperationContext.Context.ToClose &&
             (start == 0 || context.Text[start - 1] != ' '))
         {
             return(true);
         }
     }
     return(false);
 }
예제 #2
0
 public static void TryToAdd__Tag(this TextToTokenParserContext context, (int Index, string Value) tag)