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

◆ SkipMultiLineComment()

bool System.Text.Json.Utf8JsonReader.SkipMultiLineComment ( ReadOnlySpan< byte > localBuffer,
out int idx )
inlineprivate

Definition at line 1837 of file Utf8JsonReader.cs.

1838 {
1839 idx = 0;
1840 while (true)
1841 {
1842 int num = localBuffer.Slice(idx).IndexOf<byte>(47);
1843 switch (num)
1844 {
1845 case -1:
1846 if (IsLastSpan)
1847 {
1848 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.EndOfCommentNotFound, 0);
1849 }
1850 return false;
1851 default:
1852 if (localBuffer[num + idx - 1] == 42)
1853 {
1854 idx += num - 1;
1855 _consumed += 4 + idx;
1856 var (num2, num3) = JsonReaderHelper.CountNewLines(localBuffer.Slice(0, idx));
1857 _lineNumber += num2;
1858 if (num3 != -1)
1859 {
1861 }
1862 else
1863 {
1864 _bytePositionInLine += 4 + idx;
1865 }
1866 return true;
1867 }
1868 break;
1869 case 0:
1870 break;
1871 }
1872 idx += num + 1;
1873 }
1874 }

References System.Text.Json.Utf8JsonReader._bytePositionInLine, System.Text.Json.Utf8JsonReader._consumed, System.Text.Json.Utf8JsonReader._lineNumber, System.Text.Json.JsonReaderHelper.CountNewLines(), System.Text.Json.Dictionary, System.Text.Json.Utf8JsonReader.IsLastSpan, and System.Text.Json.ThrowHelper.ThrowJsonReaderException().

Referenced by System.Text.Json.Utf8JsonReader.ConsumeMultiLineComment(), and System.Text.Json.Utf8JsonReader.SkipComment().