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

◆ ParseElementContentAsync()

Task< bool > System.Xml.XmlTextReaderImpl.ParseElementContentAsync ( )
inlineprivate

Definition at line 10003 of file XmlTextReaderImpl.cs.

10004 {
10005 while (true)
10006 {
10007 int charPos = _ps.charPos;
10008 char[] chars = _ps.chars;
10009 switch (chars[charPos])
10010 {
10011 case '<':
10012 switch (chars[charPos + 1])
10013 {
10014 case '?':
10015 _ps.charPos = charPos + 2;
10016 return ParsePIAsync().ContinueBoolTaskFuncWhenFalseAsync((XmlTextReaderImpl thisRef) => thisRef.ParseElementContentAsync(), this);
10017 case '!':
10018 charPos += 2;
10019 if (_ps.charsUsed - charPos < 2)
10020 {
10022 }
10023 if (chars[charPos] == '-')
10024 {
10025 if (chars[charPos + 1] == '-')
10026 {
10027 _ps.charPos = charPos + 2;
10028 return ParseCommentAsync().ContinueBoolTaskFuncWhenFalseAsync((XmlTextReaderImpl thisRef) => thisRef.ParseElementContentAsync(), this);
10029 }
10030 ThrowUnexpectedToken(charPos + 1, "-");
10031 }
10032 else if (chars[charPos] == '[')
10033 {
10034 charPos++;
10035 if (_ps.charsUsed - charPos < 6)
10036 {
10038 }
10039 if (XmlConvert.StrEqual(chars, charPos, 6, "CDATA["))
10040 {
10041 _ps.charPos = charPos + 6;
10042 return ParseCDataAsync().ReturnTrueTaskWhenFinishAsync();
10043 }
10044 ThrowUnexpectedToken(charPos, "CDATA[");
10045 }
10046 else if (ParseUnexpectedToken(charPos) == "DOCTYPE")
10047 {
10049 }
10050 else
10051 {
10052 ThrowUnexpectedToken(charPos, "<!--", "<[CDATA[");
10053 }
10054 break;
10055 case '/':
10056 _ps.charPos = charPos + 2;
10057 return ParseEndElementAsync().ReturnTrueTaskWhenFinishAsync();
10058 default:
10059 if (charPos + 1 == _ps.charsUsed)
10060 {
10062 }
10063 _ps.charPos = charPos + 1;
10064 return ParseElementAsync().ReturnTrueTaskWhenFinishAsync();
10065 }
10066 break;
10067 case '&':
10068 return ParseTextAsync().ContinueBoolTaskFuncWhenFalseAsync((XmlTextReaderImpl thisRef) => thisRef.ParseElementContentAsync(), this);
10069 default:
10070 if (charPos == _ps.charsUsed)
10071 {
10073 }
10074 return ParseTextAsync().ContinueBoolTaskFuncWhenFalseAsync((XmlTextReaderImpl thisRef) => thisRef.ParseElementContentAsync(), this);
10075 }
10076 }
10077 }
static string Xml_BadDTDLocation
Definition SR.cs:98
Definition SR.cs:7
async Task< bool > ParseCommentAsync()
void Throw(int pos, string res, string arg)
async Task< bool > ParseElementContent_ReadData()
void ThrowUnexpectedToken(int pos, string expectedToken)

References System.Xml.XmlTextReaderImpl._ps, System.Xml.XmlTextReaderImpl.ParsingState.charPos, System.chars, System.Xml.XmlTextReaderImpl.ParsingState.chars, System.Xml.XmlTextReaderImpl.ParsingState.charsUsed, System.Xml.Dictionary, System.Xml.XmlTextReaderImpl.ParseCDataAsync(), System.Xml.XmlTextReaderImpl.ParseCommentAsync(), System.Xml.XmlTextReaderImpl.ParseElementAsync(), System.Xml.XmlTextReaderImpl.ParseElementContent_ReadData(), System.Xml.XmlTextReaderImpl.ParseEndElementAsync(), System.Xml.XmlTextReaderImpl.ParsePIAsync(), System.Xml.XmlTextReaderImpl.ParseTextAsync(), System.Xml.XmlTextReaderImpl.ParseUnexpectedToken(), System.Xml.XmlConvert.StrEqual(), System.Xml.XmlTextReaderImpl.Throw(), System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(), and System.SR.Xml_BadDTDLocation.

Referenced by System.Xml.XmlTextReaderImpl.ParseElementContent_ReadData(), and System.Xml.XmlTextReaderImpl.ReadAsync().