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

◆ ScanBlank()

void System.Text.RegularExpressions.RegexParser.ScanBlank ( )
inlineprivate

Definition at line 887 of file RegexParser.cs.

888 {
889 if (UseOptionX())
890 {
891 while (true)
892 {
893 if (CharsRight() > 0 && IsSpace(RightChar()))
894 {
895 MoveRight();
896 continue;
897 }
898 if (CharsRight() == 0)
899 {
900 break;
901 }
902 if (RightChar() == '#')
903 {
904 while (CharsRight() > 0 && RightChar() != '\n')
905 {
906 MoveRight();
907 }
908 continue;
909 }
910 if (CharsRight() >= 3 && RightChar(2) == '#' && RightChar(1) == '?' && RightChar() == '(')
911 {
912 while (CharsRight() > 0 && RightChar() != ')')
913 {
914 MoveRight();
915 }
916 if (CharsRight() == 0)
917 {
918 throw MakeException(RegexParseError.UnterminatedComment, System.SR.UnterminatedComment);
919 }
920 MoveRight();
921 continue;
922 }
923 break;
924 }
925 return;
926 }
927 while (true)
928 {
929 if (CharsRight() < 3 || RightChar(2) != '#' || RightChar(1) != '?' || RightChar() != '(')
930 {
931 return;
932 }
933 while (CharsRight() > 0 && RightChar() != ')')
934 {
935 MoveRight();
936 }
937 if (CharsRight() == 0)
938 {
939 break;
940 }
941 MoveRight();
942 }
943 throw MakeException(RegexParseError.UnterminatedComment, System.SR.UnterminatedComment);
944 }
static string UnterminatedComment
Definition SR.cs:106
Definition SR.cs:7
RegexParseException MakeException(RegexParseError error, string message)

References System.Text.RegularExpressions.RegexParser.CharsRight(), System.Text.RegularExpressions.RegexParser.IsSpace(), System.Text.RegularExpressions.RegexParser.MakeException(), System.Text.RegularExpressions.RegexParser.MoveRight(), System.Text.RegularExpressions.RegexParser.RightChar(), System.SR.UnterminatedComment, and System.Text.RegularExpressions.RegexParser.UseOptionX().

Referenced by System.Text.RegularExpressions.RegexParser.CountCaptures(), and System.Text.RegularExpressions.RegexParser.ScanRegex().