-
Notifications
You must be signed in to change notification settings - Fork 20
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 supported characters in Tags #30
Conversation
FCM
|
src/parser.rs
Outdated
@@ -415,7 +420,8 @@ rule scenario() -> Scenario | |||
rule tag_char() -> &'input str | |||
= s:$([_]) {? | |||
let x = s.chars().next().unwrap(); | |||
if x.is_alphanumeric() || x == '_' || x == '-' { | |||
// `)` isn't allowed, as it would collide with TagExpression. | |||
if !x.is_whitespace() && !"\r\n@)".contains(x) { |
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.
\r
, \n
and even \t
are covered by .is_whitespace()
already.
src/parser.rs
Outdated
@@ -415,7 +420,8 @@ rule scenario() -> Scenario | |||
rule tag_char() -> &'input str | |||
= s:$([_]) {? | |||
let x = s.chars().next().unwrap(); | |||
if x.is_alphanumeric() || x == '_' || x == '-' { | |||
// `)` isn't allowed, as it would collide with TagExpression. |
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.
As far as I see in reference implemetation, we should support it.
Maybe this should be resolved by escaping in TagExpression
?
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.
@tyranron somewhere buried in separate github repo, there is mentioning of escaping https://github.com/cucumber/tag-expressions#escaping
Resolves cucumber-rs/cucumber#174, cucumber-rs/cucumber#175
Synopsis
Despite nowhere to be documented, it looks like
.
can be present inTag
s.Solution
Support any non-whitespace character, excluding
@
and)
, as seen here.Checklist
Draft:
prefixDraft:
prefix is removed