| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System.Diagnostics; |
| | | 5 | | using System.Diagnostics.CodeAnalysis; |
| | | 6 | | using System.Globalization; |
| | | 7 | | using System.IO; |
| | | 8 | | using System.Runtime.CompilerServices; |
| | | 9 | | using System.Text; |
| | | 10 | | |
| | | 11 | | namespace System.Reflection |
| | | 12 | | { |
| | | 13 | | /// <summary> |
| | | 14 | | /// Parses an assembly name. |
| | | 15 | | /// </summary> |
| | | 16 | | internal ref partial struct AssemblyNameParser |
| | | 17 | | { |
| | | 18 | | public readonly struct AssemblyNameParts |
| | | 19 | | { |
| | | 20 | | public AssemblyNameParts(string name, Version? version, string? cultureName, AssemblyNameFlags flags, byte[] |
| | 4940 | 21 | | { |
| | 4940 | 22 | | _name = name; |
| | 4940 | 23 | | _version = version; |
| | 4940 | 24 | | _cultureName = cultureName; |
| | 4940 | 25 | | _flags = flags; |
| | 4940 | 26 | | _publicKeyOrToken = publicKeyOrToken; |
| | 4940 | 27 | | } |
| | | 28 | | |
| | | 29 | | public readonly string _name; |
| | | 30 | | public readonly Version? _version; |
| | | 31 | | public readonly string? _cultureName; |
| | | 32 | | public readonly AssemblyNameFlags _flags; |
| | | 33 | | public readonly byte[]? _publicKeyOrToken; |
| | | 34 | | } |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Token categories for the lexer. |
| | | 38 | | /// </summary> |
| | | 39 | | private enum Token |
| | | 40 | | { |
| | | 41 | | Equals = 1, |
| | | 42 | | Comma = 2, |
| | | 43 | | String = 3, |
| | | 44 | | End = 4, |
| | | 45 | | } |
| | | 46 | | |
| | | 47 | | private enum AttributeKind |
| | | 48 | | { |
| | | 49 | | Version = 1, |
| | | 50 | | Culture = 2, |
| | | 51 | | PublicKeyOrToken = 4, |
| | | 52 | | ProcessorArchitecture = 8, |
| | | 53 | | Retargetable = 16, |
| | | 54 | | ContentType = 32 |
| | | 55 | | } |
| | | 56 | | |
| | | 57 | | private readonly ReadOnlySpan<char> _input; |
| | | 58 | | private int _index; |
| | | 59 | | |
| | | 60 | | private AssemblyNameParser(ReadOnlySpan<char> input) |
| | 8408 | 61 | | { |
| | | 62 | | #if SYSTEM_PRIVATE_CORELIB |
| | | 63 | | if (input.Length == 0) |
| | | 64 | | throw new ArgumentException(SR.Format_StringZeroLength); |
| | | 65 | | #else |
| | 8408 | 66 | | Debug.Assert(input.Length > 0); |
| | | 67 | | #endif |
| | | 68 | | |
| | 8408 | 69 | | _input = input; |
| | 8408 | 70 | | _index = 0; |
| | 8408 | 71 | | } |
| | | 72 | | |
| | | 73 | | #if SYSTEM_PRIVATE_CORELIB |
| | | 74 | | public static AssemblyNameParts Parse(string name) => Parse(name.AsSpan()); |
| | | 75 | | |
| | | 76 | | public static AssemblyNameParts Parse(ReadOnlySpan<char> name) |
| | | 77 | | { |
| | | 78 | | AssemblyNameParser parser = new(name); |
| | | 79 | | AssemblyNameParts result = default; |
| | | 80 | | if (parser.TryParse(ref result)) |
| | | 81 | | { |
| | | 82 | | return result; |
| | | 83 | | } |
| | | 84 | | throw new FileLoadException(SR.InvalidAssemblyName, name.ToString()); |
| | | 85 | | } |
| | | 86 | | #endif |
| | | 87 | | |
| | | 88 | | internal static bool TryParse(ReadOnlySpan<char> name, ref AssemblyNameParts parts) |
| | 8408 | 89 | | { |
| | 8408 | 90 | | AssemblyNameParser parser = new(name); |
| | 8408 | 91 | | return parser.TryParse(ref parts); |
| | 8408 | 92 | | } |
| | | 93 | | |
| | | 94 | | private static bool TryRecordNewSeen(scoped ref AttributeKind seenAttributes, AttributeKind newAttribute) |
| | 3240 | 95 | | { |
| | 3240 | 96 | | if ((seenAttributes & newAttribute) != 0) |
| | 468 | 97 | | { |
| | 468 | 98 | | return false; |
| | | 99 | | } |
| | 2772 | 100 | | seenAttributes |= newAttribute; |
| | 2772 | 101 | | return true; |
| | 3240 | 102 | | } |
| | | 103 | | |
| | | 104 | | private bool TryParse(ref AssemblyNameParts result) |
| | 8408 | 105 | | { |
| | | 106 | | // Name must come first. |
| | 8408 | 107 | | if (!TryGetNextToken(out string name, out Token token) || token != Token.String || string.IsNullOrEmpty(name |
| | 580 | 108 | | return false; |
| | | 109 | | |
| | 7828 | 110 | | Version? version = null; |
| | 7828 | 111 | | string? cultureName = null; |
| | 7828 | 112 | | byte[]? pkt = null; |
| | 7828 | 113 | | AssemblyNameFlags flags = 0; |
| | | 114 | | |
| | 7828 | 115 | | AttributeKind alreadySeen = default; |
| | 7828 | 116 | | if (!TryGetNextToken(out _, out token)) |
| | 52 | 117 | | return false; |
| | | 118 | | |
| | 28248 | 119 | | while (token != Token.End) |
| | 23308 | 120 | | { |
| | 23308 | 121 | | if (token != Token.Comma) |
| | 288 | 122 | | return false; |
| | | 123 | | |
| | 23020 | 124 | | if (!TryGetNextToken(out string attributeName, out token) || token != Token.String) |
| | 236 | 125 | | return false; |
| | | 126 | | |
| | 22784 | 127 | | if (!TryGetNextToken(out _, out token) || token != Token.Equals) |
| | 728 | 128 | | return false; |
| | | 129 | | |
| | 22056 | 130 | | if (!TryGetNextToken(out string attributeValue, out token) || token != Token.String) |
| | 36 | 131 | | return false; |
| | | 132 | | |
| | 22020 | 133 | | if (attributeName == string.Empty) |
| | 16 | 134 | | return false; |
| | | 135 | | |
| | 22004 | 136 | | if (IsAttribute(attributeName, "Version")) |
| | 1040 | 137 | | { |
| | 1040 | 138 | | if (!TryRecordNewSeen(ref alreadySeen, AttributeKind.Version)) |
| | 120 | 139 | | { |
| | 120 | 140 | | return false; |
| | | 141 | | } |
| | 920 | 142 | | if (!TryParseVersion(attributeValue, ref version)) |
| | 284 | 143 | | { |
| | 284 | 144 | | return false; |
| | | 145 | | } |
| | 636 | 146 | | } |
| | 20964 | 147 | | else if (IsAttribute(attributeName, "Culture")) |
| | 0 | 148 | | { |
| | 0 | 149 | | if (!TryRecordNewSeen(ref alreadySeen, AttributeKind.Culture)) |
| | 0 | 150 | | { |
| | 0 | 151 | | return false; |
| | | 152 | | } |
| | 0 | 153 | | if (!TryParseCulture(attributeValue, out cultureName)) |
| | 0 | 154 | | { |
| | 0 | 155 | | return false; |
| | | 156 | | } |
| | 0 | 157 | | } |
| | 20964 | 158 | | else if (IsAttribute(attributeName, "PublicKeyToken")) |
| | 436 | 159 | | { |
| | 436 | 160 | | if (!TryRecordNewSeen(ref alreadySeen, AttributeKind.PublicKeyOrToken)) |
| | 80 | 161 | | { |
| | 80 | 162 | | return false; |
| | | 163 | | } |
| | 356 | 164 | | if (!TryParsePKT(attributeValue, isToken: true, out pkt)) |
| | 204 | 165 | | { |
| | 204 | 166 | | return false; |
| | | 167 | | } |
| | 152 | 168 | | } |
| | 20528 | 169 | | else if (IsAttribute(attributeName, "PublicKey")) |
| | 1284 | 170 | | { |
| | 1284 | 171 | | if (!TryRecordNewSeen(ref alreadySeen, AttributeKind.PublicKeyOrToken)) |
| | 132 | 172 | | { |
| | 132 | 173 | | return false; |
| | | 174 | | } |
| | 1152 | 175 | | if (!TryParsePKT(attributeValue, isToken: false, out pkt)) |
| | 348 | 176 | | { |
| | 348 | 177 | | return false; |
| | | 178 | | } |
| | 804 | 179 | | flags |= AssemblyNameFlags.PublicKey; |
| | 804 | 180 | | } |
| | 19244 | 181 | | else if (IsAttribute(attributeName, "ProcessorArchitecture")) |
| | 184 | 182 | | { |
| | 184 | 183 | | if (!TryRecordNewSeen(ref alreadySeen, AttributeKind.ProcessorArchitecture)) |
| | 40 | 184 | | { |
| | 40 | 185 | | return false; |
| | | 186 | | } |
| | 144 | 187 | | if (!TryParseProcessorArchitecture(attributeValue, out ProcessorArchitecture arch)) |
| | 20 | 188 | | { |
| | 20 | 189 | | return false; |
| | | 190 | | } |
| | 124 | 191 | | flags |= (AssemblyNameFlags)(((int)arch) << 4); |
| | 124 | 192 | | } |
| | 19060 | 193 | | else if (IsAttribute(attributeName, "Retargetable")) |
| | 112 | 194 | | { |
| | 112 | 195 | | if (!TryRecordNewSeen(ref alreadySeen, AttributeKind.Retargetable)) |
| | 36 | 196 | | { |
| | 36 | 197 | | return false; |
| | | 198 | | } |
| | | 199 | | |
| | 76 | 200 | | if (attributeValue.Equals("Yes", StringComparison.OrdinalIgnoreCase)) |
| | 52 | 201 | | { |
| | 52 | 202 | | flags |= AssemblyNameFlags.Retargetable; |
| | 52 | 203 | | } |
| | 24 | 204 | | else if (attributeValue.Equals("No", StringComparison.OrdinalIgnoreCase)) |
| | 0 | 205 | | { |
| | | 206 | | // nothing to do |
| | 0 | 207 | | } |
| | | 208 | | else |
| | 24 | 209 | | { |
| | 24 | 210 | | return false; |
| | | 211 | | } |
| | 52 | 212 | | } |
| | 18948 | 213 | | else if (IsAttribute(attributeName, "ContentType")) |
| | 184 | 214 | | { |
| | 184 | 215 | | if (!TryRecordNewSeen(ref alreadySeen, AttributeKind.ContentType)) |
| | 60 | 216 | | { |
| | 60 | 217 | | return false; |
| | | 218 | | } |
| | | 219 | | |
| | 124 | 220 | | if (attributeValue.Equals("WindowsRuntime", StringComparison.OrdinalIgnoreCase)) |
| | 72 | 221 | | { |
| | 72 | 222 | | flags |= (AssemblyNameFlags)(((int)AssemblyContentType.WindowsRuntime) << 9); |
| | 72 | 223 | | } |
| | | 224 | | else |
| | 52 | 225 | | { |
| | 52 | 226 | | return false; |
| | | 227 | | } |
| | 72 | 228 | | } |
| | | 229 | | else |
| | 18764 | 230 | | { |
| | | 231 | | // Desktop compat: If we got here, the attribute name is unknown to us. Ignore it. |
| | 18764 | 232 | | } |
| | | 233 | | |
| | 20604 | 234 | | if (!TryGetNextToken(out _, out token)) |
| | 132 | 235 | | { |
| | 132 | 236 | | return false; |
| | | 237 | | } |
| | 20472 | 238 | | } |
| | | 239 | | |
| | 4940 | 240 | | result = new AssemblyNameParts(name, version, cultureName, flags, pkt); |
| | 4940 | 241 | | return true; |
| | 8408 | 242 | | } |
| | | 243 | | |
| | | 244 | | private static bool IsAttribute(string candidate, string attributeKind) |
| | 141712 | 245 | | => candidate.Equals(attributeKind, StringComparison.OrdinalIgnoreCase); |
| | | 246 | | |
| | | 247 | | private static unsafe bool TryParseVersion(string attributeValue, ref Version? version) |
| | 920 | 248 | | { |
| | | 249 | | #if NET |
| | 920 | 250 | | ReadOnlySpan<char> attributeValueSpan = attributeValue; |
| | 920 | 251 | | Span<Range> parts = stackalloc Range[5]; |
| | 920 | 252 | | parts = parts.Slice(0, attributeValueSpan.Split(parts, '.')); |
| | | 253 | | #else |
| | | 254 | | string[] parts = attributeValue.Split('.'); |
| | | 255 | | #endif |
| | 920 | 256 | | if (parts.Length is < 2 or > 4) |
| | 92 | 257 | | { |
| | 92 | 258 | | return false; |
| | | 259 | | } |
| | | 260 | | |
| | 828 | 261 | | Span<ushort> versionNumbers = [ushort.MaxValue, ushort.MaxValue, ushort.MaxValue, ushort.MaxValue]; |
| | 5776 | 262 | | for (int i = 0; i < parts.Length; i++) |
| | 2252 | 263 | | { |
| | 2252 | 264 | | if (!ushort.TryParse( |
| | 2252 | 265 | | #if NET |
| | 2252 | 266 | | attributeValueSpan[parts[i]], |
| | 2252 | 267 | | #else |
| | 2252 | 268 | | parts[i], |
| | 2252 | 269 | | #endif |
| | 2252 | 270 | | NumberStyles.None, NumberFormatInfo.InvariantInfo, out versionNumbers[i])) |
| | 192 | 271 | | { |
| | 192 | 272 | | return false; |
| | | 273 | | } |
| | 2060 | 274 | | } |
| | | 275 | | |
| | 636 | 276 | | if (versionNumbers[0] == ushort.MaxValue || |
| | 636 | 277 | | versionNumbers[1] == ushort.MaxValue) |
| | 0 | 278 | | { |
| | 0 | 279 | | return false; |
| | | 280 | | } |
| | | 281 | | |
| | 636 | 282 | | version = |
| | 636 | 283 | | versionNumbers[2] == ushort.MaxValue ? new Version(versionNumbers[0], versionNumbers[1]) : |
| | 636 | 284 | | versionNumbers[3] == ushort.MaxValue ? new Version(versionNumbers[0], versionNumbers[1], versionNumbers[ |
| | 636 | 285 | | new Version(versionNumbers[0], versionNumbers[1], versionNumbers[2], versionNumbers[3]); |
| | | 286 | | |
| | 636 | 287 | | return true; |
| | 920 | 288 | | } |
| | | 289 | | |
| | | 290 | | private static bool TryParseCulture(string attributeValue, out string? result) |
| | 0 | 291 | | { |
| | 0 | 292 | | if (attributeValue.Equals("Neutral", StringComparison.OrdinalIgnoreCase)) |
| | 0 | 293 | | { |
| | 0 | 294 | | result = ""; |
| | 0 | 295 | | return true; |
| | | 296 | | } |
| | | 297 | | |
| | 0 | 298 | | result = attributeValue; |
| | 0 | 299 | | return true; |
| | 0 | 300 | | } |
| | | 301 | | |
| | | 302 | | private static bool TryParsePKT(string attributeValue, bool isToken, out byte[]? result) |
| | 1508 | 303 | | { |
| | 1508 | 304 | | if (attributeValue.Equals("null", StringComparison.OrdinalIgnoreCase) || attributeValue == string.Empty) |
| | 52 | 305 | | { |
| | 52 | 306 | | result = []; |
| | 52 | 307 | | return true; |
| | | 308 | | } |
| | | 309 | | |
| | 1456 | 310 | | if (attributeValue.Length % 2 != 0 || (isToken && attributeValue.Length != 8 * 2)) |
| | 92 | 311 | | { |
| | 92 | 312 | | result = null; |
| | 92 | 313 | | return false; |
| | | 314 | | } |
| | | 315 | | |
| | 1364 | 316 | | byte[] pkt = new byte[attributeValue.Length / 2]; |
| | 1364 | 317 | | if (!HexConverter.TryDecodeFromUtf16(attributeValue.AsSpan(), pkt, out int _)) |
| | 460 | 318 | | { |
| | 460 | 319 | | result = null; |
| | 460 | 320 | | return false; |
| | | 321 | | } |
| | | 322 | | |
| | 904 | 323 | | result = pkt; |
| | 904 | 324 | | return true; |
| | 1508 | 325 | | } |
| | | 326 | | |
| | | 327 | | private static bool TryParseProcessorArchitecture(string attributeValue, out ProcessorArchitecture result) |
| | 144 | 328 | | { |
| | 144 | 329 | | result = attributeValue switch |
| | 144 | 330 | | { |
| | 164 | 331 | | _ when attributeValue.Equals("msil", StringComparison.OrdinalIgnoreCase) => ProcessorArchitecture.MSIL, |
| | 148 | 332 | | _ when attributeValue.Equals("x86", StringComparison.OrdinalIgnoreCase) => ProcessorArchitecture.X86, |
| | 100 | 333 | | _ when attributeValue.Equals("ia64", StringComparison.OrdinalIgnoreCase) => ProcessorArchitecture.IA64, |
| | 156 | 334 | | _ when attributeValue.Equals("amd64", StringComparison.OrdinalIgnoreCase) => ProcessorArchitecture.Amd64 |
| | 68 | 335 | | _ when attributeValue.Equals("arm", StringComparison.OrdinalIgnoreCase) => ProcessorArchitecture.Arm, |
| | 20 | 336 | | _ => ProcessorArchitecture.None |
| | 144 | 337 | | }; |
| | 144 | 338 | | return result != ProcessorArchitecture.None; |
| | 144 | 339 | | } |
| | | 340 | | |
| | | 341 | | private static bool IsWhiteSpace(char ch) |
| | 120460 | 342 | | => ch is '\n' or '\r' or ' ' or '\t'; |
| | | 343 | | |
| | | 344 | | [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| | | 345 | | private bool TryGetNextChar(out char ch) |
| | 1232760 | 346 | | { |
| | 1232760 | 347 | | if (_index < _input.Length) |
| | 1220556 | 348 | | { |
| | 1220556 | 349 | | ch = _input[_index++]; |
| | 1220556 | 350 | | if (ch == '\0') |
| | 140 | 351 | | { |
| | 140 | 352 | | return false; |
| | | 353 | | } |
| | 1220416 | 354 | | } |
| | | 355 | | else |
| | 12204 | 356 | | { |
| | 12204 | 357 | | ch = '\0'; |
| | 12204 | 358 | | } |
| | | 359 | | |
| | 1232620 | 360 | | return true; |
| | 1232760 | 361 | | } |
| | | 362 | | |
| | | 363 | | // |
| | | 364 | | // Return the next token in assembly name. If the result is Token.String, |
| | | 365 | | // sets "tokenString" to the tokenized string. |
| | | 366 | | // |
| | | 367 | | private unsafe bool TryGetNextToken(out string tokenString, out Token token) |
| | 104700 | 368 | | { |
| | 104700 | 369 | | tokenString = string.Empty; |
| | | 370 | | char c; |
| | | 371 | | |
| | 115056 | 372 | | while (true) |
| | 115056 | 373 | | { |
| | 115056 | 374 | | if (!TryGetNextChar(out c)) |
| | 32 | 375 | | { |
| | 32 | 376 | | token = default; |
| | 32 | 377 | | return false; |
| | | 378 | | } |
| | | 379 | | |
| | 115024 | 380 | | switch (c) |
| | | 381 | | { |
| | | 382 | | case ',': |
| | 23488 | 383 | | { |
| | 23488 | 384 | | token = Token.Comma; |
| | 23488 | 385 | | return true; |
| | | 386 | | } |
| | | 387 | | case '=': |
| | 22320 | 388 | | { |
| | 22320 | 389 | | token = Token.Equals; |
| | 22320 | 390 | | return true; |
| | | 391 | | } |
| | | 392 | | case '\0': |
| | 5444 | 393 | | { |
| | 5444 | 394 | | token = Token.End; |
| | 5444 | 395 | | return true; |
| | | 396 | | } |
| | | 397 | | } |
| | | 398 | | |
| | 63772 | 399 | | if (!IsWhiteSpace(c)) |
| | 53416 | 400 | | { |
| | 53416 | 401 | | break; |
| | | 402 | | } |
| | 10356 | 403 | | } |
| | | 404 | | |
| | 53416 | 405 | | using ValueStringBuilder sb = new ValueStringBuilder(stackalloc char[64]); |
| | | 406 | | |
| | 53416 | 407 | | char quoteChar = '\0'; |
| | 53416 | 408 | | if (c is '\'' or '\"') |
| | 696 | 409 | | { |
| | 696 | 410 | | quoteChar = c; |
| | 696 | 411 | | if (!TryGetNextChar(out c)) |
| | 8 | 412 | | { |
| | 8 | 413 | | token = default; |
| | 8 | 414 | | return false; |
| | | 415 | | } |
| | 688 | 416 | | } |
| | | 417 | | |
| | | 418 | | for (; ; ) |
| | 1141844 | 419 | | { |
| | 1141844 | 420 | | if (c == 0) |
| | 6740 | 421 | | { |
| | 6740 | 422 | | if (quoteChar != 0) |
| | 276 | 423 | | { |
| | | 424 | | // EOS and unclosed quotes is an error |
| | 276 | 425 | | token = default; |
| | 276 | 426 | | return false; |
| | | 427 | | } |
| | | 428 | | // Reached end of input and therefore of string |
| | 6464 | 429 | | break; |
| | | 430 | | } |
| | | 431 | | |
| | 1135104 | 432 | | if (quoteChar != 0 && c == quoteChar) |
| | 412 | 433 | | break; // Terminate: Found closing quote of quoted string. |
| | | 434 | | |
| | 1134692 | 435 | | if (quoteChar == 0 && (c is ',' or '=')) |
| | 45828 | 436 | | { |
| | 45828 | 437 | | _index--; |
| | 45828 | 438 | | break; // Terminate: Found start of a new ',' or '=' token. |
| | | 439 | | } |
| | | 440 | | |
| | 1088864 | 441 | | if (quoteChar == 0 && (c is '\'' or '\"')) |
| | 40 | 442 | | { |
| | 40 | 443 | | token = default; |
| | 40 | 444 | | return false; |
| | | 445 | | } |
| | | 446 | | |
| | 1088824 | 447 | | if (c is '\\') |
| | 28500 | 448 | | { |
| | 28500 | 449 | | if (!TryGetNextChar(out c)) |
| | 28 | 450 | | { |
| | 28 | 451 | | token = default; |
| | 28 | 452 | | return false; |
| | | 453 | | } |
| | | 454 | | |
| | 28472 | 455 | | switch (c) |
| | | 456 | | { |
| | | 457 | | case '\\': |
| | | 458 | | case ',': |
| | | 459 | | case '=': |
| | | 460 | | case '\'': |
| | | 461 | | case '"': |
| | 11208 | 462 | | sb.Append(c); |
| | 11208 | 463 | | break; |
| | | 464 | | case 't': |
| | 6808 | 465 | | sb.Append('\t'); |
| | 6808 | 466 | | break; |
| | | 467 | | case 'r': |
| | 7884 | 468 | | sb.Append('\r'); |
| | 7884 | 469 | | break; |
| | | 470 | | case 'n': |
| | 2284 | 471 | | sb.Append('\n'); |
| | 2284 | 472 | | break; |
| | | 473 | | default: |
| | 288 | 474 | | token = default; |
| | 288 | 475 | | return false; |
| | | 476 | | } |
| | 28184 | 477 | | } |
| | | 478 | | else |
| | 1060324 | 479 | | { |
| | 1060324 | 480 | | sb.Append(c); |
| | 1060324 | 481 | | } |
| | | 482 | | |
| | 1088508 | 483 | | if (!TryGetNextChar(out c)) |
| | 72 | 484 | | { |
| | 72 | 485 | | token = default; |
| | 72 | 486 | | return false; |
| | | 487 | | } |
| | 1088436 | 488 | | } |
| | | 489 | | |
| | | 490 | | |
| | 52704 | 491 | | int length = sb.Length; |
| | 52704 | 492 | | if (quoteChar == 0) |
| | 52292 | 493 | | { |
| | 56736 | 494 | | while (length > 0 && IsWhiteSpace(sb[length - 1])) |
| | 4444 | 495 | | length--; |
| | 52292 | 496 | | } |
| | | 497 | | |
| | 52704 | 498 | | tokenString = sb.AsSpan(0, length).ToString(); |
| | 52704 | 499 | | token = Token.String; |
| | 52704 | 500 | | return true; |
| | 104700 | 501 | | } |
| | | 502 | | } |
| | | 503 | | } |
| | | 504 | | |