-
Notifications
You must be signed in to change notification settings - Fork 125
AST for Example Placeholders and implicit Step Parameters #26
Comments
Example placeholders: It would be hard to fit this to the current parser concept. But the compiler will do this (see #12) Implicit/default step parameters: they are only heuristics and the exact parameters cannot be inferred automatically by analyzing the text. So I think these should not be parsed by gehrkin3. |
Agree. The presence of a number or double quotes doesn't imply parameters. It's just a convention that Cucumber uses when it generates step definitions. I often use parameters without quotes - because I think it reads better. Of course, Cucumber isn't able to guess where the params are when it prints a stepdef snippet, but that's fine - I'll just write the regexp by hand. |
Regarding representing Did we answer your questions @muhqu ? |
I agree that handling quotes and numerics in the Step text is beyond the scope of what the gherkin parser should deal with. But I think it would be a great (if not mandatory) addition to represent I'm not that sure I understand what the 'compiler' is all about yet. But if one use case for it would be to transform the gherkin AST to something more generic, e.g. flattening Scenario Outlines, it would be helpful if the AST represents the placeholders. @aslakhellesoy yea, sure it answers my question. |
I was wondering why the gherkin parser doesn't parse example-placeholders e.g.
<name>
or implicit/default step parameters e.g. numerics or quoted strings...Sure, I understand that the interpretation of the Step's text is not part of gherkin, but that of the step definition provider or test suite runner (e.g. cucumber, behat etc...). But I think it would be good for tools like linters, syntax highlighters, etc to identify all meaningful parts of the gherkin file...
Also example placeholders could be verified against the examples table headers.
What do you think?
…here are some examples
The text was updated successfully, but these errors were encountered: