bdmac/turnip — comment on commit a3994a991b21929e4e2b1353bbdadc4ac622482d
File: lib/turnip/builder.rb line 109
By bdmac:

I'm not a big fan of how this is done currently. I couldn't figure out any better way at getting to what I needed though. The i18n_language is available directly from the Gherkin parser but not until AFTER it has parsed the file. By that time we've already built up all our steps in Turnip and would have to go back through them all in a 2nd pass or something.

I poked around in the Gherkin source and found that I could get the lexer to determine/set the i18n_language without a full parse by calling the private create_delegate method with the file's contents.