Skip to content

Commit

Permalink
fix: #219
Browse files Browse the repository at this point in the history
  • Loading branch information
alirezanet committed Oct 30, 2024
1 parent 0e8645c commit 45b75c3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Gridify/Syntax/Lexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public SyntaxToken NextToken()
{
var start = _position;

while (char.IsLetterOrDigit(Current) || Current is '_' || Current is '.')
while (char.IsLetterOrDigit(Current) || Current is '_' || Current is '.' || Current is '-')
Next();

var length = _position - start;
Expand Down
17 changes: 17 additions & 0 deletions test/Gridify.Tests/IssueTests/Issue219Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Linq;
using FluentAssertions;
using Gridify.Syntax;
using Xunit;

namespace Gridify.Tests.IssueTests;

public class Issue219Tests
{
[Fact]
private void FieldNameWithDashShouldWork()
{
var syntaxTree = SyntaxTree.Parse("property-name = value");
syntaxTree.Diagnostics.Should().BeEmpty();
syntaxTree.Root.GetChildren().First().Should().BeOfType<FieldExpressionSyntax>();
}
}

0 comments on commit 45b75c3

Please sign in to comment.