Hi there, I am using the gherkin library to parse a .feature file into a GherkinDocument.
// JavaScript
var Gherkin = require('@cucumber/gherkin')
var Messages = require('@cucumber/messages')
var uuidFn = Messages.IdGenerator.uuid()
var builder = new Gherkin.AstBuilder(uuidFn)
var matcher = new Gherkin.GherkinClassicTokenMatcher() // or Gherkin.GherkinInMarkdownTokenMatcher()
var parser = new Gherkin.Parser(builder, matcher)
var gherkinDocument = parser.parse('Feature: ...')
var pickles = Gherkin.compile(gherkinDocument, 'uri_of_the_feature.feature', uuidFn)
I'll like to be able to save the file ast back as a feature but I can't find any function that allows me to do so.
Hi there, I am using the gherkin library to parse a .feature file into a GherkinDocument. // JavaScript var Gherkin = require('@cucumber/gherkin') var Messages = require('@cucumber/messages')
var uuidFn = Messages.IdGenerator.uuid() var builder = new Gherkin.AstBuilder(uuidFn) var matcher = new Gherkin.GherkinClassicTokenMatcher() // or Gherkin.GherkinInMarkdownTokenMatcher()
var parser = new Gherkin.Parser(builder, matcher) var gherkinDocument = parser.parse('Feature: ...') var pickles = Gherkin.compile(gherkinDocument, 'uri_of_the_feature.feature', uuidFn)
I'll like to be able to save the file ast back as a feature but I can't find any function that allows me to do so.