Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is probably a stupid and/or rookie question, but I've spent quite a bit of time trying to figure it out, and getting nowhere...
I'm trying to create a Gherkin / Cucumber / BDD parser. For those unfamiliar, that means I have input which looks like...
There can be multiple Steps in a scenario, and multiple Scenarios in a Feature. Oh, and the keywords (
feature
,scenario
,given
etc) can be localised.I am trying to figure out how to parse the steps, and in particular, how to deal with cases where:
I have this
KeywordParser
,This can be used to parse input such as:
etc.
What I can't seem to figure out, is how to parse the input after the keyword delimiter to the end of the line which is retained in the model, and then any number of new line characters, or possibly the end of the input.
I tried all sorts combinations of
Optionally { }
either inside this parser, or inside the separator of aMany { }
parser (inside the Scenario Parser). But it seems that it just becomes greedy, and I end up with two steps where the 2nd one parses to the end of input.Any ideas? Feels like parsing to the end of the line should be a fairly easy and common task, and composing that into a
Many
should be just as straightforward, no?Feel like I'm missing something...
Beta Was this translation helpful? Give feedback.
All reactions