Skip to content

Commit c11910b

Browse files
committed
Use char.IsAsciiDigit
1 parent 9b07170 commit c11910b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/D.Core/Numerics/Quantity`1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static Quantity<T> Wrap(T value)
7373

7474
public static Quantity<T> Parse(string text)
7575
{
76-
if ((char.IsDigit(text[0]) || text[0] is '-'))
76+
if ((char.IsAsciiDigit(text[0]) || text[0] is '-'))
7777
{
7878
var syntax = Parser.Parse(text);
7979

src/D.Core/Parsing/Tokenizer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Runtime.CompilerServices;
44
using System.Text;
5+
using System.Text.Encodings.Web;
56

67
namespace E.Parsing;
78

@@ -147,7 +148,7 @@ public Token Next()
147148
}
148149

149150
case '.': // ., .., ...
150-
if (char.IsDigit(reader.Peek())) // .{0-9}
151+
if (char.IsAsciiDigit(reader.Peek())) // .{0-9}
151152
{
152153
return Read(DecimalPoint);
153154
}
@@ -231,7 +232,7 @@ public Token Next()
231232

232233
break;
233234

234-
case '\n' or '\r' or '\t' or ' ':
235+
case '\n' or '\r' or '\t' or ' ':
235236
ReadTrivia();
236237
goto start;
237238
}
@@ -369,7 +370,6 @@ private void ReadDigits(ref ValueStringBuilder sb)
369370

370371
sb.Append(reader.Consume(s_digitOrUnderscoreChars));
371372
}
372-
373373

374374
public Token ReadSuperscript()
375375
{

0 commit comments

Comments
 (0)