Unfortunately, if the step preceding the comment ends with a variable, the pattern matcher gets greedy...
I would also like to be able to use comments between steps, and the only work-around I have currently is to avoid ending a step annotation with a variable - this doesn't always lead to natural prose!
Some solutions I can come up with:
1. add a commas or period followed by a new line to the syntax as step delimiters, e.g.
Given a comma or period after a $variable,
i can put a comment here without it being swallowed by the pattern matcher,
And i can proceed with the scenario.
2. provide regexp support in the step annotations, e.g.:
@Before("Given a step matching a variable at the end, like so: $([^\n]*)")
3. provide another mechanism for distinguishing between single and multi-line variables
4. add comment prefixes as suggested by the original post
Currently, comments can be placed in the scenario text file, either before the Scenario keyword, or as the description of the scenario, ie between the Scenario and the first of the other keywords.