Пример #1
0
 public void MoveNext() {
     current = current.After;
     if (current.AtEnd) {
         return;
     }
     if (current.StartsWith("\\")) {
         Type = CharacterType.Letter;
         current = current.Skip(1).Truncate(1);
     }
     else if (current.StartsWith("[\n")) {
         Type = CharacterType.BeginCell;
         current = current.Truncate(2);
     }
     else if (current.StartsWith("\n]")) {
         Type = CharacterType.EndCell;
         current = current.Truncate(2);
     }
     else if (current.StartsWith("\n")) {
         Type = CharacterType.Newline;
         current = current.Truncate(1);
     }
     else if (current.StartsWith("\"") || current.StartsWith("'")) {
         Type = CharacterType.Quote;
         current = current.Truncate(1);
     }
     else if (current.StartsWith("|")) {
         Type = CharacterType.Separator;
         current = current.Truncate(1);
     }
     else if (current.StartsWith(TextStoryTestBegin, StringComparison.OrdinalIgnoreCase)) {
         Type = CharacterType.BeginTest;
         current = current.Truncate(5);
     }
     else if (current.StartsWith("@test", StringComparison.OrdinalIgnoreCase)) {
         Type = CharacterType.EndTest;
         current = current.Truncate(5);
     }
     else if (char.IsWhiteSpace(current[0])) {
         Type = CharacterType.WhiteSpace;
         current = current.Truncate(1);
     }
     else if (current.StartsWith("<br", StringComparison.OrdinalIgnoreCase)
         && current.Contains(">")) {
         Type = CharacterType.Newline;
         current = current.TruncateAfter(">");
     }
     else {
         Type = CharacterType.Letter;
         current = current.Truncate(1);
     }
 }
 public void MoveNext()
 {
     current = current.After;
     if (current.AtEnd)
     {
         return;
     }
     if (current.StartsWith("\\"))
     {
         Type    = CharacterType.Letter;
         current = current.Skip(1).Truncate(1);
     }
     else if (current.StartsWith("[\n"))
     {
         Type    = CharacterType.BeginCell;
         current = current.Truncate(2);
     }
     else if (current.StartsWith("\n]"))
     {
         Type    = CharacterType.EndCell;
         current = current.Truncate(2);
     }
     else if (current.StartsWith("\n"))
     {
         Type    = CharacterType.Newline;
         current = current.Truncate(1);
     }
     else if (current.StartsWith("\"") || current.StartsWith("'"))
     {
         Type    = CharacterType.Quote;
         current = current.Truncate(1);
     }
     else if (current.StartsWith("|"))
     {
         Type    = CharacterType.Separator;
         current = current.Truncate(1);
     }
     else if (current.StartsWith(TextStoryTestBegin, StringComparison.OrdinalIgnoreCase))
     {
         Type    = CharacterType.BeginTest;
         current = current.Truncate(5);
     }
     else if (current.StartsWith("@test", StringComparison.OrdinalIgnoreCase))
     {
         Type    = CharacterType.EndTest;
         current = current.Truncate(5);
     }
     else if (char.IsWhiteSpace(current[0]))
     {
         Type    = CharacterType.WhiteSpace;
         current = current.Truncate(1);
     }
     else if (current.StartsWith("<br", StringComparison.OrdinalIgnoreCase) &&
              current.Contains(">"))
     {
         Type    = CharacterType.Newline;
         current = current.TruncateAfter(">");
     }
     else
     {
         Type    = CharacterType.Letter;
         current = current.Truncate(1);
     }
 }