Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Preprocess()

static string System.Xml.Schema.FacetsChecker.FacetsCompiler.Preprocess ( string pattern)
inlinestaticprivate

Definition at line 502 of file FacetsChecker.cs.

503 {
505 stringBuilder.Append('^');
506 char[] array = pattern.ToCharArray();
507 int length = pattern.Length;
508 int num = 0;
509 for (int i = 0; i < length - 2; i++)
510 {
511 if (array[i] != '\\')
512 {
513 continue;
514 }
515 if (array[i + 1] == '\\')
516 {
517 i++;
518 continue;
519 }
520 char c = array[i + 1];
521 for (int j = 0; j < s_map.Length; j++)
522 {
523 if (s_map[j].match == c)
524 {
525 if (num < i)
526 {
527 stringBuilder.Append(array, num, i - num);
528 }
530 i++;
531 num = i + 1;
532 break;
533 }
534 }
535 }
536 if (num < length)
537 {
538 stringBuilder.Append(array, num, length - num);
539 }
540 stringBuilder.Append('$');
541 return stringBuilder.ToString();
542 }

References System.array, System.Xml.Dictionary, System.Text.RegularExpressions.i, System.length, System.match, System.Text.RegularExpressions.pattern, System.Text.RegularExpressions.replacement, and System.Xml.Schema.FacetsChecker.FacetsCompiler.s_map.

Referenced by System.Xml.Schema.FacetsChecker.FacetsCompiler.FinishFacetCompile().