Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix identifier parser regression #183

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading