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

◆ ConsumeNextTokenUntilAfterAllCommentsAreSkippedMultiSegment()

ConsumeTokenResult System.Text.Json.Utf8JsonReader.ConsumeNextTokenUntilAfterAllCommentsAreSkippedMultiSegment ( byte marker)
inlineprivate

Definition at line 3552 of file Utf8JsonReader.cs.

3553 {
3555 {
3557 if (_tokenType == JsonTokenType.StartObject)
3558 {
3559 if (marker == 125)
3560 {
3561 EndObject();
3562 }
3563 else
3564 {
3565 if (marker != 34)
3566 {
3567 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyNotFound, marker);
3568 }
3570 int consumed = _consumed;
3572 long lineNumber = _lineNumber;
3573 SequencePosition currentPosition = _currentPosition;
3575 {
3577 _tokenType = JsonTokenType.StartObject;
3579 _lineNumber = lineNumber;
3582 goto IL_02e7;
3583 }
3584 }
3585 }
3586 else if (_tokenType == JsonTokenType.StartArray)
3587 {
3588 if (marker == 93)
3589 {
3590 EndArray();
3591 }
3593 {
3594 goto IL_02e7;
3595 }
3596 }
3597 else if (_tokenType == JsonTokenType.PropertyName)
3598 {
3600 {
3601 goto IL_02e7;
3602 }
3603 }
3604 else if (_bitStack.CurrentDepth == 0)
3605 {
3606 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedEndAfterSingleJson, marker);
3607 }
3608 else
3609 {
3610 switch (marker)
3611 {
3612 case 44:
3613 _consumed++;
3615 if (_consumed >= (uint)_buffer.Length)
3616 {
3617 if (IsLastSpan)
3618 {
3619 _consumed--;
3621 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyOrValueNotFound, 0);
3622 }
3623 if (!GetNextSpan())
3624 {
3625 if (IsLastSpan)
3626 {
3627 _consumed--;
3629 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyOrValueNotFound, 0);
3630 }
3631 return ConsumeTokenResult.NotEnoughDataRollBackState;
3632 }
3633 }
3635 if (marker <= 32)
3636 {
3638 if (!HasMoreDataMultiSegment(ExceptionResource.ExpectedStartOfPropertyOrValueNotFound))
3639 {
3640 return ConsumeTokenResult.NotEnoughDataRollBackState;
3641 }
3643 }
3644 if (SkipAllCommentsMultiSegment(ref marker, ExceptionResource.ExpectedStartOfPropertyOrValueNotFound))
3645 {
3647 if (_inObject)
3648 {
3649 if (marker != 34)
3650 {
3651 if (marker == 125)
3652 {
3654 {
3655 EndObject();
3656 break;
3657 }
3658 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.TrailingCommaNotAllowedBeforeObjectEnd, 0);
3659 }
3660 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfPropertyNotFound, marker);
3661 }
3663 {
3664 return ConsumeTokenResult.NotEnoughDataRollBackState;
3665 }
3666 return ConsumeTokenResult.Success;
3667 }
3668 if (marker == 93)
3669 {
3671 {
3672 EndArray();
3673 break;
3674 }
3675 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.TrailingCommaNotAllowedBeforeArrayEnd, 0);
3676 }
3678 {
3679 return ConsumeTokenResult.NotEnoughDataRollBackState;
3680 }
3681 return ConsumeTokenResult.Success;
3682 }
3683 return ConsumeTokenResult.NotEnoughDataRollBackState;
3684 case 125:
3685 EndObject();
3686 break;
3687 case 93:
3688 EndArray();
3689 break;
3690 default:
3691 ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.FoundInvalidCharacter, marker);
3692 break;
3693 }
3694 }
3695 return ConsumeTokenResult.Success;
3696 }
3697 goto IL_02e7;
3698 IL_02e7:
3699 return ConsumeTokenResult.IncompleteNoRollBackNecessary;
3700 }
bool ConsumeValueMultiSegment(byte marker)
bool SkipAllCommentsMultiSegment(ref byte marker)

References System.Text.Json.Utf8JsonReader._bitStack, System.Text.Json.Utf8JsonReader._buffer, System.Text.Json.Utf8JsonReader._bytePositionInLine, System.Text.Json.Utf8JsonReader._consumed, System.Text.Json.Utf8JsonReader._currentPosition, System.Text.Json.Utf8JsonReader._inObject, System.Text.Json.Utf8JsonReader._lineNumber, System.Text.Json.Utf8JsonReader._readerOptions, System.Text.Json.Utf8JsonReader._tokenType, System.Text.Json.Utf8JsonReader._totalConsumed, System.Text.Json.JsonReaderOptions.AllowTrailingCommas, System.Text.Json.Utf8JsonReader.BytesConsumed, System.Text.Json.Utf8JsonReader.ConsumePropertyNameMultiSegment(), System.Text.Json.Utf8JsonReader.ConsumeValueMultiSegment(), System.Text.Json.BitStack.CurrentDepth, System.Text.Json.Dictionary, System.Text.Json.Utf8JsonReader.EndArray(), System.Text.Json.Utf8JsonReader.EndObject(), System.Text.Json.Utf8JsonReader.GetNextSpan(), System.Text.Json.Utf8JsonReader.HasMoreDataMultiSegment(), System.Text.Json.Utf8JsonReader.IsLastSpan, System.ReadOnlySpan< T >.Length, System.Text.Json.Utf8JsonReader.SkipAllCommentsMultiSegment(), System.Text.Json.Utf8JsonReader.SkipWhiteSpaceMultiSegment(), System.Text.Json.ThrowHelper.ThrowJsonReaderException(), and System.Text.Json.Utf8JsonReader.TokenStartIndex.

Referenced by System.Text.Json.Utf8JsonReader.ConsumeNextTokenMultiSegment().