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

◆ ScanCondSection3Async()

async Task< Token > System.Xml.DtdParser.ScanCondSection3Async ( )
inlineprivate

Definition at line 5169 of file DtdParser.cs.

5170 {
5171 int ignoreSectionDepth = 0;
5172 while (true)
5173 {
5174 if (XmlCharType.IsTextChar(_chars[_curPos]) && _chars[_curPos] != ']')
5175 {
5176 _curPos++;
5177 continue;
5178 }
5179 switch (_chars[_curPos])
5180 {
5181 case '\t':
5182 case '"':
5183 case '&':
5184 case '\'':
5185 _curPos++;
5186 continue;
5187 case '\n':
5188 _curPos++;
5190 continue;
5191 case '\r':
5192 if (_chars[_curPos + 1] == '\n')
5193 {
5194 _curPos += 2;
5195 }
5196 else
5197 {
5198 if (_curPos + 1 >= _charsUsed && !_readerAdapter.IsEof)
5199 {
5200 break;
5201 }
5202 _curPos++;
5203 }
5205 continue;
5206 case '<':
5207 if (_charsUsed - _curPos >= 3)
5208 {
5209 if (_chars[_curPos + 1] != '!' || _chars[_curPos + 2] != '[')
5210 {
5211 _curPos++;
5212 continue;
5213 }
5215 _curPos += 3;
5216 continue;
5217 }
5218 break;
5219 case ']':
5220 if (_charsUsed - _curPos < 3)
5221 {
5222 break;
5223 }
5224 if (_chars[_curPos + 1] != ']' || _chars[_curPos + 2] != '>')
5225 {
5226 _curPos++;
5227 continue;
5228 }
5229 if (ignoreSectionDepth > 0)
5230 {
5232 _curPos += 3;
5233 continue;
5234 }
5235 _curPos += 3;
5236 _scanningFunction = ScanningFunction.SubsetContent;
5237 return Token.CondSectionEnd;
5238 default:
5239 {
5240 if (_curPos == _charsUsed)
5241 {
5242 break;
5243 }
5244 char ch = _chars[_curPos];
5245 if (XmlCharType.IsHighSurrogate(ch))
5246 {
5247 if (_curPos + 1 == _charsUsed)
5248 {
5249 break;
5250 }
5251 _curPos++;
5252 if (XmlCharType.IsLowSurrogate(_chars[_curPos]))
5253 {
5254 _curPos++;
5255 continue;
5256 }
5257 }
5259 return Token.None;
5260 }
5261 }
5262 bool isEof = _readerAdapter.IsEof;
5263 bool flag = isEof;
5264 if (!flag)
5265 {
5266 flag = await ReadDataAsync().ConfigureAwait(continueOnCapturedContext: false) == 0;
5267 }
5268 if (flag)
5269 {
5271 {
5272 continue;
5273 }
5275 }
5277 }
5278 }
static string Xml_UnclosedConditionalSection
Definition SR.cs:242
Definition SR.cs:7
async Task< int > ReadDataAsync()
void Throw(int curPos, string res)
bool HandleEntityEnd(bool inLiteral)
IDtdParserAdapter _readerAdapter
Definition DtdParser.cs:140
ScanningFunction _scanningFunction
Definition DtdParser.cs:166
void ThrowInvalidChar(int pos, string data, int invCharPos)

References System.Xml.DtdParser._chars, System.Xml.DtdParser._charsUsed, System.Xml.DtdParser._curPos, System.Xml.DtdParser._readerAdapter, System.Xml.DtdParser._scanningFunction, System.Xml.DtdParser._tokenStartPos, System.ch, System.Xml.DtdParser.HandleEntityEnd(), System.Xml.IDtdParserAdapter.IsEof, System.Xml.XmlCharType.IsHighSurrogate(), System.Xml.XmlCharType.IsLowSurrogate(), System.Xml.XmlCharType.IsTextChar(), System.Xml.IDtdParserAdapter.OnNewLine(), System.Xml.DtdParser.ReadDataAsync(), System.Xml.DtdParser.Throw(), System.Xml.DtdParser.ThrowInvalidChar(), and System.SR.Xml_UnclosedConditionalSection.

Referenced by System.Xml.DtdParser.GetTokenAsync().