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

◆ ScanSubsetContentAsync()

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

Definition at line 4295 of file DtdParser.cs.

4296 {
4297 while (true)
4298 {
4299 char c = _chars[_curPos];
4300 if (c != '<')
4301 {
4302 if (c != ']')
4303 {
4304 goto IL_0548;
4305 }
4306 if (_charsUsed - _curPos >= 2 || _readerAdapter.IsEof)
4307 {
4308 if (_chars[_curPos + 1] != ']')
4309 {
4310 _curPos++;
4311 _scanningFunction = ScanningFunction.ClosingTag;
4312 return Token.RightBracket;
4313 }
4314 if (_charsUsed - _curPos >= 3 || _readerAdapter.IsEof)
4315 {
4316 if (_chars[_curPos + 1] == ']' && _chars[_curPos + 2] == '>')
4317 {
4318 break;
4319 }
4320 goto IL_0548;
4321 }
4322 }
4323 }
4324 else
4325 {
4326 switch (_chars[_curPos + 1])
4327 {
4328 case '!':
4329 switch (_chars[_curPos + 2])
4330 {
4331 case 'E':
4332 if (_chars[_curPos + 3] == 'L')
4333 {
4334 if (_charsUsed - _curPos >= 9)
4335 {
4336 if (_chars[_curPos + 4] != 'E' || _chars[_curPos + 5] != 'M' || _chars[_curPos + 6] != 'E' || _chars[_curPos + 7] != 'N' || _chars[_curPos + 8] != 'T')
4337 {
4339 }
4340 _curPos += 9;
4341 _scanningFunction = ScanningFunction.QName;
4342 _nextScaningFunction = ScanningFunction.Element1;
4343 return Token.ElementDecl;
4344 }
4345 }
4346 else if (_chars[_curPos + 3] == 'N')
4347 {
4348 if (_charsUsed - _curPos >= 8)
4349 {
4350 if (_chars[_curPos + 4] != 'T' || _chars[_curPos + 5] != 'I' || _chars[_curPos + 6] != 'T' || _chars[_curPos + 7] != 'Y')
4351 {
4353 }
4354 _curPos += 8;
4355 _scanningFunction = ScanningFunction.Entity1;
4356 return Token.EntityDecl;
4357 }
4358 }
4359 else if (_charsUsed - _curPos >= 4)
4360 {
4362 return Token.None;
4363 }
4364 break;
4365 case 'A':
4366 if (_charsUsed - _curPos >= 9)
4367 {
4368 if (_chars[_curPos + 3] != 'T' || _chars[_curPos + 4] != 'T' || _chars[_curPos + 5] != 'L' || _chars[_curPos + 6] != 'I' || _chars[_curPos + 7] != 'S' || _chars[_curPos + 8] != 'T')
4369 {
4371 }
4372 _curPos += 9;
4373 _scanningFunction = ScanningFunction.QName;
4374 _nextScaningFunction = ScanningFunction.Attlist1;
4375 return Token.AttlistDecl;
4376 }
4377 break;
4378 case 'N':
4379 if (_charsUsed - _curPos >= 10)
4380 {
4381 if (_chars[_curPos + 3] != 'O' || _chars[_curPos + 4] != 'T' || _chars[_curPos + 5] != 'A' || _chars[_curPos + 6] != 'T' || _chars[_curPos + 7] != 'I' || _chars[_curPos + 8] != 'O' || _chars[_curPos + 9] != 'N')
4382 {
4384 }
4385 _curPos += 10;
4386 _scanningFunction = ScanningFunction.Name;
4387 _nextScaningFunction = ScanningFunction.Notation1;
4388 return Token.NotationDecl;
4389 }
4390 break;
4391 case '[':
4392 _curPos += 3;
4393 _scanningFunction = ScanningFunction.CondSection1;
4394 return Token.CondSectionStart;
4395 case '-':
4396 if (_chars[_curPos + 3] == '-')
4397 {
4398 _curPos += 4;
4399 return Token.Comment;
4400 }
4401 if (_charsUsed - _curPos >= 4)
4402 {
4404 }
4405 break;
4406 default:
4407 if (_charsUsed - _curPos >= 3)
4408 {
4410 }
4411 break;
4412 }
4413 break;
4414 case '?':
4415 _curPos += 2;
4416 return Token.PI;
4417 default:
4418 if (_charsUsed - _curPos >= 2)
4419 {
4421 return Token.None;
4422 }
4423 break;
4424 }
4425 }
4426 goto IL_0568;
4427 IL_0568:
4428 if (await ReadDataAsync().ConfigureAwait(continueOnCapturedContext: false) == 0)
4429 {
4431 }
4432 continue;
4433 IL_0548:
4434 if (_charsUsed - _curPos != 0)
4435 {
4437 }
4438 goto IL_0568;
4439 }
4440 _curPos += 3;
4441 return Token.CondSectionEnd;
4442 }
static string Xml_ExpectDtdMarkup
Definition SR.cs:244
static string Xml_IncompleteDtdContent
Definition SR.cs:246
Definition SR.cs:7
ScanningFunction _nextScaningFunction
Definition DtdParser.cs:168
async Task< int > ReadDataAsync()
void Throw(int curPos, string res)
IDtdParserAdapter _readerAdapter
Definition DtdParser.cs:140
ScanningFunction _scanningFunction
Definition DtdParser.cs:166

References System.Xml.DtdParser._chars, System.Xml.DtdParser._charsUsed, System.Xml.DtdParser._curPos, System.Xml.DtdParser._nextScaningFunction, System.Xml.DtdParser._readerAdapter, System.Xml.DtdParser._scanningFunction, System.Xml.Dictionary, System.Xml.IDtdParserAdapter.IsEof, System.Xml.DtdParser.ReadDataAsync(), System.Xml.DtdParser.Throw(), System.SR.Xml_ExpectDtdMarkup, and System.SR.Xml_IncompleteDtdContent.

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