-
Notifications
You must be signed in to change notification settings - Fork 116
Add support for Tag Expressions #911
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
Open
clrudolphi
wants to merge
28
commits into
main
Choose a base branch
from
Exploratory_TagExpression_Support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 14 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
44fd54a
Initial commit. This adds support for tag exprssions on Scopes assign…
clrudolphi 416be89
Fix an issue in which the BindingProviderService (as invoked OOP and …
clrudolphi bf7d969
Merge branch 'main' into Exploratory_TagExpression_Support
clrudolphi 20b0f08
Draft update to the documentation on the topic of tag expressions
clrudolphi 71e6fcc
File scope namespace for the ReqnrollTagExpressionParser.
clrudolphi cf3a071
Merge branch 'Documentation_for_Tag_Expressions' into Exploratory_Tag…
clrudolphi 467c8da
Merge branch 'main' into Exploratory_TagExpression_Support
clrudolphi 7033a85
Added nuget package reference to Cucumber.TagExpressions; dropping th…
clrudolphi 193f22c
Merge branch 'main' into Exploratory_TagExpression_Support
clrudolphi d6cbd0a
Update CHANGELOG.md
clrudolphi 67103d0
Merge branch 'main' into Exploratory_TagExpression_Support
304NotModified 259e77b
Update CHANGELOG.md
304NotModified 8e44510
code cleanup
gasparnagy 4d45031
Merge remote-tracking branch 'origin/main' into Exploratory_TagExpres…
gasparnagy d827d4d
Changes per review comments:
clrudolphi 98946cf
Update scoped-bindings.md
clrudolphi 7246af2
code cleanup
gasparnagy 80b5986
fix BindingProviderService to work with empty Tag
gasparnagy f7dd139
Wrapping tag parsing errors in a new type of ITagExpression which dri…
clrudolphi 1627faa
Merge branch 'main' into Exploratory_TagExpression_Support
clrudolphi 5d060d7
Updated tests.
clrudolphi 4403a3e
Added properties to surface tag expression errors via BindingSourcePr…
clrudolphi ec0263a
Refactored tag expression support with addition of a ReqnollTagExpres…
clrudolphi fa433c4
Fix ReqnrollTagExpression missing ToString() override
clrudolphi d472a88
Merge branch 'main' into Exploratory_TagExpression_Support
clrudolphi 813d9c2
small fixes
gasparnagy 74dfbc3
Merge remote-tracking branch 'origin/main' into Exploratory_TagExpres…
gasparnagy e9566b4
Adjusted acceptance test file for tag-expressions Formatters test sce…
clrudolphi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
Reqnroll/Bindings/Discovery/ReqnrollTagExpressionParser.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| using Cucumber.TagExpressions; | ||
| using System; | ||
|
|
||
| namespace Reqnroll.Bindings.Discovery; | ||
|
|
||
| public class ReqnrollTagExpressionParser(ITagExpressionParser tagExpressionParser) : ITagExpressionParser | ||
| { | ||
| public ITagExpression Parse(string tagExpression) | ||
| { | ||
| return Rewrite(tagExpressionParser.Parse(tagExpression)); | ||
| } | ||
|
|
||
| private ITagExpression Rewrite(ITagExpression expression) | ||
| { | ||
| return expression switch | ||
| { | ||
| NullExpression nullExpression => nullExpression, | ||
| NotNode notNode => new NotNode(Rewrite(notNode.Operand)), | ||
| BinaryOpNode binaryOpNode => new BinaryOpNode(binaryOpNode.Op, Rewrite(binaryOpNode.Left), Rewrite(binaryOpNode.Right)), | ||
| LiteralNode literalNode => new LiteralNode(PrefixLiteral(literalNode.Name)), | ||
| _ => throw new NotSupportedException($"Unsupported tag expression type: {expression.GetType().FullName}"), | ||
| }; | ||
| } | ||
|
|
||
| private string PrefixLiteral(string name) | ||
| { | ||
| if (name.IsNullOrEmpty() ) | ||
| return name; | ||
| if (name.StartsWith("@")) | ||
| return name; | ||
| return "@" + name; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.