| | | 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[] |
| | 7156 | 21 | | { |
| | 7156 | 22 | | _name = name; |
| | 7156 | 23 | | _version = version; |
| | 7156 | 24 | | _cultureName = cultureName; |
| | 7156 | 25 | | _flags = flags; |
| | 7156 | 26 | | _publicKeyOrToken = publicKeyOrToken; |
| | 7156 | 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) |
| | 11140 | 61 | | { |
| | | 62 | | #if SYSTEM_PRIVATE_CORELIB |
| | | 63 | | if (input.Length == 0) |
| | | 64 | | throw new ArgumentException(SR.Format_StringZeroLength); |
| | | 65 | | #else |
| | 11140 | 66 | | Debug.Assert(input.Length > 0); |
| | | 67 | | #endif |
| | | 68 | | |
| | 11140 | 69 | | _input = input; |
| | 11140 | 70 | | _index = 0; |
| | 11140 | 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) |
| | 11140 | 89 | | { |
| | 11140 | 90 | | AssemblyNameParser parser = new(name); |
| | 11140 | 91 | | return parser.TryParse(ref parts); |
| | 11140 | 92 | | } |
| | | 93 | | |
| | | 94 | | private static bool TryRecordNewSeen(scoped ref AttributeKind seenAttributes, AttributeKind newAttribute) |
| | 0 | 95 | | { |
| | 0 | 96 | | if ((seenAttributes & newAttribute) != 0) |
| | 0 | 97 | | { |
| | 0 | 98 | | return false; |
| | | 99 | | } |
| | 0 | 100 | | seenAttributes |= newAttribute; |
| | 0 | 101 | | return true; |
| | 0 | 102 | | } |
| | | 103 | | |
| | | 104 | | private bool TryParse(ref AssemblyNameParts result) |
| | 11140 | 105 | | { |
| | | 106 | | // Name must come first. |
| | 11140 | 107 | | if (!TryGetNextToken(out string name, out Token token) || token != Token.String || string.IsNullOrEmpty(name |
| | 1144 | 108 | | return false; |
| | | 109 | | |
| | 9996 | 110 | | Version? version = null; |
| | 9996 | 111 | | string? cultureName = null; |
| | 9996 | 112 | | byte[]? pkt = null; |
| | 9996 | 113 | | AssemblyNameFlags flags = 0; |
| | | 114 | | |
| | 9996 | 115 | | AttributeKind alreadySeen = default; |
| | 9996 | 116 | | if (!TryGetNextToken(out _, out token)) |
| | 52 | 117 | | return false; |
| | | 118 | | |
| | 24920 | 119 | | while (token != Token.End) |
| | 17764 | 120 | | { |
| | 17764 | 121 | | if (token != Token.Comma) |
| | 104 | 122 | | return false; |
| | | 123 | | |
| | 17660 | 124 | | if (!TryGetNextToken(out string attributeName, out token) || token != Token.String) |
| | 560 | 125 | | return false; |
| | | 126 | | |
| | 17100 | 127 | | if (!TryGetNextToken(out _, out token) || token != Token.Equals) |
| | 1936 | 128 | | return false; |
| | | 129 | | |
| | 15164 | 130 | | if (!TryGetNextToken(out string attributeValue, out token) || token != Token.String) |
| | 148 | 131 | | return false; |
| | | 132 | | |
| | 15016 | 133 | | if (attributeName == string.Empty) |
| | 4 | 134 | | return false; |
| | | 135 | | |
| | 15012 | 136 | | if (IsAttribute(attributeName, "Version")) |
| | 0 | 137 | | { |
| | 0 | 138 | | if (!TryRecordNewSeen(ref alreadySeen, AttributeKind.Version)) |
| | 0 | 139 | | { |
| | 0 | 140 | | return false; |
| | | 141 | | } |
| | 0 | 142 | | if (!TryParseVersion(attributeValue, ref version)) |
| | 0 | 143 | | { |
| | 0 | 144 | | return false; |
| | | 145 | | } |
| | 0 | 146 | | } |
| | 15012 | 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 | | } |
| | 15012 | 158 | | else if (IsAttribute(attributeName, "PublicKeyToken")) |
| | 0 | 159 | | { |
| | 0 | 160 | | if (!TryRecordNewSeen(ref alreadySeen, AttributeKind.PublicKeyOrToken)) |
| | 0 | 161 | | { |
| | 0 | 162 | | return false; |
| | | 163 | | } |
| | 0 | 164 | | if (!TryParsePKT(attributeValue, isToken: true, out pkt)) |
| | 0 | 165 | | { |
| | 0 | 166 | | return false; |
| | | 167 | | } |
| | 0 | 168 | | } |
| | 15012 | 169 | | else if (IsAttribute(attributeName, "PublicKey")) |
| | 0 | 170 | | { |
| | 0 | 171 | | if (!TryRecordNewSeen(ref alreadySeen, AttributeKind.PublicKeyOrToken)) |
| | 0 | 172 | | { |
| | 0 | 173 | | return false; |
| | | 174 | | } |
| | 0 | 175 | | if (!TryParsePKT(attributeValue, isToken: false, out pkt)) |
| | 0 | 176 | | { |
| | 0 | 177 | | return false; |
| | | 178 | | } |
| | 0 | 179 | | flags |= AssemblyNameFlags.PublicKey; |
| | 0 | 180 | | } |
| | 15012 | 181 | | else if (IsAttribute(attributeName, "ProcessorArchitecture")) |
| | 0 | 182 | | { |
| | 0 | 183 | | if (!TryRecordNewSeen(ref alreadySeen, AttributeKind.ProcessorArchitecture)) |
| | 0 | 184 | | { |
| | 0 | 185 | | return false; |
| | | 186 | | } |
| | 0 | 187 | | if (!TryParseProcessorArchitecture(attributeValue, out ProcessorArchitecture arch)) |
| | 0 | 188 | | { |
| | 0 | 189 | | return false; |
| | | 190 | | } |
| | 0 | 191 | | flags |= (AssemblyNameFlags)(((int)arch) << 4); |
| | 0 | 192 | | } |
| | 15012 | 193 | | else if (IsAttribute(attributeName, "Retargetable")) |
| | 0 | 194 | | { |
| | 0 | 195 | | if (!TryRecordNewSeen(ref alreadySeen, AttributeKind.Retargetable)) |
| | 0 | 196 | | { |
| | 0 | 197 | | return false; |
| | | 198 | | } |
| | | 199 | | |
| | 0 | 200 | | if (attributeValue.Equals("Yes", StringComparison.OrdinalIgnoreCase)) |
| | 0 | 201 | | { |
| | 0 | 202 | | flags |= AssemblyNameFlags.Retargetable; |
| | 0 | 203 | | } |
| | 0 | 204 | | else if (attributeValue.Equals("No", StringComparison.OrdinalIgnoreCase)) |
| | 0 | 205 | | { |
| | | 206 | | // nothing to do |
| | 0 | 207 | | } |
| | | 208 | | else |
| | 0 | 209 | | { |
| | 0 | 210 | | return false; |
| | | 211 | | } |
| | 0 | 212 | | } |
| | 15012 | 213 | | else if (IsAttribute(attributeName, "ContentType")) |
| | 0 | 214 | | { |
| | 0 | 215 | | if (!TryRecordNewSeen(ref alreadySeen, AttributeKind.ContentType)) |
| | 0 | 216 | | { |
| | 0 | 217 | | return false; |
| | | 218 | | } |
| | | 219 | | |
| | 0 | 220 | | if (attributeValue.Equals("WindowsRuntime", StringComparison.OrdinalIgnoreCase)) |
| | 0 | 221 | | { |
| | 0 | 222 | | flags |= (AssemblyNameFlags)(((int)AssemblyContentType.WindowsRuntime) << 9); |
| | 0 | 223 | | } |
| | | 224 | | else |
| | 0 | 225 | | { |
| | 0 | 226 | | return false; |
| | | 227 | | } |
| | 0 | 228 | | } |
| | | 229 | | else |
| | 15012 | 230 | | { |
| | | 231 | | // Desktop compat: If we got here, the attribute name is unknown to us. Ignore it. |
| | 15012 | 232 | | } |
| | | 233 | | |
| | 15012 | 234 | | if (!TryGetNextToken(out _, out token)) |
| | 36 | 235 | | { |
| | 36 | 236 | | return false; |
| | | 237 | | } |
| | 14976 | 238 | | } |
| | | 239 | | |
| | 7156 | 240 | | result = new AssemblyNameParts(name, version, cultureName, flags, pkt); |
| | 7156 | 241 | | return true; |
| | 11140 | 242 | | } |
| | | 243 | | |
| | | 244 | | private static bool IsAttribute(string candidate, string attributeKind) |
| | 105084 | 245 | | => candidate.Equals(attributeKind, StringComparison.OrdinalIgnoreCase); |
| | | 246 | | |
| | | 247 | | private static unsafe bool TryParseVersion(string attributeValue, ref Version? version) |
| | 0 | 248 | | { |
| | | 249 | | #if NET |
| | 0 | 250 | | ReadOnlySpan<char> attributeValueSpan = attributeValue; |
| | 0 | 251 | | Span<Range> parts = stackalloc Range[5]; |
| | 0 | 252 | | parts = parts.Slice(0, attributeValueSpan.Split(parts, '.')); |
| | | 253 | | #else |
| | | 254 | | string[] parts = attributeValue.Split('.'); |
| | | 255 | | #endif |
| | 0 | 256 | | if (parts.Length is < 2 or > 4) |
| | 0 | 257 | | { |
| | 0 | 258 | | return false; |
| | | 259 | | } |
| | | 260 | | |
| | 0 | 261 | | Span<ushort> versionNumbers = [ushort.MaxValue, ushort.MaxValue, ushort.MaxValue, ushort.MaxValue]; |
| | 0 | 262 | | for (int i = 0; i < parts.Length; i++) |
| | 0 | 263 | | { |
| | 0 | 264 | | if (!ushort.TryParse( |
| | 0 | 265 | | #if NET |
| | 0 | 266 | | attributeValueSpan[parts[i]], |
| | 0 | 267 | | #else |
| | 0 | 268 | | parts[i], |
| | 0 | 269 | | #endif |
| | 0 | 270 | | NumberStyles.None, NumberFormatInfo.InvariantInfo, out versionNumbers[i])) |
| | 0 | 271 | | { |
| | 0 | 272 | | return false; |
| | | 273 | | } |
| | 0 | 274 | | } |
| | | 275 | | |
| | 0 | 276 | | if (versionNumbers[0] == ushort.MaxValue || |
| | 0 | 277 | | versionNumbers[1] == ushort.MaxValue) |
| | 0 | 278 | | { |
| | 0 | 279 | | return false; |
| | | 280 | | } |
| | | 281 | | |
| | 0 | 282 | | version = |
| | 0 | 283 | | versionNumbers[2] == ushort.MaxValue ? new Version(versionNumbers[0], versionNumbers[1]) : |
| | 0 | 284 | | versionNumbers[3] == ushort.MaxValue ? new Version(versionNumbers[0], versionNumbers[1], versionNumbers[ |
| | 0 | 285 | | new Version(versionNumbers[0], versionNumbers[1], versionNumbers[2], versionNumbers[3]); |
| | | 286 | | |
| | 0 | 287 | | return true; |
| | 0 | 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) |
| | 0 | 303 | | { |
| | 0 | 304 | | if (attributeValue.Equals("null", StringComparison.OrdinalIgnoreCase) || attributeValue == string.Empty) |
| | 0 | 305 | | { |
| | 0 | 306 | | result = []; |
| | 0 | 307 | | return true; |
| | | 308 | | } |
| | | 309 | | |
| | 0 | 310 | | if (attributeValue.Length % 2 != 0 || (isToken && attributeValue.Length != 8 * 2)) |
| | 0 | 311 | | { |
| | 0 | 312 | | result = null; |
| | 0 | 313 | | return false; |
| | | 314 | | } |
| | | 315 | | |
| | 0 | 316 | | byte[] pkt = new byte[attributeValue.Length / 2]; |
| | 0 | 317 | | if (!HexConverter.TryDecodeFromUtf16(attributeValue.AsSpan(), pkt, out int _)) |
| | 0 | 318 | | { |
| | 0 | 319 | | result = null; |
| | 0 | 320 | | return false; |
| | | 321 | | } |
| | | 322 | | |
| | 0 | 323 | | result = pkt; |
| | 0 | 324 | | return true; |
| | 0 | 325 | | } |
| | | 326 | | |
| | | 327 | | private static bool TryParseProcessorArchitecture(string attributeValue, out ProcessorArchitecture result) |
| | 0 | 328 | | { |
| | 0 | 329 | | result = attributeValue switch |
| | 0 | 330 | | { |
| | 0 | 331 | | _ when attributeValue.Equals("msil", StringComparison.OrdinalIgnoreCase) => ProcessorArchitecture.MSIL, |
| | 0 | 332 | | _ when attributeValue.Equals("x86", StringComparison.OrdinalIgnoreCase) => ProcessorArchitecture.X86, |
| | 0 | 333 | | _ when attributeValue.Equals("ia64", StringComparison.OrdinalIgnoreCase) => ProcessorArchitecture.IA64, |
| | 0 | 334 | | _ when attributeValue.Equals("amd64", StringComparison.OrdinalIgnoreCase) => ProcessorArchitecture.Amd64 |
| | 0 | 335 | | _ when attributeValue.Equals("arm", StringComparison.OrdinalIgnoreCase) => ProcessorArchitecture.Arm, |
| | 0 | 336 | | _ => ProcessorArchitecture.None |
| | 0 | 337 | | }; |
| | 0 | 338 | | return result != ProcessorArchitecture.None; |
| | 0 | 339 | | } |
| | | 340 | | |
| | | 341 | | private static bool IsWhiteSpace(char ch) |
| | 97260 | 342 | | => ch is '\n' or '\r' or ' ' or '\t'; |
| | | 343 | | |
| | | 344 | | [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| | | 345 | | private bool TryGetNextChar(out char ch) |
| | 873844 | 346 | | { |
| | 873844 | 347 | | if (_index < _input.Length) |
| | 858528 | 348 | | { |
| | 858528 | 349 | | ch = _input[_index++]; |
| | 858528 | 350 | | if (ch == '\0') |
| | 568 | 351 | | { |
| | 568 | 352 | | return false; |
| | | 353 | | } |
| | 857960 | 354 | | } |
| | | 355 | | else |
| | 15316 | 356 | | { |
| | 15316 | 357 | | ch = '\0'; |
| | 15316 | 358 | | } |
| | | 359 | | |
| | 873276 | 360 | | return true; |
| | 873844 | 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) |
| | 86072 | 368 | | { |
| | 86072 | 369 | | tokenString = string.Empty; |
| | | 370 | | char c; |
| | | 371 | | |
| | 90580 | 372 | | while (true) |
| | 90580 | 373 | | { |
| | 90580 | 374 | | if (!TryGetNextChar(out c)) |
| | 244 | 375 | | { |
| | 244 | 376 | | token = default; |
| | 244 | 377 | | return false; |
| | | 378 | | } |
| | | 379 | | |
| | 90336 | 380 | | switch (c) |
| | | 381 | | { |
| | | 382 | | case ',': |
| | 18980 | 383 | | { |
| | 18980 | 384 | | token = Token.Comma; |
| | 18980 | 385 | | return true; |
| | | 386 | | } |
| | | 387 | | case '=': |
| | 15264 | 388 | | { |
| | 15264 | 389 | | token = Token.Equals; |
| | 15264 | 390 | | return true; |
| | | 391 | | } |
| | | 392 | | case '\0': |
| | 8280 | 393 | | { |
| | 8280 | 394 | | token = Token.End; |
| | 8280 | 395 | | return true; |
| | | 396 | | } |
| | | 397 | | } |
| | | 398 | | |
| | 47812 | 399 | | if (!IsWhiteSpace(c)) |
| | 43304 | 400 | | { |
| | 43304 | 401 | | break; |
| | | 402 | | } |
| | 4508 | 403 | | } |
| | | 404 | | |
| | 43304 | 405 | | using ValueStringBuilder sb = new ValueStringBuilder(stackalloc char[64]); |
| | | 406 | | |
| | 43304 | 407 | | char quoteChar = '\0'; |
| | 43304 | 408 | | if (c is '\'' or '\"') |
| | 1852 | 409 | | { |
| | 1852 | 410 | | quoteChar = c; |
| | 1852 | 411 | | if (!TryGetNextChar(out c)) |
| | 16 | 412 | | { |
| | 16 | 413 | | token = default; |
| | 16 | 414 | | return false; |
| | | 415 | | } |
| | 1836 | 416 | | } |
| | | 417 | | |
| | | 418 | | for (; ; ) |
| | 798228 | 419 | | { |
| | 798228 | 420 | | if (c == 0) |
| | 7004 | 421 | | { |
| | 7004 | 422 | | if (quoteChar != 0) |
| | 240 | 423 | | { |
| | | 424 | | // EOS and unclosed quotes is an error |
| | 240 | 425 | | token = default; |
| | 240 | 426 | | return false; |
| | | 427 | | } |
| | | 428 | | // Reached end of input and therefore of string |
| | 6764 | 429 | | break; |
| | | 430 | | } |
| | | 431 | | |
| | 791224 | 432 | | if (quoteChar != 0 && c == quoteChar) |
| | 1584 | 433 | | break; // Terminate: Found closing quote of quoted string. |
| | | 434 | | |
| | 789640 | 435 | | if (quoteChar == 0 && (c is ',' or '=')) |
| | 33876 | 436 | | { |
| | 33876 | 437 | | _index--; |
| | 33876 | 438 | | break; // Terminate: Found start of a new ',' or '=' token. |
| | | 439 | | } |
| | | 440 | | |
| | 755764 | 441 | | if (quoteChar == 0 && (c is '\'' or '\"')) |
| | 16 | 442 | | { |
| | 16 | 443 | | token = default; |
| | 16 | 444 | | return false; |
| | | 445 | | } |
| | | 446 | | |
| | 755748 | 447 | | if (c is '\\') |
| | 26184 | 448 | | { |
| | 26184 | 449 | | if (!TryGetNextChar(out c)) |
| | 20 | 450 | | { |
| | 20 | 451 | | token = default; |
| | 20 | 452 | | return false; |
| | | 453 | | } |
| | | 454 | | |
| | 26164 | 455 | | switch (c) |
| | | 456 | | { |
| | | 457 | | case '\\': |
| | | 458 | | case ',': |
| | | 459 | | case '=': |
| | | 460 | | case '\'': |
| | | 461 | | case '"': |
| | 21264 | 462 | | sb.Append(c); |
| | 21264 | 463 | | break; |
| | | 464 | | case 't': |
| | 1300 | 465 | | sb.Append('\t'); |
| | 1300 | 466 | | break; |
| | | 467 | | case 'r': |
| | 1252 | 468 | | sb.Append('\r'); |
| | 1252 | 469 | | break; |
| | | 470 | | case 'n': |
| | 1848 | 471 | | sb.Append('\n'); |
| | 1848 | 472 | | break; |
| | | 473 | | default: |
| | 500 | 474 | | token = default; |
| | 500 | 475 | | return false; |
| | | 476 | | } |
| | 25664 | 477 | | } |
| | | 478 | | else |
| | 729564 | 479 | | { |
| | 729564 | 480 | | sb.Append(c); |
| | 729564 | 481 | | } |
| | | 482 | | |
| | 755228 | 483 | | if (!TryGetNextChar(out c)) |
| | 288 | 484 | | { |
| | 288 | 485 | | token = default; |
| | 288 | 486 | | return false; |
| | | 487 | | } |
| | 754940 | 488 | | } |
| | | 489 | | |
| | | 490 | | |
| | 42224 | 491 | | int length = sb.Length; |
| | 42224 | 492 | | if (quoteChar == 0) |
| | 40640 | 493 | | { |
| | 49528 | 494 | | while (length > 0 && IsWhiteSpace(sb[length - 1])) |
| | 8888 | 495 | | length--; |
| | 40640 | 496 | | } |
| | | 497 | | |
| | 42224 | 498 | | tokenString = sb.AsSpan(0, length).ToString(); |
| | 42224 | 499 | | token = Token.String; |
| | 42224 | 500 | | return true; |
| | 86072 | 501 | | } |
| | | 502 | | } |
| | | 503 | | } |
| | | 504 | | |