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

◆ NextLex()

bool MS.Internal.Xml.XPath.XPathScanner.NextLex ( )
inline

Definition at line 123 of file XPathScanner.cs.

124 {
125 SkipSpace();
126 switch (CurrentChar)
127 {
128 case '\0':
129 _kind = LexKind.Eof;
130 return false;
131 case '#':
132 case '$':
133 case '(':
134 case ')':
135 case '*':
136 case '+':
137 case ',':
138 case '-':
139 case '=':
140 case '@':
141 case '[':
142 case ']':
143 case '|':
145 NextChar();
146 break;
147 case '<':
148 _kind = LexKind.Lt;
149 NextChar();
150 if (CurrentChar == '=')
151 {
152 _kind = LexKind.Le;
153 NextChar();
154 }
155 break;
156 case '>':
157 _kind = LexKind.Gt;
158 NextChar();
159 if (CurrentChar == '=')
160 {
161 _kind = LexKind.Ge;
162 NextChar();
163 }
164 break;
165 case '!':
166 _kind = LexKind.Bang;
167 NextChar();
168 if (CurrentChar == '=')
169 {
170 _kind = LexKind.Ne;
171 NextChar();
172 }
173 break;
174 case '.':
175 _kind = LexKind.Dot;
176 NextChar();
177 if (CurrentChar == '.')
178 {
179 _kind = LexKind.DotDot;
180 NextChar();
181 }
183 {
184 _kind = LexKind.Number;
186 }
187 break;
188 case '/':
189 _kind = LexKind.Slash;
190 NextChar();
191 if (CurrentChar == '/')
192 {
193 _kind = LexKind.SlashSlash;
194 NextChar();
195 }
196 break;
197 case '"':
198 case '\'':
199 _kind = LexKind.String;
201 break;
202 default:
204 {
205 _kind = LexKind.Number;
207 break;
208 }
210 {
211 _kind = LexKind.Name;
212 _name = ScanName();
213 _prefix = string.Empty;
214 if (CurrentChar == ':')
215 {
216 NextChar();
217 if (CurrentChar == ':')
218 {
219 NextChar();
220 _kind = LexKind.Axe;
221 }
222 else
223 {
224 _prefix = _name;
225 if (CurrentChar == '*')
226 {
227 NextChar();
228 _name = "*";
229 }
230 else
231 {
233 {
235 }
236 _name = ScanName();
237 }
238 }
239 }
240 else
241 {
242 SkipSpace();
243 if (CurrentChar == ':')
244 {
245 NextChar();
246 if (CurrentChar != ':')
247 {
249 }
250 NextChar();
251 _kind = LexKind.Axe;
252 }
253 }
254 SkipSpace();
256 break;
257 }
259 }
260 return true;
261 }
static int ToInt32(object? value)
Definition Convert.cs:1320
static CultureInfo InvariantCulture
static string Xp_InvalidName
Definition SR.cs:1240
static string Xp_InvalidToken
Definition SR.cs:1242
Definition SR.cs:7
static XPathException Create(string res)
static bool IsStartNCNameSingleChar(char ch)
static bool IsDigit(char ch)

References MS.Internal.Xml.XPath.XPathScanner._canBeFunction, MS.Internal.Xml.XPath.XPathScanner._kind, MS.Internal.Xml.XPath.XPathScanner._name, MS.Internal.Xml.XPath.XPathScanner._numberValue, MS.Internal.Xml.XPath.XPathScanner._prefix, MS.Internal.Xml.XPath.XPathScanner._stringValue, System.Xml.XPath.XPathException.Create(), MS.Internal.Xml.XPath.XPathScanner.CurrentChar, System.Globalization.CultureInfo.InvariantCulture, System.Xml.XmlCharType.IsDigit(), System.Xml.XmlCharType.IsStartNCNameSingleChar(), MS.Internal.Xml.XPath.XPathScanner.NextChar(), MS.Internal.Xml.XPath.XPathScanner.ScanFraction(), MS.Internal.Xml.XPath.XPathScanner.ScanName(), MS.Internal.Xml.XPath.XPathScanner.ScanNumber(), MS.Internal.Xml.XPath.XPathScanner.ScanString(), MS.Internal.Xml.XPath.XPathScanner.SkipSpace(), MS.Internal.Xml.XPath.XPathScanner.SourceText, System.Convert.ToInt32(), System.SR.Xp_InvalidName, and System.SR.Xp_InvalidToken.

Referenced by MS.Internal.Xml.XPath.XPathScanner.XPathScanner(), and MS.Internal.Xml.XPath.XPathParser.NextLex().