Skip to content

Commit 5cfda71

Browse files
committed
Add common char sets
1 parent a4b74f2 commit 5cfda71

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

src/Parlot/Character.Class.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace Parlot;
2+
3+
public static partial class Character
4+
{
5+
public const string DecimalDigits = "0123456789";
6+
public const string HexDigits = "0123456789abcdefABCDEF";
7+
public const string OctalDigits = "01234567";
8+
public const string BinaryDigits = "01";
9+
10+
public const string AZLower = "abcdefghijklmnopqrstuvwxyz";
11+
public const string AZUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
12+
public const string AZ = AZLower + AZUpper;
13+
public const string AlphaNumeric = AZ + DecimalDigits;
14+
public const string DefaultIdentifierStart = "$_" + AZ;
15+
public const string DefaultIdentifierPart = "$_" + AZ;
16+
public const string NewLines = "\n\r\v";
17+
}

src/Parlot/Character.SearchValues.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ namespace Parlot;
66

77
public static partial class Character
88
{
9-
internal const string DecimalDigits = "0123456789";
10-
internal const string Alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
11-
internal const string AlphaNumeric = Alpha + DecimalDigits;
12-
internal const string DefaultIdentifierStart = "$_" + Alpha;
13-
internal const string DefaultIdentifierPart = "$_" + AlphaNumeric;
14-
internal const string HexDigits = "0123456789abcdefABCDEF";
15-
internal const string NewLines = "\n\r\v";
16-
179
internal static readonly SearchValues<char> _decimalDigits = SearchValues.Create(DecimalDigits);
1810
internal static readonly SearchValues<char> _hexDigits = SearchValues.Create(HexDigits);
1911
internal static readonly SearchValues<char> _identifierStart = SearchValues.Create(DefaultIdentifierStart);

0 commit comments

Comments
 (0)