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

◆ ScanCondSection3()

Token System.Xml.DtdParser.ScanCondSection3 ( )
inlineprivate

Definition at line 2547 of file DtdParser.cs.

2548 {
2549 int num = 0;
2550 while (true)
2551 {
2552 if (XmlCharType.IsTextChar(_chars[_curPos]) && _chars[_curPos] != ']')
2553 {
2554 _curPos++;
2555 continue;
2556 }
2557 switch (_chars[_curPos])
2558 {
2559 case '\t':
2560 case '"':
2561 case '&':
2562 case '\'':
2563 _curPos++;
2564 continue;
2565 case '\n':
2566 _curPos++;
2568 continue;
2569 case '\r':
2570 if (_chars[_curPos + 1] == '\n')
2571 {
2572 _curPos += 2;
2573 }
2574 else
2575 {
2576 if (_curPos + 1 >= _charsUsed && !_readerAdapter.IsEof)
2577 {
2578 break;
2579 }
2580 _curPos++;
2581 }
2583 continue;
2584 case '<':
2585 if (_charsUsed - _curPos >= 3)
2586 {
2587 if (_chars[_curPos + 1] != '!' || _chars[_curPos + 2] != '[')
2588 {
2589 _curPos++;
2590 continue;
2591 }
2592 num++;
2593 _curPos += 3;
2594 continue;
2595 }
2596 break;
2597 case ']':
2598 if (_charsUsed - _curPos < 3)
2599 {
2600 break;
2601 }
2602 if (_chars[_curPos + 1] != ']' || _chars[_curPos + 2] != '>')
2603 {
2604 _curPos++;
2605 continue;
2606 }
2607 if (num > 0)
2608 {
2609 num--;
2610 _curPos += 3;
2611 continue;
2612 }
2613 _curPos += 3;
2614 _scanningFunction = ScanningFunction.SubsetContent;
2615 return Token.CondSectionEnd;
2616 default:
2617 {
2618 if (_curPos == _charsUsed)
2619 {
2620 break;
2621 }
2622 char ch = _chars[_curPos];
2623 if (XmlCharType.IsHighSurrogate(ch))
2624 {
2625 if (_curPos + 1 == _charsUsed)
2626 {
2627 break;
2628 }
2629 _curPos++;
2630 if (XmlCharType.IsLowSurrogate(_chars[_curPos]))
2631 {
2632 _curPos++;
2633 continue;
2634 }
2635 }
2637 return Token.None;
2638 }
2639 }
2640 if (_readerAdapter.IsEof || ReadData() == 0)
2641 {
2643 {
2644 continue;
2645 }
2647 }
2649 }
2650 }
static string Xml_UnclosedConditionalSection
Definition SR.cs:242
Definition SR.cs:7
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.ReadData(), System.Xml.DtdParser.Throw(), System.Xml.DtdParser.ThrowInvalidChar(), and System.SR.Xml_UnclosedConditionalSection.

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