-
-
Notifications
You must be signed in to change notification settings - Fork 10
Add Dotnet Implementation #219
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
Conversation
Fixed a problem when the input tag text is null.
gasparnagy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super. Looks good, I have made a few smaller comments.
| /// <exception cref="Exception">Always thrown to indicate a syntax error.</exception> | ||
| private void ThrowSyntaxError(string message) | ||
| { | ||
| throw new Exception($"Tag expression \"{_text}\" could not be parsed because of syntax error: {message}."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we make a specific exception type for tag expression errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I had meant to and forgotten.
luke-hill
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got to 15/27 items. Mainly non-poly stuff. Will get to others alter
Changed Namespaces. Added custom exception type. Include position information in Token. Corrected namespaces in Test project. Nullable by default. Readme.md now includes a nuget badge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a .NET implementation of tag expressions for Cucumber, enabling parsing and evaluation of logical tag expressions in .NET projects. The implementation follows the existing tag-expressions specification and includes comprehensive test coverage using YAML-based test data.
- Implements a complete tag expression parser with lexer, parser, and AST nodes
- Adds NuGet package configuration for distribution
- Includes extensive test suite with unit tests and YAML-based acceptance tests
Reviewed Changes
Copilot reviewed 25 out of 27 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/TagExpressions/TagExpressionParser.cs | Core parser implementing recursive descent parsing for tag expressions |
| dotnet/TagExpressions/TagLexer.cs | Lexer for tokenizing tag expression strings |
| dotnet/TagExpressions/TagExpression.cs | AST node classes representing parsed expressions |
| dotnet/TagExpressions/TagToken.cs | Token types and token class for lexical analysis |
| dotnet/TagExpressions/ITagExpression.cs | Interface defining the tag expression contract |
| dotnet/TagExpressionsTest/ParsingTest.cs | YAML-based tests for parsing behavior |
| dotnet/TagExpressionsTest/EvaluationsTest.cs | YAML-based tests for expression evaluation |
| dotnet/TagExpressionsTest/ErrorsTest.cs | YAML-based tests for error handling |
| dotnet/TagExpressionsTest/TagLexerTests.cs | Unit tests for the lexer |
| dotnet/TagExpressionsTest/TestFolderHelper.cs | Helper utility to locate test data files |
| dotnet/TagExpressions/Cucumber.TagExpressions.csproj | NuGet package configuration |
| .github/workflows/test-dotnet.yml | CI workflow for .NET testing |
| .github/workflows/release-nuget.yaml | Release workflow for NuGet publishing |
Comments suppressed due to low confidence (1)
dotnet/TagExpressionsTest/TagLexerTests.cs:94
- Generic catch clause.
catch (Exception ex)
{
StringAssert.Contains(ex.Message, "Illegal escape");
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@clrudolphi please do take these into account: #222, #221. |
…ken ToString() should be empty string rather than "true").
@mpkorstanje This PR now matches the changes made in #221 and #222. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a glance it looks like you've made some implementation parts public. To make it easier to evolve the implementation - not that I expect much of it- it is generally nicer if the internal are kept internal. But I'm not a .Net expert so not 100% sure if that is actually the case.
Nitpicks aside, LGTM.
Feel free to merge. When you're happy.
Co-authored-by: M.P. Korstanje <[email protected]>
Thanks for looking it over. |
On short time frames anything works. Ideally I'd get you onboarded with https://github.com/cucumber/polyglot-release then you can release it yourself. |
gasparnagy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being late. It is fine.
🤔 What's changed?
Add a .NET implementation.
This uses a hand-written parser/evaluator.
Passes tests equivalent to those in the Java implementation using the same testdata.
⚡️ What's your motivation?
Eventual incorporation into Reqnroll.
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
Open to any feedback.
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.