Lines Matching refs:state

47         public static void SkipLastField(ref ReadOnlySpan<byte> buffer, ref ParserInternalState state)
49 if (state.lastTag == 0)
53 switch (WireFormat.GetTagWireType(state.lastTag))
56 SkipGroup(ref buffer, ref state, state.lastTag);
62 ParsingPrimitives.ParseRawLittleEndian32(ref buffer, ref state);
65 ParsingPrimitives.ParseRawLittleEndian64(ref buffer, ref state);
68 var length = ParsingPrimitives.ParseLength(ref buffer, ref state);
69 ParsingPrimitives.SkipRawBytes(ref buffer, ref state, length);
72 ParsingPrimitives.ParseRawVarint32(ref buffer, ref state);
80 public static void SkipGroup(ref ReadOnlySpan<byte> buffer, ref ParserInternalState state, uint startGroupTag)
84 state.recursionDepth++;
85 if (state.recursionDepth >= state.recursionLimit)
92 tag = ParsingPrimitives.ParseTag(ref buffer, ref state);
103 SkipLastField(ref buffer, ref state);
112 state.recursionDepth--;
117 int length = ParsingPrimitives.ParseLength(ref ctx.buffer, ref ctx.state);
118 if (ctx.state.recursionDepth >= ctx.state.recursionLimit)
122 int oldLimit = SegmentedBufferHelper.PushLimit(ref ctx.state, length);
123 ++ctx.state.recursionDepth;
127 CheckReadEndOfStreamTag(ref ctx.state);
129 if (!SegmentedBufferHelper.IsReachedLimit(ref ctx.state))
133 --ctx.state.recursionDepth;
134 SegmentedBufferHelper.PopLimit(ref ctx.state, oldLimit);
139 if (ctx.state.recursionDepth >= ctx.state.recursionLimit)
143 ++ctx.state.recursionDepth;
145 uint tag = ctx.state.lastTag;
148 CheckLastTagWas(ref ctx.state, WireFormat.MakeTag(fieldNumber, WireFormat.WireType.EndGroup));
150 --ctx.state.recursionDepth;
155 if (ctx.state.recursionDepth >= ctx.state.recursionLimit)
159 ++ctx.state.recursionDepth;
162 CheckLastTagWas(ref ctx.state, WireFormat.MakeTag(fieldNumber, WireFormat.WireType.EndGroup));
164 --ctx.state.recursionDepth;
179 // parsing process and make sure its internal state is up to date.
185 if (ctx.state.CodedInputStream == null)
195 ctx.CopyStateTo(ctx.state.CodedInputStream);
199 message.MergeFrom(ctx.state.CodedInputStream);
203 ctx.LoadStateFrom(ctx.state.CodedInputStream);
214 public static void CheckReadEndOfStreamTag(ref ParserInternalState state)
216 if (state.lastTag != 0)
222 private static void CheckLastTagWas(ref ParserInternalState state, uint expectedTag)
224 if (state.lastTag != expectedTag) {