Skip to content

Commit

Permalink
Fix identifier parser regression (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienros authored Dec 9, 2024
1 parent b2f7808 commit 9d9dc58
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Parlot/Character.Class.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public static partial class Character
public const string AZ = AZLower + AZUpper;
public const string AlphaNumeric = AZ + DecimalDigits;
public const string DefaultIdentifierStart = "$_" + AZ;
public const string DefaultIdentifierPart = "$_" + AZ;
public const string DefaultIdentifierPart = "$_" + AZ + DecimalDigits;
public const string NewLines = "\n\r\v";
}
3 changes: 3 additions & 0 deletions test/Parlot.Tests/CompileTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@ public void ShouldCompileWhiteSpace()
[InlineData("$_", "$_")]
[InlineData("a-foo.", "a")]
[InlineData("abc=3", "abc")]
[InlineData("abc3", "abc3")]
[InlineData("abc123", "abc123")]
[InlineData("abc_3", "abc_3")]
public void CompiledIdentifierShouldParseValidIdentifiers(string text, string identifier)
{
Assert.Equal(identifier, Literals.Identifier().Compile().Parse(text).ToString());
Expand Down
3 changes: 3 additions & 0 deletions test/Parlot.Tests/FluentTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,9 @@ public void SwitchShouldReturnCommonType()
[InlineData("$_", "$_")]
[InlineData("a-foo.", "a")]
[InlineData("abc=3", "abc")]
[InlineData("abc3", "abc3")]
[InlineData("abc123", "abc123")]
[InlineData("abc_3", "abc_3")]
public void IdentifierShouldParseValidIdentifiers(string text, string identifier)
{
Assert.Equal(identifier, Literals.Identifier().Parse(text).ToString());
Expand Down

0 comments on commit 9d9dc58

Please sign in to comment.