gherkin-4.0.0/0000755000004100000410000000000012706100344013167 5ustar www-datawww-datagherkin-4.0.0/Rakefile0000644000004100000410000000075712706100344014645 0ustar www-datawww-data# encoding: utf-8 require 'rubygems' require 'bundler' Bundler::GemHelper.install_tasks $:.unshift File.expand_path("../lib", __FILE__) require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) do |t| t.ruby_opts = %w[-r./spec/coverage -w] t.rspec_opts = %w[--color] end require_relative 'spec/capture_warnings' include CaptureWarnings namespace :spec do task :warnings do report_warnings do Rake::Task['spec'].invoke end end end task default: ['spec:warnings'] gherkin-4.0.0/bin/0000755000004100000410000000000012706100344013737 5ustar www-datawww-datagherkin-4.0.0/bin/gherkin-generate-tokens0000755000004100000410000000062212706100344020405 0ustar www-datawww-data#!/usr/bin/env ruby $VERBOSE=nil # Shut up JRuby warnings on Travis $LOAD_PATH.unshift(File.join(File.dirname(__FILE__),"../lib")) require 'gherkin/parser' require 'gherkin/token_formatter_builder' parser = Gherkin::Parser.new(Gherkin::TokenFormatterBuilder.new) files = ARGV + (STDIN.tty? ? [] : [STDIN]) files.each do |file| File.open(file, 'r:UTF-8') do |io| print parser.parse(io) end end gherkin-4.0.0/bin/gherkin-generate-pickles0000755000004100000410000000135412706100344020537 0ustar www-datawww-data#!/usr/bin/env ruby $VERBOSE=nil # Shut up JRuby warnings on Travis $LOAD_PATH.unshift(File.join(File.dirname(__FILE__),"../lib")) require 'gherkin/pickles/compiler' require 'gherkin/parser' require 'json' compiler = Gherkin::Pickles::Compiler.new parser = Gherkin::Parser.new parser.stop_at_first_error = false files = ARGV.any? ? ARGV : (STDIN.tty? ? [] : [STDIN]) start_time = Time.now files.each do |file| begin File.open(file, 'r:UTF-8') do |io| feature = parser.parse(io) pickles = compiler.compile(feature, file); puts JSON.generate(pickles) end rescue Gherkin::ParserError => e STDERR.puts e.message exit 1 end end end_time = Time.now STDERR.puts (end_time - start_time)*1000 if ENV['GHERKIN_PERF'] gherkin-4.0.0/bin/gherkin-generate-ast0000755000004100000410000000112612706100344017671 0ustar www-datawww-data#!/usr/bin/env ruby $VERBOSE=nil # Shut up JRuby warnings on Travis $LOAD_PATH.unshift(File.join(File.dirname(__FILE__),"../lib")) require 'gherkin/parser' require 'json' parser = Gherkin::Parser.new parser.stop_at_first_error = false files = ARGV.any? ? ARGV : (STDIN.tty? ? [] : [STDIN]) start_time = Time.now files.each do |file| begin File.open(file, 'r:UTF-8') do |io| puts JSON.generate(parser.parse(io)) end rescue Gherkin::ParserError => e STDERR.puts e.message exit 1 end end end_time = Time.now STDERR.puts (end_time - start_time)*1000 if ENV['GHERKIN_PERF'] gherkin-4.0.0/Gemfile0000644000004100000410000000004612706100344014462 0ustar www-datawww-datasource "https://rubygems.org" gemspec gherkin-4.0.0/spec/0000755000004100000410000000000012706100344014121 5ustar www-datawww-datagherkin-4.0.0/spec/coverage.rb0000644000004100000410000000037612706100344016247 0ustar www-datawww-datarequire 'simplecov' formatters = [ SimpleCov::Formatter::HTMLFormatter ] if ENV['TRAVIS'] require 'coveralls' formatters << Coveralls::SimpleCov::Formatter end SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[*formatters] SimpleCov.start gherkin-4.0.0/spec/capture_warnings.rb0000644000004100000410000000321612706100344020023 0ustar www-datawww-data# With thanks to @myronmarston # https://github.com/vcr/vcr/blob/master/spec/capture_warnings.rb module CaptureWarnings def report_warnings(&block) current_dir = Dir.pwd warnings, errors = capture_error(&block).partition { |line| line.include?('warning') } project_warnings, other_warnings = warnings.uniq.partition { |line| line.include?(current_dir) } if errors.any? puts errors.join("\n") end if other_warnings.any? puts "#{ other_warnings.count } non-gherkin warnings detected, set VIEW_OTHER_WARNINGS=true to see them." print_warnings('other', other_warnings) if ENV['VIEW_OTHER_WARNINGS'] end if project_warnings.any? puts "#{ project_warnings.count } gherkin warnings detected" print_warnings('gherkin', project_warnings) fail "Please remove all gherkin warnings." end ensure_system_exit_if_required end def capture_error(&block) old_stderr = STDERR.clone pipe_r, pipe_w = IO.pipe pipe_r.sync = true error = "" reader = Thread.new do begin loop do error << pipe_r.readpartial(1024) end rescue EOFError end end STDERR.reopen(pipe_w) block.call ensure capture_system_exit STDERR.reopen(old_stderr) pipe_w.close reader.join return error.split("\n") end def print_warnings(type, warnings) puts puts "-" * 30 + " #{type} warnings: " + "-" * 30 puts puts warnings.join("\n") puts puts "-" * 75 puts end def ensure_system_exit_if_required raise @system_exit if @system_exit end def capture_system_exit @system_exit = $! end end gherkin-4.0.0/spec/gherkin/0000755000004100000410000000000012706100344015550 5ustar www-datawww-datagherkin-4.0.0/spec/gherkin/parser_spec.rb0000644000004100000410000003023312706100344020404 0ustar www-datawww-datarequire 'gherkin/parser' require 'gherkin/token_scanner' require 'gherkin/token_matcher' require 'gherkin/ast_builder' require 'gherkin/errors' require 'rspec' module Gherkin describe Parser do it "parses a simple feature" do parser = Parser.new scanner = TokenScanner.new("Feature: test") ast = parser.parse(scanner) expect(ast).to eq({ feature: { type: :Feature, tags: [], location: {line: 1, column: 1}, language: "en", keyword: "Feature", name: "test", children: [] }, comments: [], type: :GherkinDocument }) end it "parses a complex feature" do # This should include every significant type of thing within the language feature_text = "@feature_tag\n" + "Feature: feature name\n" + " feature description\n" + "\n" + " Background: background name\n" + " background description\n" + " * a step\n" + "\n" + " @scenario_tag\n" + " Scenario: scenario name\n" + " scenario description\n" + " * a step with a table\n" + " | a table |\n" + "\n" + " @outline_tag\n" + " Scenario Outline: outline name\n" + " outline description\n" + " * a step with a doc string\n" + " \"\"\" content_type\n" + " lots of text\n" + " \"\"\"\n" + " # Random file comment\n" + " @example_tag\n" + " Examples: examples name\n" + " examples description\n" + " | param |\n" + " | value |\n" parser = Parser.new scanner = TokenScanner.new(feature_text) ast = parser.parse(scanner) expect(ast).to eq({ feature: {type: :Feature, tags: [{type: :Tag, location: {line: 1, column: 1}, name: "@feature_tag"}], location: {line: 2, column: 1}, language: "en", keyword: "Feature", name: "feature name", description: " feature description", children: [{type: :Background, location: {line: 5, column: 4}, keyword: "Background", name: "background name", description: " background description", steps: [{type: :Step, location: {line: 7, column: 5}, keyword: "* ", text: "a step"}]}, {type: :Scenario, tags: [{type: :Tag, location: {line: 9, column: 3}, name: "@scenario_tag"}], location: {line: 10, column: 3}, keyword: "Scenario", name: "scenario name", description: " scenario description", steps: [{type: :Step, location: {line: 12, column: 5}, keyword: "* ", text: "a step with a table", argument: {type: :DataTable, location: {line: 13, column: 7}, rows: [{type: :TableRow, location: {line: 13, column: 7}, cells: [{type: :TableCell, location: {line: 13, column: 9}, value: "a table"}]}]}}]}, {type: :ScenarioOutline, tags: [{type: :Tag, location: {line: 15, column: 3}, name: "@outline_tag"}], location: {line: 16, column: 3}, keyword: "Scenario Outline", name: "outline name", description: " outline description", steps: [{type: :Step, location: {line: 18, column: 5}, keyword: "* ", text: "a step with a doc string", argument: {type: :DocString, location: {line: 19, column: 7}, contentType: "content_type", content: " lots of text"}}], examples: [{type: :Examples, tags: [{type: :Tag, location: {line: 23, column: 3}, name: "@example_tag"}], location: {line: 24, column: 3}, keyword: "Examples", name: "examples name", description: " examples description", tableHeader: {type: :TableRow, location: {line: 26, column: 5}, cells: [{type: :TableCell, location: {line: 26, column: 7}, value: "param"}]}, tableBody: [{type: :TableRow, location: {line: 27, column: 5}, cells: [{type: :TableCell, location: {line: 27, column: 7}, value: "value"}]}]}]}], }, comments: [{type: :Comment, location: {line: 22, column: 1}, text: " # Random file comment"}], type: :GherkinDocument} ) end it "parses string feature" do parser = Parser.new ast = parser.parse("Feature: test") expect(ast).to eq({ feature: { type: :Feature, tags: [], location: {line: 1, column: 1}, language: "en", keyword: "Feature", name: "test", children: [] }, comments: [], type: :GherkinDocument }) end it "parses io feature" do parser = Parser.new ast = parser.parse(StringIO.new("Feature: test")) expect(ast).to eq({ feature: { type: :Feature, tags: [], location: {line: 1, column: 1}, language: "en", keyword: "Feature", name: "test", children: [] }, comments: [], type: :GherkinDocument }) end it "can parse multiple features" do parser = Parser.new ast1 = parser.parse(TokenScanner.new("Feature: test")) ast2 = parser.parse(TokenScanner.new("Feature: test2")) expect(ast1).to eq({ feature: { type: :Feature, tags: [], location: {line: 1, column: 1}, language: "en", keyword: "Feature", name: "test", children: [] }, comments: [], type: :GherkinDocument }) expect(ast2).to eq({ feature: { type: :Feature, tags: [], location: {line: 1, column: 1}, language: "en", keyword: "Feature", name: "test2", children: [] }, comments: [], type: :GherkinDocument }) end it "can parse feature after parse error" do parser = Parser.new matcher = TokenMatcher.new expect { parser.parse(TokenScanner.new("# a comment\n" + "Feature: Foo\n" + " Scenario: Bar\n" + " Given x\n" + " ```\n" + " unclosed docstring\n"), matcher) }.to raise_error(ParserError) ast = parser.parse(TokenScanner.new("Feature: Foo\n" + " Scenario: Bar\n" + " Given x\n" + ' """' + "\n" + " closed docstring\n" + ' """' + "\n"), matcher) expect(ast).to eq({ feature: { type: :Feature, tags: [], location: {line: 1, column: 1}, language: "en", keyword: "Feature", name: "Foo", children: [{ :type=>:Scenario, :tags=>[], :location=>{:line=>2, :column=>3}, :keyword=>"Scenario", :name=>"Bar", :steps=>[{ :type=>:Step, :location=>{:line=>3, :column=>5}, :keyword=>"Given ", :text=>"x", :argument=>{:type=>:DocString, :location=>{:line=>4, :column=>7}, :content=>"closed docstring"}}]}] }, comments: [], type: :GherkinDocument }) end it "can change the default language" do parser = Parser.new matcher = TokenMatcher.new("no") scanner = TokenScanner.new("Egenskap: i18n support") ast = parser.parse(scanner, matcher) expect(ast).to eq({ feature: { type: :Feature, tags: [], location: {line: 1, column: 1}, language: "no", keyword: "Egenskap", name: "i18n support", children: [] }, comments: [], type: :GherkinDocument }) end end end gherkin-4.0.0/.travis.yml0000644000004100000410000000003312706100344015274 0ustar www-datawww-datalanguage: ruby sudo: false gherkin-4.0.0/gherkin.gemspec0000644000004100000410000000170012706100344016161 0ustar www-datawww-data# encoding: utf-8 Gem::Specification.new do |s| s.name = 'gherkin' s.version = '4.0.0' s.authors = ["Gáspár Nagy", "Aslak Hellesøy", "Steve Tooke"] s.description = 'Gherkin parser' s.summary = "gherkin-#{s.version}" s.email = 'cukes@googlegroups.com' s.homepage = "https://github.com/cucumber/gherkin" s.platform = Gem::Platform::RUBY s.license = "MIT" s.required_ruby_version = ">= 1.9.3" s.add_development_dependency 'bundler', '~> 1.7' s.add_development_dependency 'rake', '~> 10.4' s.add_development_dependency 'rspec', '~> 3.3' # For coverage reports s.add_development_dependency 'coveralls', '~> 0.8', '< 0.8.8' s.rubygems_version = ">= 1.6.1" s.files = `git ls-files`.split("\n").reject {|path| path =~ /\.gitignore$/ } s.test_files = `git ls-files -- spec/*`.split("\n") s.rdoc_options = ["--charset=UTF-8"] s.require_path = "lib" end gherkin-4.0.0/lib/0000755000004100000410000000000012706100344013735 5ustar www-datawww-datagherkin-4.0.0/lib/gherkin/0000755000004100000410000000000012706100344015364 5ustar www-datawww-datagherkin-4.0.0/lib/gherkin/token_formatter_builder.rb0000644000004100000410000000126612706100344022627 0ustar www-datawww-datamodule Gherkin class TokenFormatterBuilder def initialize reset end def reset @tokens_text = "" end def build(token) @tokens_text << "#{format_token(token)}\n" end def start_rule(rule_type) end def end_rule(rule_type) end def get_result @tokens_text end private def format_token(token) return "EOF" if token.eof? sprintf "(%s:%s)%s:%s/%s/%s", token.location[:line], token.location[:column], token.matched_type, token.matched_keyword, token.matched_text, Array(token.matched_items).map { |i| "#{i.column}:#{i.text}"}.join(',') end end end gherkin-4.0.0/lib/gherkin/errors.rb0000644000004100000410000000264512706100344017234 0ustar www-datawww-datamodule Gherkin class ParserError < StandardError; end class ParserException < ParserError attr_reader :location def initialize(message, location) @location = location super("(#{location[:line]}:#{location[:column] || 0}): #{message}") end end class NoSuchLanguageException < ParserException def initialize(language, location) super "Language not supported: #{language}", location end end class AstBuilderException < ParserException; end class CompositeParserException < ParserError attr_reader :errors def initialize(errors) @errors = errors super "Parser errors:\n" + errors.map(&:message).join("\n") end end class UnexpectedTokenException < ParserException def initialize(received_token, expected_token_types, state_comment) message = "expected: #{expected_token_types.join(", ")}, got '#{received_token.token_value.strip}'" column = received_token.location[:column] location = (column.nil? || column.zero?) ? {line: received_token.location[:line], column: received_token.line.indent + 1} : received_token.location super(message, location) end end class UnexpectedEOFException < ParserException def initialize(received_token, expected_token_types, state_comment) message = "unexpected end of file, expected: #{expected_token_types.join(", ")}" super(message, received_token.location) end end end gherkin-4.0.0/lib/gherkin/token_scanner.rb0000644000004100000410000000227612706100344020551 0ustar www-datawww-datarequire 'stringio' require 'gherkin/token' require 'gherkin/gherkin_line' module Gherkin # The scanner reads a gherkin doc (typically read from a .feature file) and # creates a token for line. The tokens are passed to the parser, which outputs # an AST (Abstract Syntax Tree). # # If the scanner sees a # language header, it will reconfigure itself dynamically # to look for Gherkin keywords for the associated language. The keywords are defined # in gherkin-languages.json. class TokenScanner def initialize(source_or_io) @line_number = 0 case(source_or_io) when String @io = StringIO.new(source_or_io) when StringIO, IO @io = source_or_io else fail ArgumentError, "Please a pass String, StringIO or IO. I got a #{source_or_io.class}" end end def read location = {line: @line_number += 1} if @io.nil? || line = @io.gets gherkin_line = line ? GherkinLine.new(line, location[:line]) : nil Token.new(gherkin_line, location) else @io.close unless @io.closed? # ARGF closes the last file after final gets @io = nil Token.new(nil, location) end end end end gherkin-4.0.0/lib/gherkin/parser.rb0000644000004100000410000024373212706100344017220 0ustar www-datawww-data# This file is generated. Do not edit! Edit gherkin-ruby.razor instead. require 'gherkin/ast_builder' require 'gherkin/token_matcher' require 'gherkin/token_scanner' require 'gherkin/errors' module Gherkin RULE_TYPE = [ :None, :_EOF, # #EOF :_Empty, # #Empty :_Comment, # #Comment :_TagLine, # #TagLine :_FeatureLine, # #FeatureLine :_BackgroundLine, # #BackgroundLine :_ScenarioLine, # #ScenarioLine :_ScenarioOutlineLine, # #ScenarioOutlineLine :_ExamplesLine, # #ExamplesLine :_StepLine, # #StepLine :_DocStringSeparator, # #DocStringSeparator :_TableRow, # #TableRow :_Language, # #Language :_Other, # #Other :GherkinDocument, # GherkinDocument! := Feature? :Feature, # Feature! := Feature_Header Background? Scenario_Definition* :Feature_Header, # Feature_Header! := #Language? Tags? #FeatureLine Feature_Description :Background, # Background! := #BackgroundLine Background_Description Scenario_Step* :Scenario_Definition, # Scenario_Definition! := Tags? (Scenario | ScenarioOutline) :Scenario, # Scenario! := #ScenarioLine Scenario_Description Scenario_Step* :ScenarioOutline, # ScenarioOutline! := #ScenarioOutlineLine ScenarioOutline_Description ScenarioOutline_Step* Examples_Definition* :Examples_Definition, # Examples_Definition! [#Empty|#Comment|#TagLine->#ExamplesLine] := Tags? Examples :Examples, # Examples! := #ExamplesLine Examples_Description Examples_Table? :Examples_Table, # Examples_Table! := #TableRow #TableRow* :Scenario_Step, # Scenario_Step := Step :ScenarioOutline_Step, # ScenarioOutline_Step := Step :Step, # Step! := #StepLine Step_Arg? :Step_Arg, # Step_Arg := (DataTable | DocString) :DataTable, # DataTable! := #TableRow+ :DocString, # DocString! := #DocStringSeparator #Other* #DocStringSeparator :Tags, # Tags! := #TagLine+ :Feature_Description, # Feature_Description := Description_Helper :Background_Description, # Background_Description := Description_Helper :Scenario_Description, # Scenario_Description := Description_Helper :ScenarioOutline_Description, # ScenarioOutline_Description := Description_Helper :Examples_Description, # Examples_Description := Description_Helper :Description_Helper, # Description_Helper := #Empty* Description? #Comment* :Description, # Description! := #Other+ ] class ParserContext attr_reader :token_scanner, :token_matcher, :token_queue, :errors def initialize(token_scanner, token_matcher, token_queue, errors) @token_scanner = token_scanner @token_matcher = token_matcher @token_queue = token_queue @errors = errors end end class Parser attr_accessor :stop_at_first_error def initialize(ast_builder=AstBuilder.new) @ast_builder = ast_builder end def parse(token_scanner, token_matcher=TokenMatcher.new) token_scanner = token_scanner.is_a?(TokenScanner) ? token_scanner : TokenScanner.new(token_scanner) @ast_builder.reset token_matcher.reset context = ParserContext.new( token_scanner, token_matcher, [], [] ) start_rule(context, :GherkinDocument); state = 0 token = nil begin token = read_token(context) state = match_token(state, token, context) end until(token.eof?) end_rule(context, :GherkinDocument) raise CompositeParserException.new(context.errors) if context.errors.any? get_result() end def build(context, token) handle_ast_error(context) do @ast_builder.build(token) end end def add_error(context, error) context.errors.push(error) raise CompositeParserException, context.errors if context.errors.length > 10 end def start_rule(context, rule_type) handle_ast_error(context) do @ast_builder.start_rule(rule_type) end end def end_rule(context, rule_type) handle_ast_error(context) do @ast_builder.end_rule(rule_type) end end def get_result() @ast_builder.get_result end def read_token(context) context.token_queue.any? ? context.token_queue.shift : context.token_scanner.read end def match_EOF( context, token) return handle_external_error(context, false) do context.token_matcher.match_EOF(token) end end def match_Empty( context, token) return false if token.eof? return handle_external_error(context, false) do context.token_matcher.match_Empty(token) end end def match_Comment( context, token) return false if token.eof? return handle_external_error(context, false) do context.token_matcher.match_Comment(token) end end def match_TagLine( context, token) return false if token.eof? return handle_external_error(context, false) do context.token_matcher.match_TagLine(token) end end def match_FeatureLine( context, token) return false if token.eof? return handle_external_error(context, false) do context.token_matcher.match_FeatureLine(token) end end def match_BackgroundLine( context, token) return false if token.eof? return handle_external_error(context, false) do context.token_matcher.match_BackgroundLine(token) end end def match_ScenarioLine( context, token) return false if token.eof? return handle_external_error(context, false) do context.token_matcher.match_ScenarioLine(token) end end def match_ScenarioOutlineLine( context, token) return false if token.eof? return handle_external_error(context, false) do context.token_matcher.match_ScenarioOutlineLine(token) end end def match_ExamplesLine( context, token) return false if token.eof? return handle_external_error(context, false) do context.token_matcher.match_ExamplesLine(token) end end def match_StepLine( context, token) return false if token.eof? return handle_external_error(context, false) do context.token_matcher.match_StepLine(token) end end def match_DocStringSeparator( context, token) return false if token.eof? return handle_external_error(context, false) do context.token_matcher.match_DocStringSeparator(token) end end def match_TableRow( context, token) return false if token.eof? return handle_external_error(context, false) do context.token_matcher.match_TableRow(token) end end def match_Language( context, token) return false if token.eof? return handle_external_error(context, false) do context.token_matcher.match_Language(token) end end def match_Other( context, token) return false if token.eof? return handle_external_error(context, false) do context.token_matcher.match_Other(token) end end def match_token(state, token, context) case state when 0 match_token_at_0(token, context) when 1 match_token_at_1(token, context) when 2 match_token_at_2(token, context) when 3 match_token_at_3(token, context) when 4 match_token_at_4(token, context) when 5 match_token_at_5(token, context) when 6 match_token_at_6(token, context) when 7 match_token_at_7(token, context) when 8 match_token_at_8(token, context) when 9 match_token_at_9(token, context) when 10 match_token_at_10(token, context) when 11 match_token_at_11(token, context) when 12 match_token_at_12(token, context) when 13 match_token_at_13(token, context) when 14 match_token_at_14(token, context) when 15 match_token_at_15(token, context) when 16 match_token_at_16(token, context) when 17 match_token_at_17(token, context) when 18 match_token_at_18(token, context) when 19 match_token_at_19(token, context) when 20 match_token_at_20(token, context) when 21 match_token_at_21(token, context) when 22 match_token_at_22(token, context) when 23 match_token_at_23(token, context) when 24 match_token_at_24(token, context) when 25 match_token_at_25(token, context) when 26 match_token_at_26(token, context) when 28 match_token_at_28(token, context) when 29 match_token_at_29(token, context) when 30 match_token_at_30(token, context) when 31 match_token_at_31(token, context) when 32 match_token_at_32(token, context) when 33 match_token_at_33(token, context) else raise InvalidOperationException, "Unknown state: #{state}" end end # Start def match_token_at_0(token, context) if match_EOF(context, token) build(context, token); return 27 end if match_Language(context, token) start_rule(context, :Feature); start_rule(context, :Feature_Header); build(context, token); return 1 end if match_TagLine(context, token) start_rule(context, :Feature); start_rule(context, :Feature_Header); start_rule(context, :Tags); build(context, token); return 2 end if match_FeatureLine(context, token) start_rule(context, :Feature); start_rule(context, :Feature_Header); build(context, token); return 3 end if match_Comment(context, token) build(context, token); return 0 end if match_Empty(context, token) build(context, token); return 0 end state_comment = "State: 0 - Start" token.detach expected_tokens = ["#EOF", "#Language", "#TagLine", "#FeatureLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 0 end # GherkinDocument:0>Feature:0>Feature_Header:0>#Language:0 def match_token_at_1(token, context) if match_TagLine(context, token) start_rule(context, :Tags); build(context, token); return 2 end if match_FeatureLine(context, token) build(context, token); return 3 end if match_Comment(context, token) build(context, token); return 1 end if match_Empty(context, token) build(context, token); return 1 end state_comment = "State: 1 - GherkinDocument:0>Feature:0>Feature_Header:0>#Language:0" token.detach expected_tokens = ["#TagLine", "#FeatureLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 1 end # GherkinDocument:0>Feature:0>Feature_Header:1>Tags:0>#TagLine:0 def match_token_at_2(token, context) if match_TagLine(context, token) build(context, token); return 2 end if match_FeatureLine(context, token) end_rule(context, :Tags); build(context, token); return 3 end if match_Comment(context, token) build(context, token); return 2 end if match_Empty(context, token) build(context, token); return 2 end state_comment = "State: 2 - GherkinDocument:0>Feature:0>Feature_Header:1>Tags:0>#TagLine:0" token.detach expected_tokens = ["#TagLine", "#FeatureLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 2 end # GherkinDocument:0>Feature:0>Feature_Header:2>#FeatureLine:0 def match_token_at_3(token, context) if match_EOF(context, token) end_rule(context, :Feature_Header); end_rule(context, :Feature); build(context, token); return 27 end if match_Empty(context, token) build(context, token); return 3 end if match_Comment(context, token) build(context, token); return 5 end if match_BackgroundLine(context, token) end_rule(context, :Feature_Header); start_rule(context, :Background); build(context, token); return 6 end if match_TagLine(context, token) end_rule(context, :Feature_Header); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ScenarioLine(context, token) end_rule(context, :Feature_Header); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Feature_Header); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Other(context, token) start_rule(context, :Description); build(context, token); return 4 end state_comment = "State: 3 - GherkinDocument:0>Feature:0>Feature_Header:2>#FeatureLine:0" token.detach expected_tokens = ["#EOF", "#Empty", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 3 end # GherkinDocument:0>Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:1>Description:0>#Other:0 def match_token_at_4(token, context) if match_EOF(context, token) end_rule(context, :Description); end_rule(context, :Feature_Header); end_rule(context, :Feature); build(context, token); return 27 end if match_Comment(context, token) end_rule(context, :Description); build(context, token); return 5 end if match_BackgroundLine(context, token) end_rule(context, :Description); end_rule(context, :Feature_Header); start_rule(context, :Background); build(context, token); return 6 end if match_TagLine(context, token) end_rule(context, :Description); end_rule(context, :Feature_Header); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ScenarioLine(context, token) end_rule(context, :Description); end_rule(context, :Feature_Header); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Description); end_rule(context, :Feature_Header); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Other(context, token) build(context, token); return 4 end state_comment = "State: 4 - GherkinDocument:0>Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:1>Description:0>#Other:0" token.detach expected_tokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 4 end # GherkinDocument:0>Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:2>#Comment:0 def match_token_at_5(token, context) if match_EOF(context, token) end_rule(context, :Feature_Header); end_rule(context, :Feature); build(context, token); return 27 end if match_Comment(context, token) build(context, token); return 5 end if match_BackgroundLine(context, token) end_rule(context, :Feature_Header); start_rule(context, :Background); build(context, token); return 6 end if match_TagLine(context, token) end_rule(context, :Feature_Header); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ScenarioLine(context, token) end_rule(context, :Feature_Header); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Feature_Header); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Empty(context, token) build(context, token); return 5 end state_comment = "State: 5 - GherkinDocument:0>Feature:0>Feature_Header:3>Feature_Description:0>Description_Helper:2>#Comment:0" token.detach expected_tokens = ["#EOF", "#Comment", "#BackgroundLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 5 end # GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0 def match_token_at_6(token, context) if match_EOF(context, token) end_rule(context, :Background); end_rule(context, :Feature); build(context, token); return 27 end if match_Empty(context, token) build(context, token); return 6 end if match_Comment(context, token) build(context, token); return 8 end if match_StepLine(context, token) start_rule(context, :Step); build(context, token); return 9 end if match_TagLine(context, token) end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ScenarioLine(context, token) end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Other(context, token) start_rule(context, :Description); build(context, token); return 7 end state_comment = "State: 6 - GherkinDocument:0>Feature:1>Background:0>#BackgroundLine:0" token.detach expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 6 end # GherkinDocument:0>Feature:1>Background:1>Background_Description:0>Description_Helper:1>Description:0>#Other:0 def match_token_at_7(token, context) if match_EOF(context, token) end_rule(context, :Description); end_rule(context, :Background); end_rule(context, :Feature); build(context, token); return 27 end if match_Comment(context, token) end_rule(context, :Description); build(context, token); return 8 end if match_StepLine(context, token) end_rule(context, :Description); start_rule(context, :Step); build(context, token); return 9 end if match_TagLine(context, token) end_rule(context, :Description); end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ScenarioLine(context, token) end_rule(context, :Description); end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Description); end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Other(context, token) build(context, token); return 7 end state_comment = "State: 7 - GherkinDocument:0>Feature:1>Background:1>Background_Description:0>Description_Helper:1>Description:0>#Other:0" token.detach expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 7 end # GherkinDocument:0>Feature:1>Background:1>Background_Description:0>Description_Helper:2>#Comment:0 def match_token_at_8(token, context) if match_EOF(context, token) end_rule(context, :Background); end_rule(context, :Feature); build(context, token); return 27 end if match_Comment(context, token) build(context, token); return 8 end if match_StepLine(context, token) start_rule(context, :Step); build(context, token); return 9 end if match_TagLine(context, token) end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ScenarioLine(context, token) end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Empty(context, token) build(context, token); return 8 end state_comment = "State: 8 - GherkinDocument:0>Feature:1>Background:1>Background_Description:0>Description_Helper:2>#Comment:0" token.detach expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 8 end # GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:0>#StepLine:0 def match_token_at_9(token, context) if match_EOF(context, token) end_rule(context, :Step); end_rule(context, :Background); end_rule(context, :Feature); build(context, token); return 27 end if match_TableRow(context, token) start_rule(context, :DataTable); build(context, token); return 10 end if match_DocStringSeparator(context, token) start_rule(context, :DocString); build(context, token); return 32 end if match_StepLine(context, token) end_rule(context, :Step); start_rule(context, :Step); build(context, token); return 9 end if match_TagLine(context, token) end_rule(context, :Step); end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ScenarioLine(context, token) end_rule(context, :Step); end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Step); end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Comment(context, token) build(context, token); return 9 end if match_Empty(context, token) build(context, token); return 9 end state_comment = "State: 9 - GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:0>#StepLine:0" token.detach expected_tokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 9 end # GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0 def match_token_at_10(token, context) if match_EOF(context, token) end_rule(context, :DataTable); end_rule(context, :Step); end_rule(context, :Background); end_rule(context, :Feature); build(context, token); return 27 end if match_TableRow(context, token) build(context, token); return 10 end if match_StepLine(context, token) end_rule(context, :DataTable); end_rule(context, :Step); start_rule(context, :Step); build(context, token); return 9 end if match_TagLine(context, token) end_rule(context, :DataTable); end_rule(context, :Step); end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ScenarioLine(context, token) end_rule(context, :DataTable); end_rule(context, :Step); end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :DataTable); end_rule(context, :Step); end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Comment(context, token) build(context, token); return 10 end if match_Empty(context, token) build(context, token); return 10 end state_comment = "State: 10 - GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0" token.detach expected_tokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 10 end # GherkinDocument:0>Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0 def match_token_at_11(token, context) if match_TagLine(context, token) build(context, token); return 11 end if match_ScenarioLine(context, token) end_rule(context, :Tags); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Tags); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Comment(context, token) build(context, token); return 11 end if match_Empty(context, token) build(context, token); return 11 end state_comment = "State: 11 - GherkinDocument:0>Feature:2>Scenario_Definition:0>Tags:0>#TagLine:0" token.detach expected_tokens = ["#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 11 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0 def match_token_at_12(token, context) if match_EOF(context, token) end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); end_rule(context, :Feature); build(context, token); return 27 end if match_Empty(context, token) build(context, token); return 12 end if match_Comment(context, token) build(context, token); return 14 end if match_StepLine(context, token) start_rule(context, :Step); build(context, token); return 15 end if match_TagLine(context, token) end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ScenarioLine(context, token) end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Other(context, token) start_rule(context, :Description); build(context, token); return 13 end state_comment = "State: 12 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:0>#ScenarioLine:0" token.detach expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 12 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:1>Description:0>#Other:0 def match_token_at_13(token, context) if match_EOF(context, token) end_rule(context, :Description); end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); end_rule(context, :Feature); build(context, token); return 27 end if match_Comment(context, token) end_rule(context, :Description); build(context, token); return 14 end if match_StepLine(context, token) end_rule(context, :Description); start_rule(context, :Step); build(context, token); return 15 end if match_TagLine(context, token) end_rule(context, :Description); end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ScenarioLine(context, token) end_rule(context, :Description); end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Description); end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Other(context, token) build(context, token); return 13 end state_comment = "State: 13 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:1>Description:0>#Other:0" token.detach expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 13 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:2>#Comment:0 def match_token_at_14(token, context) if match_EOF(context, token) end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); end_rule(context, :Feature); build(context, token); return 27 end if match_Comment(context, token) build(context, token); return 14 end if match_StepLine(context, token) start_rule(context, :Step); build(context, token); return 15 end if match_TagLine(context, token) end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ScenarioLine(context, token) end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Empty(context, token) build(context, token); return 14 end state_comment = "State: 14 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:1>Scenario_Description:0>Description_Helper:2>#Comment:0" token.detach expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 14 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:0>#StepLine:0 def match_token_at_15(token, context) if match_EOF(context, token) end_rule(context, :Step); end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); end_rule(context, :Feature); build(context, token); return 27 end if match_TableRow(context, token) start_rule(context, :DataTable); build(context, token); return 16 end if match_DocStringSeparator(context, token) start_rule(context, :DocString); build(context, token); return 30 end if match_StepLine(context, token) end_rule(context, :Step); start_rule(context, :Step); build(context, token); return 15 end if match_TagLine(context, token) end_rule(context, :Step); end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ScenarioLine(context, token) end_rule(context, :Step); end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Step); end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Comment(context, token) build(context, token); return 15 end if match_Empty(context, token) build(context, token); return 15 end state_comment = "State: 15 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:0>#StepLine:0" token.detach expected_tokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 15 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0 def match_token_at_16(token, context) if match_EOF(context, token) end_rule(context, :DataTable); end_rule(context, :Step); end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); end_rule(context, :Feature); build(context, token); return 27 end if match_TableRow(context, token) build(context, token); return 16 end if match_StepLine(context, token) end_rule(context, :DataTable); end_rule(context, :Step); start_rule(context, :Step); build(context, token); return 15 end if match_TagLine(context, token) end_rule(context, :DataTable); end_rule(context, :Step); end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ScenarioLine(context, token) end_rule(context, :DataTable); end_rule(context, :Step); end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :DataTable); end_rule(context, :Step); end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Comment(context, token) build(context, token); return 16 end if match_Empty(context, token) build(context, token); return 16 end state_comment = "State: 16 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0" token.detach expected_tokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 16 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:0 def match_token_at_17(token, context) if match_EOF(context, token) end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); end_rule(context, :Feature); build(context, token); return 27 end if match_Empty(context, token) build(context, token); return 17 end if match_Comment(context, token) build(context, token); return 19 end if match_StepLine(context, token) start_rule(context, :Step); build(context, token); return 20 end if match_TagLine(context, token) if lookahead_0(context, token) start_rule(context, :Examples_Definition); start_rule(context, :Tags); build(context, token); return 22 end end if match_TagLine(context, token) end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ExamplesLine(context, token) start_rule(context, :Examples_Definition); start_rule(context, :Examples); build(context, token); return 23 end if match_ScenarioLine(context, token) end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Other(context, token) start_rule(context, :Description); build(context, token); return 18 end state_comment = "State: 17 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:0>#ScenarioOutlineLine:0" token.detach expected_tokens = ["#EOF", "#Empty", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 17 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:1>Description:0>#Other:0 def match_token_at_18(token, context) if match_EOF(context, token) end_rule(context, :Description); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); end_rule(context, :Feature); build(context, token); return 27 end if match_Comment(context, token) end_rule(context, :Description); build(context, token); return 19 end if match_StepLine(context, token) end_rule(context, :Description); start_rule(context, :Step); build(context, token); return 20 end if match_TagLine(context, token) if lookahead_0(context, token) end_rule(context, :Description); start_rule(context, :Examples_Definition); start_rule(context, :Tags); build(context, token); return 22 end end if match_TagLine(context, token) end_rule(context, :Description); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ExamplesLine(context, token) end_rule(context, :Description); start_rule(context, :Examples_Definition); start_rule(context, :Examples); build(context, token); return 23 end if match_ScenarioLine(context, token) end_rule(context, :Description); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Description); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Other(context, token) build(context, token); return 18 end state_comment = "State: 18 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:1>Description:0>#Other:0" token.detach expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 18 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:2>#Comment:0 def match_token_at_19(token, context) if match_EOF(context, token) end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); end_rule(context, :Feature); build(context, token); return 27 end if match_Comment(context, token) build(context, token); return 19 end if match_StepLine(context, token) start_rule(context, :Step); build(context, token); return 20 end if match_TagLine(context, token) if lookahead_0(context, token) start_rule(context, :Examples_Definition); start_rule(context, :Tags); build(context, token); return 22 end end if match_TagLine(context, token) end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ExamplesLine(context, token) start_rule(context, :Examples_Definition); start_rule(context, :Examples); build(context, token); return 23 end if match_ScenarioLine(context, token) end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Empty(context, token) build(context, token); return 19 end state_comment = "State: 19 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:1>ScenarioOutline_Description:0>Description_Helper:2>#Comment:0" token.detach expected_tokens = ["#EOF", "#Comment", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 19 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:0>#StepLine:0 def match_token_at_20(token, context) if match_EOF(context, token) end_rule(context, :Step); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); end_rule(context, :Feature); build(context, token); return 27 end if match_TableRow(context, token) start_rule(context, :DataTable); build(context, token); return 21 end if match_DocStringSeparator(context, token) start_rule(context, :DocString); build(context, token); return 28 end if match_StepLine(context, token) end_rule(context, :Step); start_rule(context, :Step); build(context, token); return 20 end if match_TagLine(context, token) if lookahead_0(context, token) end_rule(context, :Step); start_rule(context, :Examples_Definition); start_rule(context, :Tags); build(context, token); return 22 end end if match_TagLine(context, token) end_rule(context, :Step); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ExamplesLine(context, token) end_rule(context, :Step); start_rule(context, :Examples_Definition); start_rule(context, :Examples); build(context, token); return 23 end if match_ScenarioLine(context, token) end_rule(context, :Step); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Step); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Comment(context, token) build(context, token); return 20 end if match_Empty(context, token) build(context, token); return 20 end state_comment = "State: 20 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:0>#StepLine:0" token.detach expected_tokens = ["#EOF", "#TableRow", "#DocStringSeparator", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 20 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0 def match_token_at_21(token, context) if match_EOF(context, token) end_rule(context, :DataTable); end_rule(context, :Step); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); end_rule(context, :Feature); build(context, token); return 27 end if match_TableRow(context, token) build(context, token); return 21 end if match_StepLine(context, token) end_rule(context, :DataTable); end_rule(context, :Step); start_rule(context, :Step); build(context, token); return 20 end if match_TagLine(context, token) if lookahead_0(context, token) end_rule(context, :DataTable); end_rule(context, :Step); start_rule(context, :Examples_Definition); start_rule(context, :Tags); build(context, token); return 22 end end if match_TagLine(context, token) end_rule(context, :DataTable); end_rule(context, :Step); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ExamplesLine(context, token) end_rule(context, :DataTable); end_rule(context, :Step); start_rule(context, :Examples_Definition); start_rule(context, :Examples); build(context, token); return 23 end if match_ScenarioLine(context, token) end_rule(context, :DataTable); end_rule(context, :Step); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :DataTable); end_rule(context, :Step); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Comment(context, token) build(context, token); return 21 end if match_Empty(context, token) build(context, token); return 21 end state_comment = "State: 21 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:0>DataTable:0>#TableRow:0" token.detach expected_tokens = ["#EOF", "#TableRow", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 21 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:0 def match_token_at_22(token, context) if match_TagLine(context, token) build(context, token); return 22 end if match_ExamplesLine(context, token) end_rule(context, :Tags); start_rule(context, :Examples); build(context, token); return 23 end if match_Comment(context, token) build(context, token); return 22 end if match_Empty(context, token) build(context, token); return 22 end state_comment = "State: 22 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:0>Tags:0>#TagLine:0" token.detach expected_tokens = ["#TagLine", "#ExamplesLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 22 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:0 def match_token_at_23(token, context) if match_EOF(context, token) end_rule(context, :Examples); end_rule(context, :Examples_Definition); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); end_rule(context, :Feature); build(context, token); return 27 end if match_Empty(context, token) build(context, token); return 23 end if match_Comment(context, token) build(context, token); return 25 end if match_TableRow(context, token) start_rule(context, :Examples_Table); build(context, token); return 26 end if match_TagLine(context, token) if lookahead_0(context, token) end_rule(context, :Examples); end_rule(context, :Examples_Definition); start_rule(context, :Examples_Definition); start_rule(context, :Tags); build(context, token); return 22 end end if match_TagLine(context, token) end_rule(context, :Examples); end_rule(context, :Examples_Definition); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ExamplesLine(context, token) end_rule(context, :Examples); end_rule(context, :Examples_Definition); start_rule(context, :Examples_Definition); start_rule(context, :Examples); build(context, token); return 23 end if match_ScenarioLine(context, token) end_rule(context, :Examples); end_rule(context, :Examples_Definition); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Examples); end_rule(context, :Examples_Definition); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Other(context, token) start_rule(context, :Description); build(context, token); return 24 end state_comment = "State: 23 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:0>#ExamplesLine:0" token.detach expected_tokens = ["#EOF", "#Empty", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 23 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:1>Description:0>#Other:0 def match_token_at_24(token, context) if match_EOF(context, token) end_rule(context, :Description); end_rule(context, :Examples); end_rule(context, :Examples_Definition); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); end_rule(context, :Feature); build(context, token); return 27 end if match_Comment(context, token) end_rule(context, :Description); build(context, token); return 25 end if match_TableRow(context, token) end_rule(context, :Description); start_rule(context, :Examples_Table); build(context, token); return 26 end if match_TagLine(context, token) if lookahead_0(context, token) end_rule(context, :Description); end_rule(context, :Examples); end_rule(context, :Examples_Definition); start_rule(context, :Examples_Definition); start_rule(context, :Tags); build(context, token); return 22 end end if match_TagLine(context, token) end_rule(context, :Description); end_rule(context, :Examples); end_rule(context, :Examples_Definition); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ExamplesLine(context, token) end_rule(context, :Description); end_rule(context, :Examples); end_rule(context, :Examples_Definition); start_rule(context, :Examples_Definition); start_rule(context, :Examples); build(context, token); return 23 end if match_ScenarioLine(context, token) end_rule(context, :Description); end_rule(context, :Examples); end_rule(context, :Examples_Definition); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Description); end_rule(context, :Examples); end_rule(context, :Examples_Definition); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Other(context, token) build(context, token); return 24 end state_comment = "State: 24 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:1>Description:0>#Other:0" token.detach expected_tokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 24 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:2>#Comment:0 def match_token_at_25(token, context) if match_EOF(context, token) end_rule(context, :Examples); end_rule(context, :Examples_Definition); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); end_rule(context, :Feature); build(context, token); return 27 end if match_Comment(context, token) build(context, token); return 25 end if match_TableRow(context, token) start_rule(context, :Examples_Table); build(context, token); return 26 end if match_TagLine(context, token) if lookahead_0(context, token) end_rule(context, :Examples); end_rule(context, :Examples_Definition); start_rule(context, :Examples_Definition); start_rule(context, :Tags); build(context, token); return 22 end end if match_TagLine(context, token) end_rule(context, :Examples); end_rule(context, :Examples_Definition); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ExamplesLine(context, token) end_rule(context, :Examples); end_rule(context, :Examples_Definition); start_rule(context, :Examples_Definition); start_rule(context, :Examples); build(context, token); return 23 end if match_ScenarioLine(context, token) end_rule(context, :Examples); end_rule(context, :Examples_Definition); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Examples); end_rule(context, :Examples_Definition); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Empty(context, token) build(context, token); return 25 end state_comment = "State: 25 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:1>Examples_Description:0>Description_Helper:2>#Comment:0" token.detach expected_tokens = ["#EOF", "#Comment", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 25 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:2>Examples_Table:0>#TableRow:0 def match_token_at_26(token, context) if match_EOF(context, token) end_rule(context, :Examples_Table); end_rule(context, :Examples); end_rule(context, :Examples_Definition); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); end_rule(context, :Feature); build(context, token); return 27 end if match_TableRow(context, token) build(context, token); return 26 end if match_TagLine(context, token) if lookahead_0(context, token) end_rule(context, :Examples_Table); end_rule(context, :Examples); end_rule(context, :Examples_Definition); start_rule(context, :Examples_Definition); start_rule(context, :Tags); build(context, token); return 22 end end if match_TagLine(context, token) end_rule(context, :Examples_Table); end_rule(context, :Examples); end_rule(context, :Examples_Definition); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ExamplesLine(context, token) end_rule(context, :Examples_Table); end_rule(context, :Examples); end_rule(context, :Examples_Definition); start_rule(context, :Examples_Definition); start_rule(context, :Examples); build(context, token); return 23 end if match_ScenarioLine(context, token) end_rule(context, :Examples_Table); end_rule(context, :Examples); end_rule(context, :Examples_Definition); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :Examples_Table); end_rule(context, :Examples); end_rule(context, :Examples_Definition); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Comment(context, token) build(context, token); return 26 end if match_Empty(context, token) build(context, token); return 26 end state_comment = "State: 26 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:3>Examples_Definition:1>Examples:2>Examples_Table:0>#TableRow:0" token.detach expected_tokens = ["#EOF", "#TableRow", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 26 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0 def match_token_at_28(token, context) if match_DocStringSeparator(context, token) build(context, token); return 29 end if match_Other(context, token) build(context, token); return 28 end state_comment = "State: 28 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0" token.detach expected_tokens = ["#DocStringSeparator", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 28 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0 def match_token_at_29(token, context) if match_EOF(context, token) end_rule(context, :DocString); end_rule(context, :Step); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); end_rule(context, :Feature); build(context, token); return 27 end if match_StepLine(context, token) end_rule(context, :DocString); end_rule(context, :Step); start_rule(context, :Step); build(context, token); return 20 end if match_TagLine(context, token) if lookahead_0(context, token) end_rule(context, :DocString); end_rule(context, :Step); start_rule(context, :Examples_Definition); start_rule(context, :Tags); build(context, token); return 22 end end if match_TagLine(context, token) end_rule(context, :DocString); end_rule(context, :Step); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ExamplesLine(context, token) end_rule(context, :DocString); end_rule(context, :Step); start_rule(context, :Examples_Definition); start_rule(context, :Examples); build(context, token); return 23 end if match_ScenarioLine(context, token) end_rule(context, :DocString); end_rule(context, :Step); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :DocString); end_rule(context, :Step); end_rule(context, :ScenarioOutline); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Comment(context, token) build(context, token); return 29 end if match_Empty(context, token) build(context, token); return 29 end state_comment = "State: 29 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:1>ScenarioOutline:2>ScenarioOutline_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0" token.detach expected_tokens = ["#EOF", "#StepLine", "#TagLine", "#ExamplesLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 29 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0 def match_token_at_30(token, context) if match_DocStringSeparator(context, token) build(context, token); return 31 end if match_Other(context, token) build(context, token); return 30 end state_comment = "State: 30 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0" token.detach expected_tokens = ["#DocStringSeparator", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 30 end # GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0 def match_token_at_31(token, context) if match_EOF(context, token) end_rule(context, :DocString); end_rule(context, :Step); end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); end_rule(context, :Feature); build(context, token); return 27 end if match_StepLine(context, token) end_rule(context, :DocString); end_rule(context, :Step); start_rule(context, :Step); build(context, token); return 15 end if match_TagLine(context, token) end_rule(context, :DocString); end_rule(context, :Step); end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ScenarioLine(context, token) end_rule(context, :DocString); end_rule(context, :Step); end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :DocString); end_rule(context, :Step); end_rule(context, :Scenario); end_rule(context, :Scenario_Definition); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Comment(context, token) build(context, token); return 31 end if match_Empty(context, token) build(context, token); return 31 end state_comment = "State: 31 - GherkinDocument:0>Feature:2>Scenario_Definition:1>__alt0:0>Scenario:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0" token.detach expected_tokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 31 end # GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0 def match_token_at_32(token, context) if match_DocStringSeparator(context, token) build(context, token); return 33 end if match_Other(context, token) build(context, token); return 32 end state_comment = "State: 32 - GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:0>#DocStringSeparator:0" token.detach expected_tokens = ["#DocStringSeparator", "#Other"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 32 end # GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0 def match_token_at_33(token, context) if match_EOF(context, token) end_rule(context, :DocString); end_rule(context, :Step); end_rule(context, :Background); end_rule(context, :Feature); build(context, token); return 27 end if match_StepLine(context, token) end_rule(context, :DocString); end_rule(context, :Step); start_rule(context, :Step); build(context, token); return 9 end if match_TagLine(context, token) end_rule(context, :DocString); end_rule(context, :Step); end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :Tags); build(context, token); return 11 end if match_ScenarioLine(context, token) end_rule(context, :DocString); end_rule(context, :Step); end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :Scenario); build(context, token); return 12 end if match_ScenarioOutlineLine(context, token) end_rule(context, :DocString); end_rule(context, :Step); end_rule(context, :Background); start_rule(context, :Scenario_Definition); start_rule(context, :ScenarioOutline); build(context, token); return 17 end if match_Comment(context, token) build(context, token); return 33 end if match_Empty(context, token) build(context, token); return 33 end state_comment = "State: 33 - GherkinDocument:0>Feature:1>Background:2>Scenario_Step:0>Step:1>Step_Arg:0>__alt1:1>DocString:2>#DocStringSeparator:0" token.detach expected_tokens = ["#EOF", "#StepLine", "#TagLine", "#ScenarioLine", "#ScenarioOutlineLine", "#Comment", "#Empty"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return 33 end def lookahead_0(context, currentToken) currentToken.detach token = nil queue = [] match = false loop do token = read_token(context) token.detach queue.push(token) if (false || match_ExamplesLine(context, token)) match = true break end break unless (false || match_Empty(context, token)|| match_Comment(context, token)|| match_TagLine(context, token)) end context.token_queue.concat(queue) return match end private def handle_ast_error(context, &action) handle_external_error(context, true, &action) end def handle_external_error(context, default_value, &action) return action.call if stop_at_first_error begin return action.call rescue CompositeParserException => e e.errors.each { |error| add_error(context, error) } rescue ParserException => e add_error(context, e) end default_value end end end gherkin-4.0.0/lib/gherkin/gherkin_line.rb0000644000004100000410000000443412706100344020354 0ustar www-datawww-datamodule Gherkin class GherkinLine attr_reader :indent, :trimmed_line_text def initialize(line_text, line_number) @line_text = line_text @line_number = line_number @trimmed_line_text = @line_text.lstrip @indent = @line_text.length - @trimmed_line_text.length end def start_with?(prefix) @trimmed_line_text.start_with?(prefix) end def start_with_title_keyword?(keyword) start_with?(keyword+':') # The C# impl is more complicated. Find out why. end def get_rest_trimmed(length) @trimmed_line_text[length..-1].strip end def empty? @trimmed_line_text.empty? end def get_line_text(indent_to_remove) indent_to_remove ||= 0 if indent_to_remove < 0 || indent_to_remove > indent @trimmed_line_text else @line_text[indent_to_remove..-1] end end def table_cells cells = [] self.split_table_cells(@trimmed_line_text) do |item, column| cell_indent = item.length - item.lstrip.length span = Span.new(@indent + column + cell_indent, item.strip) cells.push(span) end cells end def split_table_cells(row) col = 0 start_col = col + 1 cell = '' first_cell = true while col < row.length char = row[col] col += 1 if char == '|' if first_cell # First cell (content before the first |) is skipped first_cell = false else yield cell, start_col end cell = '' start_col = col + 1 elsif char == '\\' char = row[col] col += 1 if char == 'n' cell += "\n" else cell += '\\' unless ['|', '\\'].include?(char) cell += char end else cell += char end end # Last cell (content after the last |) is skipped end def tags column = @indent + 1; items = @trimmed_line_text.strip.split('@') items = items[1..-1] # ignore before the first @ items.map do |item| length = item.length span = Span.new(column, '@' + item.strip) column += length + 1 span end end class Span < Struct.new(:column, :text); end end end gherkin-4.0.0/lib/gherkin/gherkin-languages.json0000644000004100000410000012725512706100344021666 0ustar www-datawww-data{ "af": { "and": [ "* ", "En " ], "background": [ "Agtergrond" ], "but": [ "* ", "Maar " ], "examples": [ "Voorbeelde" ], "feature": [ "Funksie", "Besigheid Behoefte", "Vermoë" ], "given": [ "* ", "Gegewe " ], "name": "Afrikaans", "native": "Afrikaans", "scenario": [ "Situasie" ], "scenarioOutline": [ "Situasie Uiteensetting" ], "then": [ "* ", "Dan " ], "when": [ "* ", "Wanneer " ] }, "am": { "and": [ "* ", "Եվ " ], "background": [ "Կոնտեքստ" ], "but": [ "* ", "Բայց " ], "examples": [ "Օրինակներ" ], "feature": [ "Ֆունկցիոնալություն", "Հատկություն" ], "given": [ "* ", "Դիցուք " ], "name": "Armenian", "native": "հայերեն", "scenario": [ "Սցենար" ], "scenarioOutline": [ "Սցենարի կառուցվացքը" ], "then": [ "* ", "Ապա " ], "when": [ "* ", "Եթե ", "Երբ " ] }, "ar": { "and": [ "* ", "و " ], "background": [ "الخلفية" ], "but": [ "* ", "لكن " ], "examples": [ "امثلة" ], "feature": [ "خاصية" ], "given": [ "* ", "بفرض " ], "name": "Arabic", "native": "العربية", "scenario": [ "سيناريو" ], "scenarioOutline": [ "سيناريو مخطط" ], "then": [ "* ", "اذاً ", "ثم " ], "when": [ "* ", "متى ", "عندما " ] }, "bg": { "and": [ "* ", "И " ], "background": [ "Предистория" ], "but": [ "* ", "Но " ], "examples": [ "Примери" ], "feature": [ "Функционалност" ], "given": [ "* ", "Дадено " ], "name": "Bulgarian", "native": "български", "scenario": [ "Сценарий" ], "scenarioOutline": [ "Рамка на сценарий" ], "then": [ "* ", "То " ], "when": [ "* ", "Когато " ] }, "bm": { "and": [ "* ", "Dan " ], "background": [ "Latar Belakang" ], "but": [ "* ", "Tetapi ", "Tapi " ], "examples": [ "Contoh" ], "feature": [ "Fungsi" ], "given": [ "* ", "Diberi ", "Bagi " ], "name": "Malay", "native": "Bahasa Melayu", "scenario": [ "Senario", "Situasi", "Keadaan" ], "scenarioOutline": [ "Kerangka Senario", "Kerangka Situasi", "Kerangka Keadaan", "Garis Panduan Senario" ], "then": [ "* ", "Maka ", "Kemudian " ], "when": [ "* ", "Apabila " ] }, "bs": { "and": [ "* ", "I ", "A " ], "background": [ "Pozadina" ], "but": [ "* ", "Ali " ], "examples": [ "Primjeri" ], "feature": [ "Karakteristika" ], "given": [ "* ", "Dato " ], "name": "Bosnian", "native": "Bosanski", "scenario": [ "Scenariju", "Scenario" ], "scenarioOutline": [ "Scenariju-obris", "Scenario-outline" ], "then": [ "* ", "Zatim " ], "when": [ "* ", "Kada " ] }, "ca": { "and": [ "* ", "I " ], "background": [ "Rerefons", "Antecedents" ], "but": [ "* ", "Però " ], "examples": [ "Exemples" ], "feature": [ "Característica", "Funcionalitat" ], "given": [ "* ", "Donat ", "Donada ", "Atès ", "Atesa " ], "name": "Catalan", "native": "català", "scenario": [ "Escenari" ], "scenarioOutline": [ "Esquema de l'escenari" ], "then": [ "* ", "Aleshores ", "Cal " ], "when": [ "* ", "Quan " ] }, "cs": { "and": [ "* ", "A také ", "A " ], "background": [ "Pozadí", "Kontext" ], "but": [ "* ", "Ale " ], "examples": [ "Příklady" ], "feature": [ "Požadavek" ], "given": [ "* ", "Pokud ", "Za předpokladu " ], "name": "Czech", "native": "Česky", "scenario": [ "Scénář" ], "scenarioOutline": [ "Náčrt Scénáře", "Osnova scénáře" ], "then": [ "* ", "Pak " ], "when": [ "* ", "Když " ] }, "cy-GB": { "and": [ "* ", "A " ], "background": [ "Cefndir" ], "but": [ "* ", "Ond " ], "examples": [ "Enghreifftiau" ], "feature": [ "Arwedd" ], "given": [ "* ", "Anrhegedig a " ], "name": "Welsh", "native": "Cymraeg", "scenario": [ "Scenario" ], "scenarioOutline": [ "Scenario Amlinellol" ], "then": [ "* ", "Yna " ], "when": [ "* ", "Pryd " ] }, "da": { "and": [ "* ", "Og " ], "background": [ "Baggrund" ], "but": [ "* ", "Men " ], "examples": [ "Eksempler" ], "feature": [ "Egenskab" ], "given": [ "* ", "Givet " ], "name": "Danish", "native": "dansk", "scenario": [ "Scenarie" ], "scenarioOutline": [ "Abstrakt Scenario" ], "then": [ "* ", "Så " ], "when": [ "* ", "Når " ] }, "de": { "and": [ "* ", "Und " ], "background": [ "Grundlage" ], "but": [ "* ", "Aber " ], "examples": [ "Beispiele" ], "feature": [ "Funktionalität" ], "given": [ "* ", "Angenommen ", "Gegeben sei ", "Gegeben seien " ], "name": "German", "native": "Deutsch", "scenario": [ "Szenario" ], "scenarioOutline": [ "Szenariogrundriss" ], "then": [ "* ", "Dann " ], "when": [ "* ", "Wenn " ] }, "el": { "and": [ "* ", "Και " ], "background": [ "Υπόβαθρο" ], "but": [ "* ", "Αλλά " ], "examples": [ "Παραδείγματα", "Σενάρια" ], "feature": [ "Δυνατότητα", "Λειτουργία" ], "given": [ "* ", "Δεδομένου " ], "name": "Greek", "native": "Ελληνικά", "scenario": [ "Σενάριο" ], "scenarioOutline": [ "Περιγραφή Σεναρίου" ], "then": [ "* ", "Τότε " ], "when": [ "* ", "Όταν " ] }, "em": { "and": [ "* ", "😂" ], "background": [ "💤" ], "but": [ "* ", "😔" ], "examples": [ "📓" ], "feature": [ "📚" ], "given": [ "* ", "😐" ], "name": "Emoji", "native": "😀", "scenario": [ "📕" ], "scenarioOutline": [ "📖" ], "then": [ "* ", "🙏" ], "when": [ "* ", "🎬" ] }, "en": { "and": [ "* ", "And " ], "background": [ "Background" ], "but": [ "* ", "But " ], "examples": [ "Examples", "Scenarios" ], "feature": [ "Feature", "Business Need", "Ability" ], "given": [ "* ", "Given " ], "name": "English", "native": "English", "scenario": [ "Scenario" ], "scenarioOutline": [ "Scenario Outline", "Scenario Template" ], "then": [ "* ", "Then " ], "when": [ "* ", "When " ] }, "en-Scouse": { "and": [ "* ", "An " ], "background": [ "Dis is what went down" ], "but": [ "* ", "Buh " ], "examples": [ "Examples" ], "feature": [ "Feature" ], "given": [ "* ", "Givun ", "Youse know when youse got " ], "name": "Scouse", "native": "Scouse", "scenario": [ "The thing of it is" ], "scenarioOutline": [ "Wharrimean is" ], "then": [ "* ", "Dun ", "Den youse gotta " ], "when": [ "* ", "Wun ", "Youse know like when " ] }, "en-au": { "and": [ "* ", "Too right " ], "background": [ "First off" ], "but": [ "* ", "Yeah nah " ], "examples": [ "You'll wanna" ], "feature": [ "Pretty much" ], "given": [ "* ", "Y'know " ], "name": "Australian", "native": "Australian", "scenario": [ "Awww, look mate" ], "scenarioOutline": [ "Reckon it's like" ], "then": [ "* ", "But at the end of the day I reckon " ], "when": [ "* ", "It's just unbelievable " ] }, "en-lol": { "and": [ "* ", "AN " ], "background": [ "B4" ], "but": [ "* ", "BUT " ], "examples": [ "EXAMPLZ" ], "feature": [ "OH HAI" ], "given": [ "* ", "I CAN HAZ " ], "name": "LOLCAT", "native": "LOLCAT", "scenario": [ "MISHUN" ], "scenarioOutline": [ "MISHUN SRSLY" ], "then": [ "* ", "DEN " ], "when": [ "* ", "WEN " ] }, "en-old": { "and": [ "* ", "Ond ", "7 " ], "background": [ "Aer", "Ær" ], "but": [ "* ", "Ac " ], "examples": [ "Se the", "Se þe", "Se ðe" ], "feature": [ "Hwaet", "Hwæt" ], "given": [ "* ", "Thurh ", "Þurh ", "Ðurh " ], "name": "Old English", "native": "Englisc", "scenario": [ "Swa" ], "scenarioOutline": [ "Swa hwaer swa", "Swa hwær swa" ], "then": [ "* ", "Tha ", "Þa ", "Ða ", "Tha the ", "Þa þe ", "Ða ðe " ], "when": [ "* ", "Tha ", "Þa ", "Ða " ] }, "en-pirate": { "and": [ "* ", "Aye " ], "background": [ "Yo-ho-ho" ], "but": [ "* ", "Avast! " ], "examples": [ "Dead men tell no tales" ], "feature": [ "Ahoy matey!" ], "given": [ "* ", "Gangway! " ], "name": "Pirate", "native": "Pirate", "scenario": [ "Heave to" ], "scenarioOutline": [ "Shiver me timbers" ], "then": [ "* ", "Let go and haul " ], "when": [ "* ", "Blimey! " ] }, "eo": { "and": [ "* ", "Kaj " ], "background": [ "Fono" ], "but": [ "* ", "Sed " ], "examples": [ "Ekzemploj" ], "feature": [ "Trajto" ], "given": [ "* ", "Donitaĵo ", "Komence " ], "name": "Esperanto", "native": "Esperanto", "scenario": [ "Scenaro", "Kazo" ], "scenarioOutline": [ "Konturo de la scenaro", "Skizo", "Kazo-skizo" ], "then": [ "* ", "Do " ], "when": [ "* ", "Se " ] }, "es": { "and": [ "* ", "Y ", "E " ], "background": [ "Antecedentes" ], "but": [ "* ", "Pero " ], "examples": [ "Ejemplos" ], "feature": [ "Característica" ], "given": [ "* ", "Dado ", "Dada ", "Dados ", "Dadas " ], "name": "Spanish", "native": "español", "scenario": [ "Escenario" ], "scenarioOutline": [ "Esquema del escenario" ], "then": [ "* ", "Entonces " ], "when": [ "* ", "Cuando " ] }, "et": { "and": [ "* ", "Ja " ], "background": [ "Taust" ], "but": [ "* ", "Kuid " ], "examples": [ "Juhtumid" ], "feature": [ "Omadus" ], "given": [ "* ", "Eeldades " ], "name": "Estonian", "native": "eesti keel", "scenario": [ "Stsenaarium" ], "scenarioOutline": [ "Raamstsenaarium" ], "then": [ "* ", "Siis " ], "when": [ "* ", "Kui " ] }, "fa": { "and": [ "* ", "و " ], "background": [ "زمینه" ], "but": [ "* ", "اما " ], "examples": [ "نمونه ها" ], "feature": [ "وِیژگی" ], "given": [ "* ", "با فرض " ], "name": "Persian", "native": "فارسی", "scenario": [ "سناریو" ], "scenarioOutline": [ "الگوی سناریو" ], "then": [ "* ", "آنگاه " ], "when": [ "* ", "هنگامی " ] }, "fi": { "and": [ "* ", "Ja " ], "background": [ "Tausta" ], "but": [ "* ", "Mutta " ], "examples": [ "Tapaukset" ], "feature": [ "Ominaisuus" ], "given": [ "* ", "Oletetaan " ], "name": "Finnish", "native": "suomi", "scenario": [ "Tapaus" ], "scenarioOutline": [ "Tapausaihio" ], "then": [ "* ", "Niin " ], "when": [ "* ", "Kun " ] }, "fr": { "and": [ "* ", "Et que ", "Et qu'", "Et " ], "background": [ "Contexte" ], "but": [ "* ", "Mais que ", "Mais qu'", "Mais " ], "examples": [ "Exemples" ], "feature": [ "Fonctionnalité" ], "given": [ "* ", "Soit ", "Etant donné que ", "Etant donné qu'", "Etant donné ", "Etant donnée ", "Etant donnés ", "Etant données ", "Étant donné que ", "Étant donné qu'", "Étant donné ", "Étant donnée ", "Étant donnés ", "Étant données " ], "name": "French", "native": "français", "scenario": [ "Scénario" ], "scenarioOutline": [ "Plan du scénario", "Plan du Scénario" ], "then": [ "* ", "Alors " ], "when": [ "* ", "Quand ", "Lorsque ", "Lorsqu'" ] }, "ga": { "and": [ "* ", "Agus" ], "background": [ "Cúlra" ], "but": [ "* ", "Ach" ], "examples": [ "Samplaí" ], "feature": [ "Gné" ], "given": [ "* ", "Cuir i gcás go", "Cuir i gcás nach", "Cuir i gcás gur", "Cuir i gcás nár" ], "name": "Irish", "native": "Gaeilge", "scenario": [ "Cás" ], "scenarioOutline": [ "Cás Achomair" ], "then": [ "* ", "Ansin" ], "when": [ "* ", "Nuair a", "Nuair nach", "Nuair ba", "Nuair nár" ] }, "gj": { "and": [ "* ", "અને " ], "background": [ "બેકગ્રાઉન્ડ" ], "but": [ "* ", "પણ " ], "examples": [ "ઉદાહરણો" ], "feature": [ "લક્ષણ", "વ્યાપાર જરૂર", "ક્ષમતા" ], "given": [ "* ", "આપેલ છે " ], "name": "Gujarati", "native": "ગુજરાતી", "scenario": [ "સ્થિતિ" ], "scenarioOutline": [ "પરિદ્દશ્ય રૂપરેખા", "પરિદ્દશ્ય ઢાંચો" ], "then": [ "* ", "પછી " ], "when": [ "* ", "ક્યારે " ] }, "gl": { "and": [ "* ", "E " ], "background": [ "Contexto" ], "but": [ "* ", "Mais ", "Pero " ], "examples": [ "Exemplos" ], "feature": [ "Característica" ], "given": [ "* ", "Dado ", "Dada ", "Dados ", "Dadas " ], "name": "Galician", "native": "galego", "scenario": [ "Escenario" ], "scenarioOutline": [ "Esbozo do escenario" ], "then": [ "* ", "Entón ", "Logo " ], "when": [ "* ", "Cando " ] }, "he": { "and": [ "* ", "וגם " ], "background": [ "רקע" ], "but": [ "* ", "אבל " ], "examples": [ "דוגמאות" ], "feature": [ "תכונה" ], "given": [ "* ", "בהינתן " ], "name": "Hebrew", "native": "עברית", "scenario": [ "תרחיש" ], "scenarioOutline": [ "תבנית תרחיש" ], "then": [ "* ", "אז ", "אזי " ], "when": [ "* ", "כאשר " ] }, "hi": { "and": [ "* ", "और ", "तथा " ], "background": [ "पृष्ठभूमि" ], "but": [ "* ", "पर ", "परन्तु ", "किन्तु " ], "examples": [ "उदाहरण" ], "feature": [ "रूप लेख" ], "given": [ "* ", "अगर ", "यदि ", "चूंकि " ], "name": "Hindi", "native": "हिंदी", "scenario": [ "परिदृश्य" ], "scenarioOutline": [ "परिदृश्य रूपरेखा" ], "then": [ "* ", "तब ", "तदा " ], "when": [ "* ", "जब ", "कदा " ] }, "hr": { "and": [ "* ", "I " ], "background": [ "Pozadina" ], "but": [ "* ", "Ali " ], "examples": [ "Primjeri", "Scenariji" ], "feature": [ "Osobina", "Mogućnost", "Mogucnost" ], "given": [ "* ", "Zadan ", "Zadani ", "Zadano " ], "name": "Croatian", "native": "hrvatski", "scenario": [ "Scenarij" ], "scenarioOutline": [ "Skica", "Koncept" ], "then": [ "* ", "Onda " ], "when": [ "* ", "Kada ", "Kad " ] }, "ht": { "and": [ "* ", "Ak ", "Epi ", "E " ], "background": [ "Kontèks", "Istorik" ], "but": [ "* ", "Men " ], "examples": [ "Egzanp" ], "feature": [ "Karakteristik", "Mak", "Fonksyonalite" ], "given": [ "* ", "Sipoze ", "Sipoze ke ", "Sipoze Ke " ], "name": "Creole", "native": "kreyòl", "scenario": [ "Senaryo" ], "scenarioOutline": [ "Plan senaryo", "Plan Senaryo", "Senaryo deskripsyon", "Senaryo Deskripsyon", "Dyagram senaryo", "Dyagram Senaryo" ], "then": [ "* ", "Lè sa a ", "Le sa a " ], "when": [ "* ", "Lè ", "Le " ] }, "hu": { "and": [ "* ", "És " ], "background": [ "Háttér" ], "but": [ "* ", "De " ], "examples": [ "Példák" ], "feature": [ "Jellemző" ], "given": [ "* ", "Amennyiben ", "Adott " ], "name": "Hungarian", "native": "magyar", "scenario": [ "Forgatókönyv" ], "scenarioOutline": [ "Forgatókönyv vázlat" ], "then": [ "* ", "Akkor " ], "when": [ "* ", "Majd ", "Ha ", "Amikor " ] }, "id": { "and": [ "* ", "Dan " ], "background": [ "Dasar" ], "but": [ "* ", "Tapi " ], "examples": [ "Contoh" ], "feature": [ "Fitur" ], "given": [ "* ", "Dengan " ], "name": "Indonesian", "native": "Bahasa Indonesia", "scenario": [ "Skenario" ], "scenarioOutline": [ "Skenario konsep" ], "then": [ "* ", "Maka " ], "when": [ "* ", "Ketika " ] }, "is": { "and": [ "* ", "Og " ], "background": [ "Bakgrunnur" ], "but": [ "* ", "En " ], "examples": [ "Dæmi", "Atburðarásir" ], "feature": [ "Eiginleiki" ], "given": [ "* ", "Ef " ], "name": "Icelandic", "native": "Íslenska", "scenario": [ "Atburðarás" ], "scenarioOutline": [ "Lýsing Atburðarásar", "Lýsing Dæma" ], "then": [ "* ", "Þá " ], "when": [ "* ", "Þegar " ] }, "it": { "and": [ "* ", "E " ], "background": [ "Contesto" ], "but": [ "* ", "Ma " ], "examples": [ "Esempi" ], "feature": [ "Funzionalità" ], "given": [ "* ", "Dato ", "Data ", "Dati ", "Date " ], "name": "Italian", "native": "italiano", "scenario": [ "Scenario" ], "scenarioOutline": [ "Schema dello scenario" ], "then": [ "* ", "Allora " ], "when": [ "* ", "Quando " ] }, "ja": { "and": [ "* ", "かつ" ], "background": [ "背景" ], "but": [ "* ", "しかし", "但し", "ただし" ], "examples": [ "例", "サンプル" ], "feature": [ "フィーチャ", "機能" ], "given": [ "* ", "前提" ], "name": "Japanese", "native": "日本語", "scenario": [ "シナリオ" ], "scenarioOutline": [ "シナリオアウトライン", "シナリオテンプレート", "テンプレ", "シナリオテンプレ" ], "then": [ "* ", "ならば" ], "when": [ "* ", "もし" ] }, "jv": { "and": [ "* ", "Lan " ], "background": [ "Dasar" ], "but": [ "* ", "Tapi ", "Nanging ", "Ananging " ], "examples": [ "Conto", "Contone" ], "feature": [ "Fitur" ], "given": [ "* ", "Nalika ", "Nalikaning " ], "name": "Javanese", "native": "Basa Jawa", "scenario": [ "Skenario" ], "scenarioOutline": [ "Konsep skenario" ], "then": [ "* ", "Njuk ", "Banjur " ], "when": [ "* ", "Manawa ", "Menawa " ] }, "kn": { "and": [ "* ", "ಮತ್ತು " ], "background": [ "ಹಿನ್ನೆಲೆ" ], "but": [ "* ", "ಆದರೆ " ], "examples": [ "ಉದಾಹರಣೆಗಳು" ], "feature": [ "ಹೆಚ್ಚಳ" ], "given": [ "* ", "ನೀಡಿದ " ], "name": "Kannada", "native": "ಕನ್ನಡ", "scenario": [ "ಕಥಾಸಾರಾಂಶ" ], "scenarioOutline": [ "ವಿವರಣೆ" ], "then": [ "* ", "ನಂತರ " ], "when": [ "* ", "ಸ್ಥಿತಿಯನ್ನು " ] }, "ko": { "and": [ "* ", "그리고" ], "background": [ "배경" ], "but": [ "* ", "하지만", "단" ], "examples": [ "예" ], "feature": [ "기능" ], "given": [ "* ", "조건", "먼저" ], "name": "Korean", "native": "한국어", "scenario": [ "시나리오" ], "scenarioOutline": [ "시나리오 개요" ], "then": [ "* ", "그러면" ], "when": [ "* ", "만일", "만약" ] }, "lt": { "and": [ "* ", "Ir " ], "background": [ "Kontekstas" ], "but": [ "* ", "Bet " ], "examples": [ "Pavyzdžiai", "Scenarijai", "Variantai" ], "feature": [ "Savybė" ], "given": [ "* ", "Duota " ], "name": "Lithuanian", "native": "lietuvių kalba", "scenario": [ "Scenarijus" ], "scenarioOutline": [ "Scenarijaus šablonas" ], "then": [ "* ", "Tada " ], "when": [ "* ", "Kai " ] }, "lu": { "and": [ "* ", "an ", "a " ], "background": [ "Hannergrond" ], "but": [ "* ", "awer ", "mä " ], "examples": [ "Beispiller" ], "feature": [ "Funktionalitéit" ], "given": [ "* ", "ugeholl " ], "name": "Luxemburgish", "native": "Lëtzebuergesch", "scenario": [ "Szenario" ], "scenarioOutline": [ "Plang vum Szenario" ], "then": [ "* ", "dann " ], "when": [ "* ", "wann " ] }, "lv": { "and": [ "* ", "Un " ], "background": [ "Konteksts", "Situācija" ], "but": [ "* ", "Bet " ], "examples": [ "Piemēri", "Paraugs" ], "feature": [ "Funkcionalitāte", "Fīča" ], "given": [ "* ", "Kad " ], "name": "Latvian", "native": "latviešu", "scenario": [ "Scenārijs" ], "scenarioOutline": [ "Scenārijs pēc parauga" ], "then": [ "* ", "Tad " ], "when": [ "* ", "Ja " ] }, "mn": { "and": [ "* ", "Мөн ", "Тэгээд " ], "background": [ "Агуулга" ], "but": [ "* ", "Гэхдээ ", "Харин " ], "examples": [ "Тухайлбал" ], "feature": [ "Функц", "Функционал" ], "given": [ "* ", "Өгөгдсөн нь ", "Анх " ], "name": "Mongolian", "native": "монгол", "scenario": [ "Сценар" ], "scenarioOutline": [ "Сценарын төлөвлөгөө" ], "then": [ "* ", "Тэгэхэд ", "Үүний дараа " ], "when": [ "* ", "Хэрэв " ] }, "nl": { "and": [ "* ", "En " ], "background": [ "Achtergrond" ], "but": [ "* ", "Maar " ], "examples": [ "Voorbeelden" ], "feature": [ "Functionaliteit" ], "given": [ "* ", "Gegeven ", "Stel " ], "name": "Dutch", "native": "Nederlands", "scenario": [ "Scenario" ], "scenarioOutline": [ "Abstract Scenario" ], "then": [ "* ", "Dan " ], "when": [ "* ", "Als " ] }, "no": { "and": [ "* ", "Og " ], "background": [ "Bakgrunn" ], "but": [ "* ", "Men " ], "examples": [ "Eksempler" ], "feature": [ "Egenskap" ], "given": [ "* ", "Gitt " ], "name": "Norwegian", "native": "norsk", "scenario": [ "Scenario" ], "scenarioOutline": [ "Scenariomal", "Abstrakt Scenario" ], "then": [ "* ", "Så " ], "when": [ "* ", "Når " ] }, "pa": { "and": [ "* ", "ਅਤੇ " ], "background": [ "ਪਿਛੋਕੜ" ], "but": [ "* ", "ਪਰ " ], "examples": [ "ਉਦਾਹਰਨਾਂ" ], "feature": [ "ਖਾਸੀਅਤ", "ਮੁਹਾਂਦਰਾ", "ਨਕਸ਼ ਨੁਹਾਰ" ], "given": [ "* ", "ਜੇਕਰ ", "ਜਿਵੇਂ ਕਿ " ], "name": "Panjabi", "native": "ਪੰਜਾਬੀ", "scenario": [ "ਪਟਕਥਾ" ], "scenarioOutline": [ "ਪਟਕਥਾ ਢਾਂਚਾ", "ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ" ], "then": [ "* ", "ਤਦ " ], "when": [ "* ", "ਜਦੋਂ " ] }, "pl": { "and": [ "* ", "Oraz ", "I " ], "background": [ "Założenia" ], "but": [ "* ", "Ale " ], "examples": [ "Przykłady" ], "feature": [ "Właściwość", "Funkcja", "Aspekt", "Potrzeba biznesowa" ], "given": [ "* ", "Zakładając ", "Mając ", "Zakładając, że " ], "name": "Polish", "native": "polski", "scenario": [ "Scenariusz" ], "scenarioOutline": [ "Szablon scenariusza" ], "then": [ "* ", "Wtedy " ], "when": [ "* ", "Jeżeli ", "Jeśli ", "Gdy ", "Kiedy " ] }, "pt": { "and": [ "* ", "E " ], "background": [ "Contexto", "Cenário de Fundo", "Cenario de Fundo", "Fundo" ], "but": [ "* ", "Mas " ], "examples": [ "Exemplos", "Cenários", "Cenarios" ], "feature": [ "Funcionalidade", "Característica", "Caracteristica" ], "given": [ "* ", "Dado ", "Dada ", "Dados ", "Dadas " ], "name": "Portuguese", "native": "português", "scenario": [ "Cenário", "Cenario" ], "scenarioOutline": [ "Esquema do Cenário", "Esquema do Cenario", "Delineação do Cenário", "Delineacao do Cenario" ], "then": [ "* ", "Então ", "Entao " ], "when": [ "* ", "Quando " ] }, "ro": { "and": [ "* ", "Si ", "Și ", "Şi " ], "background": [ "Context" ], "but": [ "* ", "Dar " ], "examples": [ "Exemple" ], "feature": [ "Functionalitate", "Funcționalitate", "Funcţionalitate" ], "given": [ "* ", "Date fiind ", "Dat fiind ", "Dati fiind ", "Dați fiind ", "Daţi fiind " ], "name": "Romanian", "native": "română", "scenario": [ "Scenariu" ], "scenarioOutline": [ "Structura scenariu", "Structură scenariu" ], "then": [ "* ", "Atunci " ], "when": [ "* ", "Cand ", "Când " ] }, "ru": { "and": [ "* ", "И ", "К тому же ", "Также " ], "background": [ "Предыстория", "Контекст" ], "but": [ "* ", "Но ", "А " ], "examples": [ "Примеры" ], "feature": [ "Функция", "Функциональность", "Функционал", "Свойство" ], "given": [ "* ", "Допустим ", "Дано ", "Пусть " ], "name": "Russian", "native": "русский", "scenario": [ "Сценарий" ], "scenarioOutline": [ "Структура сценария" ], "then": [ "* ", "То ", "Тогда " ], "when": [ "* ", "Если ", "Когда " ] }, "sk": { "and": [ "* ", "A ", "A tiež ", "A taktiež ", "A zároveň " ], "background": [ "Pozadie" ], "but": [ "* ", "Ale " ], "examples": [ "Príklady" ], "feature": [ "Požiadavka", "Funkcia", "Vlastnosť" ], "given": [ "* ", "Pokiaľ ", "Za predpokladu " ], "name": "Slovak", "native": "Slovensky", "scenario": [ "Scenár" ], "scenarioOutline": [ "Náčrt Scenáru", "Náčrt Scenára", "Osnova Scenára" ], "then": [ "* ", "Tak ", "Potom " ], "when": [ "* ", "Keď ", "Ak " ] }, "sl": { "and": [ "In ", "Ter " ], "background": [ "Kontekst", "Osnova", "Ozadje" ], "but": [ "Toda ", "Ampak ", "Vendar " ], "examples": [ "Primeri", "Scenariji" ], "feature": [ "Funkcionalnost", "Funkcija", "Možnosti", "Moznosti", "Lastnost", "Značilnost" ], "given": [ "Dano ", "Podano ", "Zaradi ", "Privzeto " ], "name": "Slovenian", "native": "Slovenski", "scenario": [ "Scenarij", "Primer" ], "scenarioOutline": [ "Struktura scenarija", "Skica", "Koncept", "Oris scenarija", "Osnutek" ], "then": [ "Nato ", "Potem ", "Takrat " ], "when": [ "Ko ", "Ce ", "Če ", "Kadar " ] }, "sr-Cyrl": { "and": [ "* ", "И " ], "background": [ "Контекст", "Основа", "Позадина" ], "but": [ "* ", "Али " ], "examples": [ "Примери", "Сценарији" ], "feature": [ "Функционалност", "Могућност", "Особина" ], "given": [ "* ", "За дато ", "За дате ", "За дати " ], "name": "Serbian", "native": "Српски", "scenario": [ "Сценарио", "Пример" ], "scenarioOutline": [ "Структура сценарија", "Скица", "Концепт" ], "then": [ "* ", "Онда " ], "when": [ "* ", "Када ", "Кад " ] }, "sr-Latn": { "and": [ "* ", "I " ], "background": [ "Kontekst", "Osnova", "Pozadina" ], "but": [ "* ", "Ali " ], "examples": [ "Primeri", "Scenariji" ], "feature": [ "Funkcionalnost", "Mogućnost", "Mogucnost", "Osobina" ], "given": [ "* ", "Za dato ", "Za date ", "Za dati " ], "name": "Serbian (Latin)", "native": "Srpski (Latinica)", "scenario": [ "Scenario", "Primer" ], "scenarioOutline": [ "Struktura scenarija", "Skica", "Koncept" ], "then": [ "* ", "Onda " ], "when": [ "* ", "Kada ", "Kad " ] }, "sv": { "and": [ "* ", "Och " ], "background": [ "Bakgrund" ], "but": [ "* ", "Men " ], "examples": [ "Exempel" ], "feature": [ "Egenskap" ], "given": [ "* ", "Givet " ], "name": "Swedish", "native": "Svenska", "scenario": [ "Scenario" ], "scenarioOutline": [ "Abstrakt Scenario", "Scenariomall" ], "then": [ "* ", "Så " ], "when": [ "* ", "När " ] }, "ta": { "and": [ "* ", "மேலும் ", "மற்றும் " ], "background": [ "பின்னணி" ], "but": [ "* ", "ஆனால் " ], "examples": [ "எடுத்துக்காட்டுகள்", "காட்சிகள்", " நிலைமைகளில்" ], "feature": [ "அம்சம்", "வணிக தேவை", "திறன்" ], "given": [ "* ", "கொடுக்கப்பட்ட " ], "name": "Tamil", "native": "தமிழ்", "scenario": [ "காட்சி" ], "scenarioOutline": [ "காட்சி சுருக்கம்", "காட்சி வார்ப்புரு" ], "then": [ "* ", "அப்பொழுது " ], "when": [ "* ", "எப்போது " ] }, "th": { "and": [ "* ", "และ " ], "background": [ "แนวคิด" ], "but": [ "* ", "แต่ " ], "examples": [ "ชุดของตัวอย่าง", "ชุดของเหตุการณ์" ], "feature": [ "โครงหลัก", "ความต้องการทางธุรกิจ", "ความสามารถ" ], "given": [ "* ", "กำหนดให้ " ], "name": "Thai", "native": "ไทย", "scenario": [ "เหตุการณ์" ], "scenarioOutline": [ "สรุปเหตุการณ์", "โครงสร้างของเหตุการณ์" ], "then": [ "* ", "ดังนั้น " ], "when": [ "* ", "เมื่อ " ] }, "tl": { "and": [ "* ", "మరియు " ], "background": [ "నేపథ్యం" ], "but": [ "* ", "కాని " ], "examples": [ "ఉదాహరణలు" ], "feature": [ "గుణము" ], "given": [ "* ", "చెప్పబడినది " ], "name": "Telugu", "native": "తెలుగు", "scenario": [ "సన్నివేశం" ], "scenarioOutline": [ "కథనం" ], "then": [ "* ", "అప్పుడు " ], "when": [ "* ", "ఈ పరిస్థితిలో " ] }, "tlh": { "and": [ "* ", "'ej ", "latlh " ], "background": [ "mo'" ], "but": [ "* ", "'ach ", "'a " ], "examples": [ "ghantoH", "lutmey" ], "feature": [ "Qap", "Qu'meH 'ut", "perbogh", "poQbogh malja'", "laH" ], "given": [ "* ", "ghu' noblu' ", "DaH ghu' bejlu' " ], "name": "Klingon", "native": "tlhIngan", "scenario": [ "lut" ], "scenarioOutline": [ "lut chovnatlh" ], "then": [ "* ", "vaj " ], "when": [ "* ", "qaSDI' " ] }, "tr": { "and": [ "* ", "Ve " ], "background": [ "Geçmiş" ], "but": [ "* ", "Fakat ", "Ama " ], "examples": [ "Örnekler" ], "feature": [ "Özellik" ], "given": [ "* ", "Diyelim ki " ], "name": "Turkish", "native": "Türkçe", "scenario": [ "Senaryo" ], "scenarioOutline": [ "Senaryo taslağı" ], "then": [ "* ", "O zaman " ], "when": [ "* ", "Eğer ki " ] }, "tt": { "and": [ "* ", "Һәм ", "Вә " ], "background": [ "Кереш" ], "but": [ "* ", "Ләкин ", "Әмма " ], "examples": [ "Үрнәкләр", "Мисаллар" ], "feature": [ "Мөмкинлек", "Үзенчәлеклелек" ], "given": [ "* ", "Әйтик " ], "name": "Tatar", "native": "Татарча", "scenario": [ "Сценарий" ], "scenarioOutline": [ "Сценарийның төзелеше" ], "then": [ "* ", "Нәтиҗәдә " ], "when": [ "* ", "Әгәр " ] }, "uk": { "and": [ "* ", "І ", "А також ", "Та " ], "background": [ "Передумова" ], "but": [ "* ", "Але " ], "examples": [ "Приклади" ], "feature": [ "Функціонал" ], "given": [ "* ", "Припустимо ", "Припустимо, що ", "Нехай ", "Дано " ], "name": "Ukrainian", "native": "Українська", "scenario": [ "Сценарій" ], "scenarioOutline": [ "Структура сценарію" ], "then": [ "* ", "То ", "Тоді " ], "when": [ "* ", "Якщо ", "Коли " ] }, "ur": { "and": [ "* ", "اور " ], "background": [ "پس منظر" ], "but": [ "* ", "لیکن " ], "examples": [ "مثالیں" ], "feature": [ "صلاحیت", "کاروبار کی ضرورت", "خصوصیت" ], "given": [ "* ", "اگر ", "بالفرض ", "فرض کیا " ], "name": "Urdu", "native": "اردو", "scenario": [ "منظرنامہ" ], "scenarioOutline": [ "منظر نامے کا خاکہ" ], "then": [ "* ", "پھر ", "تب " ], "when": [ "* ", "جب " ] }, "uz": { "and": [ "* ", "Ва " ], "background": [ "Тарих" ], "but": [ "* ", "Лекин ", "Бирок ", "Аммо " ], "examples": [ "Мисоллар" ], "feature": [ "Функционал" ], "given": [ "* ", "Агар " ], "name": "Uzbek", "native": "Узбекча", "scenario": [ "Сценарий" ], "scenarioOutline": [ "Сценарий структураси" ], "then": [ "* ", "Унда " ], "when": [ "* ", "Агар " ] }, "vi": { "and": [ "* ", "Và " ], "background": [ "Bối cảnh" ], "but": [ "* ", "Nhưng " ], "examples": [ "Dữ liệu" ], "feature": [ "Tính năng" ], "given": [ "* ", "Biết ", "Cho " ], "name": "Vietnamese", "native": "Tiếng Việt", "scenario": [ "Tình huống", "Kịch bản" ], "scenarioOutline": [ "Khung tình huống", "Khung kịch bản" ], "then": [ "* ", "Thì " ], "when": [ "* ", "Khi " ] }, "zh-CN": { "and": [ "* ", "而且", "并且", "同时" ], "background": [ "背景" ], "but": [ "* ", "但是" ], "examples": [ "例子" ], "feature": [ "功能" ], "given": [ "* ", "假如", "假设", "假定" ], "name": "Chinese simplified", "native": "简体中文", "scenario": [ "场景", "剧本" ], "scenarioOutline": [ "场景大纲", "剧本大纲" ], "then": [ "* ", "那么" ], "when": [ "* ", "当" ] }, "zh-TW": { "and": [ "* ", "而且", "並且", "同時" ], "background": [ "背景" ], "but": [ "* ", "但是" ], "examples": [ "例子" ], "feature": [ "功能" ], "given": [ "* ", "假如", "假設", "假定" ], "name": "Chinese traditional", "native": "繁體中文", "scenario": [ "場景", "劇本" ], "scenarioOutline": [ "場景大綱", "劇本大綱" ], "then": [ "* ", "那麼" ], "when": [ "* ", "當" ] } } gherkin-4.0.0/lib/gherkin/ast_builder.rb0000644000004100000410000001702512706100344020213 0ustar www-datawww-datarequire 'gherkin/ast_node' module Gherkin class AstBuilder def initialize reset end def reset @stack = [AstNode.new(:None)] @comments = [] end def start_rule(rule_type) @stack.push AstNode.new(rule_type) end def end_rule(rule_type) node = @stack.pop current_node.add(node.rule_type, transform_node(node)) end def build(token) if token.matched_type == :Comment @comments.push({ type: :Comment, location: get_location(token), text: token.matched_text }) else current_node.add(token.matched_type, token) end end def get_result current_node.get_single(:GherkinDocument) end def current_node @stack.last end def get_location(token, column=nil) # TODO: translated from JS... is it right? (column.nil? || column.zero?) ? token.location : {line: token.location[:line], column: column} end def get_tags(node) tags = [] tags_node = node.get_single(:Tags) return tags unless tags_node tags_node.get_tokens(:TagLine).each do |token| token.matched_items.each do |tag_item| tags.push({ type: :Tag, location: get_location(token, tag_item.column), name: tag_item.text }) end end tags end def get_table_rows(node) rows = node.get_tokens(:TableRow).map do |token| { type: :TableRow, location: get_location(token), cells: get_cells(token) } end ensure_cell_count(rows); rows end def ensure_cell_count(rows) return if rows.empty? cell_count = rows[0][:cells].length rows.each do |row| if (row[:cells].length != cell_count) raise AstBuilderException.new("inconsistent cell count within the table", row[:location]); end end end def get_cells(table_row_token) table_row_token.matched_items.map do |cell_item| { type: :TableCell, location: get_location(table_row_token, cell_item.column), value: cell_item.text } end end def get_description(node) node.get_single(:Description) end def get_steps(node) node.get_items(:Step) end def transform_node(node) case node.rule_type when :Step step_line = node.get_token(:StepLine) step_argument = node.get_single(:DataTable) || node.get_single(:DocString) || nil reject_nils( type: node.rule_type, location: get_location(step_line), keyword: step_line.matched_keyword, text: step_line.matched_text, argument: step_argument ) when :DocString separator_token = node.get_tokens(:DocStringSeparator)[0] content_type = separator_token.matched_text == '' ? nil : separator_token.matched_text line_tokens = node.get_tokens(:Other) content = line_tokens.map { |t| t.matched_text }.join("\n") reject_nils( type: node.rule_type, location: get_location(separator_token), contentType: content_type, content: content ) when :DataTable rows = get_table_rows(node) reject_nils( type: node.rule_type, location: rows[0][:location], rows: rows, ) when :Background background_line = node.get_token(:BackgroundLine) description = get_description(node) steps = get_steps(node) reject_nils( type: node.rule_type, location: get_location(background_line), keyword: background_line.matched_keyword, name: background_line.matched_text, description: description, steps: steps ) when :Scenario_Definition tags = get_tags(node) scenario_node = node.get_single(:Scenario) if(scenario_node) scenario_line = scenario_node.get_token(:ScenarioLine) description = get_description(scenario_node) steps = get_steps(scenario_node) reject_nils( type: scenario_node.rule_type, tags: tags, location: get_location(scenario_line), keyword: scenario_line.matched_keyword, name: scenario_line.matched_text, description: description, steps: steps ) else scenario_outline_node = node.get_single(:ScenarioOutline) raise 'Internal grammar error' unless scenario_outline_node scenario_outline_line = scenario_outline_node.get_token(:ScenarioOutlineLine) description = get_description(scenario_outline_node) steps = get_steps(scenario_outline_node) examples = scenario_outline_node.get_items(:Examples_Definition) reject_nils( type: scenario_outline_node.rule_type, tags: tags, location: get_location(scenario_outline_line), keyword: scenario_outline_line.matched_keyword, name: scenario_outline_line.matched_text, description: description, steps: steps, examples: examples ) end when :Examples_Definition tags = get_tags(node) examples_node = node.get_single(:Examples) examples_line = examples_node.get_token(:ExamplesLine) description = get_description(examples_node) examples_table = examples_node.get_single(:Examples_Table) reject_nils( type: examples_node.rule_type, tags: tags, location: get_location(examples_line), keyword: examples_line.matched_keyword, name: examples_line.matched_text, description: description, tableHeader: !examples_table.nil? ? examples_table[:tableHeader] : nil, tableBody: !examples_table.nil? ? examples_table[:tableBody] : nil ) when :Examples_Table rows = get_table_rows(node) reject_nils( tableHeader: rows.first, tableBody: rows[1..-1] ) when :Description line_tokens = node.get_tokens(:Other) # Trim trailing empty lines last_non_empty = line_tokens.rindex { |token| !token.line.trimmed_line_text.empty? } description = line_tokens[0..last_non_empty].map { |token| token.matched_text }.join("\n") return description when :Feature header = node.get_single(:Feature_Header) return unless header tags = get_tags(header) feature_line = header.get_token(:FeatureLine) return unless feature_line children = [] background = node.get_single(:Background) children.push(background) if background children.concat(node.get_items(:Scenario_Definition)) description = get_description(header) language = feature_line.matched_gherkin_dialect reject_nils( type: node.rule_type, tags: tags, location: get_location(feature_line), language: language, keyword: feature_line.matched_keyword, name: feature_line.matched_text, description: description, children: children, ) when :GherkinDocument feature = node.get_single(:Feature) reject_nils( type: node.rule_type, feature: feature, comments: @comments ) else return node end end def reject_nils(values) values.reject { |k,v| v.nil? } end end end gherkin-4.0.0/lib/gherkin/pickles/0000755000004100000410000000000012706100344017016 5ustar www-datawww-datagherkin-4.0.0/lib/gherkin/pickles/compiler.rb0000644000004100000410000001221312706100344021154 0ustar www-datawww-datamodule Gherkin module Pickles class Compiler def compile(gherkin_document, path) pickles = [] return pickles unless gherkin_document[:feature] feature = gherkin_document[:feature] feature_tags = feature[:tags] background_steps = [] feature[:children].each do |scenario_definition| if(scenario_definition[:type] == :Background) background_steps = pickle_steps(scenario_definition, path) elsif(scenario_definition[:type] == :Scenario) compile_scenario(feature_tags, background_steps, scenario_definition, path, pickles) else compile_scenario_outline(feature_tags, background_steps, scenario_definition, path, pickles) end end return pickles end private def compile_scenario(feature_tags, background_steps, scenario, path, pickles) return if scenario[:steps].empty? steps = [].concat(background_steps) tags = [].concat(feature_tags).concat(scenario[:tags]) scenario[:steps].each do |step| steps.push(pickle_step(step, path)) end pickle = { tags: pickle_tags(tags, path), name: scenario[:name], locations: [pickle_location(scenario[:location], path)], steps: steps } pickles.push(pickle) end def compile_scenario_outline(feature_tags, background_steps, scenario_outline, path, pickles) return if scenario_outline[:steps].empty? scenario_outline[:examples].reject { |examples| examples[:tableHeader].nil? }.each do |examples| variable_cells = examples[:tableHeader][:cells] examples[:tableBody].each do |values| value_cells = values[:cells] steps = [].concat(background_steps) tags = [].concat(feature_tags).concat(scenario_outline[:tags]).concat(examples[:tags]) scenario_outline[:steps].each do |scenario_outline_step| step_text = interpolate(scenario_outline_step[:text], variable_cells, value_cells); arguments = create_pickle_arguments(scenario_outline_step[:argument], variable_cells, value_cells, path) pickle_step = { text: step_text, arguments: arguments, locations: [ pickle_location(values[:location], path), pickle_step_location(scenario_outline_step, path) ] } steps.push(pickle_step) end pickle = { name: interpolate(scenario_outline[:name], variable_cells, value_cells), steps: steps, tags: pickle_tags(tags, path), locations: [ pickle_location(values[:location], path), pickle_location(scenario_outline[:location], path) ] } pickles.push(pickle); end end end def create_pickle_arguments(argument, variable_cells, value_cells, path) result = [] return result if argument.nil? if (argument[:type] == :DataTable) table = { rows: argument[:rows].map do |row| { cells: row[:cells].map do |cell| { location: pickle_location(cell[:location], path), value: interpolate(cell[:value], variable_cells, value_cells) } end } end } result.push(table) elsif (argument[:type] == :DocString) doc_string = { location: pickle_location(argument[:location], path), content: interpolate(argument[:content], variable_cells, value_cells) } result.push(doc_string) else raise 'Internal error' end result end def interpolate(name, variable_cells, value_cells) variable_cells.each_with_index do |variable_cell, n| value_cell = value_cells[n] name = name.gsub('<' + variable_cell[:value] + '>', value_cell[:value]) end name end def pickle_steps(scenario_definition, path) scenario_definition[:steps].map do |step| pickle_step(step, path) end end def pickle_step(step, path) { text: step[:text], arguments: create_pickle_arguments(step[:argument], [], [], path), locations: [pickle_step_location(step, path)] } end def pickle_step_location(step, path) { path: path, line: step[:location][:line], column: step[:location][:column] + (step[:keyword] ? step[:keyword].length : 0) } end def pickle_location(location, path) { path: path, line: location[:line], column: location[:column] } end def pickle_tags(tags, path) tags.map {|tag| pickle_tag(tag, path)} end def pickle_tag(tag, path) { name: tag[:name], location: pickle_location(tag[:location], path) } end end end end gherkin-4.0.0/lib/gherkin/dialect.rb0000644000004100000410000000174612706100344017326 0ustar www-datawww-datarequire 'json' module Gherkin DIALECT_FILE_PATH = File.expand_path("gherkin-languages.json", File.dirname(__FILE__)) DIALECTS = JSON.parse File.open(DIALECT_FILE_PATH, 'r:UTF-8').read class Dialect def self.for(name) spec = DIALECTS[name] return nil unless spec new(spec) end def initialize(spec) @spec = spec end def feature_keywords @spec.fetch('feature') end def scenario_keywords @spec.fetch('scenario') end def scenario_outline_keywords @spec.fetch('scenarioOutline') end def examples_keywords @spec.fetch('examples') end def background_keywords @spec.fetch('background') end def given_keywords @spec.fetch('given') end def when_keywords @spec.fetch('when') end def then_keywords @spec.fetch('then') end def and_keywords @spec.fetch('and') end def but_keywords @spec.fetch('but') end end end gherkin-4.0.0/lib/gherkin/token.rb0000644000004100000410000000060712706100344017034 0ustar www-datawww-datamodule Gherkin class Token < Struct.new(:line, :location) attr_accessor :matched_type, :matched_text, :matched_keyword, :matched_indent, :matched_items, :matched_gherkin_dialect def eof? line.nil? end def detach # TODO: detach line - is this needed? end def token_value eof? ? "EOF" : line.get_line_text(-1) end end end gherkin-4.0.0/lib/gherkin/token_matcher.rb0000644000004100000410000001164612706100344020544 0ustar www-datawww-datarequire 'gherkin/dialect' require 'gherkin/errors' module Gherkin class TokenMatcher LANGUAGE_PATTERN = /^\s*#\s*language\s*:\s*([a-zA-Z\-_]+)\s*$/ def initialize(dialect_name = 'en') @default_dialect_name = dialect_name change_dialect(dialect_name, nil) reset end def reset change_dialect(@default_dialect_name, nil) unless @dialect_name == @default_dialect_name @active_doc_string_separator = nil @indent_to_remove = 0 end def match_TagLine(token) return false unless token.line.start_with?('@') set_token_matched(token, :TagLine, nil, nil, nil, token.line.tags) true end def match_FeatureLine(token) match_title_line(token, :FeatureLine, @dialect.feature_keywords) end def match_ScenarioLine(token) match_title_line(token, :ScenarioLine, @dialect.scenario_keywords) end def match_ScenarioOutlineLine(token) match_title_line(token, :ScenarioOutlineLine, @dialect.scenario_outline_keywords) end def match_BackgroundLine(token) match_title_line(token, :BackgroundLine, @dialect.background_keywords) end def match_ExamplesLine(token) match_title_line(token, :ExamplesLine, @dialect.examples_keywords) end def match_TableRow(token) return false unless token.line.start_with?('|') # TODO: indent set_token_matched(token, :TableRow, nil, nil, nil, token.line.table_cells) true end def match_Empty(token) return false unless token.line.empty? set_token_matched(token, :Empty, nil, nil, 0) true end def match_Comment(token) return false unless token.line.start_with?('#') text = token.line.get_line_text(0) #take the entire line, including leading space set_token_matched(token, :Comment, text, nil, 0) true end def match_Language(token) return false unless token.line.trimmed_line_text =~ LANGUAGE_PATTERN dialect_name = $1 set_token_matched(token, :Language, dialect_name) change_dialect(dialect_name, token.location) true end def match_DocStringSeparator(token) if @active_doc_string_separator.nil? # open _match_DocStringSeparator(token, '"""', true) || _match_DocStringSeparator(token, '```', true) else # close _match_DocStringSeparator(token, @active_doc_string_separator, false) end end def _match_DocStringSeparator(token, separator, is_open) return false unless token.line.start_with?(separator) content_type = nil if is_open content_type = token.line.get_rest_trimmed(separator.length) @active_doc_string_separator = separator @indent_to_remove = token.line.indent else @active_doc_string_separator = nil @indent_to_remove = 0 end # TODO: Use the separator as keyword. That's needed for pretty printing. set_token_matched(token, :DocStringSeparator, content_type) true end def match_EOF(token) return false unless token.eof? set_token_matched(token, :EOF) true end def match_Other(token) text = token.line.get_line_text(@indent_to_remove) # take the entire line, except removing DocString indents set_token_matched(token, :Other, unescape_docstring(text), nil, 0) true end def match_StepLine(token) keywords = @dialect.given_keywords + @dialect.when_keywords + @dialect.then_keywords + @dialect.and_keywords + @dialect.but_keywords keyword = keywords.detect { |k| token.line.start_with?(k) } return false unless keyword title = token.line.get_rest_trimmed(keyword.length) set_token_matched(token, :StepLine, title, keyword) return true end private def change_dialect(dialect_name, location) dialect = Dialect.for(dialect_name) raise NoSuchLanguageException.new(dialect_name, location) if dialect.nil? @dialect_name = dialect_name @dialect = dialect end def match_title_line(token, token_type, keywords) keyword = keywords.detect { |k| token.line.start_with_title_keyword?(k) } return false unless keyword title = token.line.get_rest_trimmed(keyword.length + ':'.length) set_token_matched(token, token_type, title, keyword) true end def set_token_matched(token, matched_type, text=nil, keyword=nil, indent=nil, items=[]) token.matched_type = matched_type token.matched_text = text && text.chomp token.matched_keyword = keyword token.matched_indent = indent || (token.line && token.line.indent) || 0 token.matched_items = items token.location[:column] = token.matched_indent + 1 token.matched_gherkin_dialect = @dialect_name end def unescape_docstring(text) @active_doc_string_separator ? text.gsub("\\\"\\\"\\\"", "\"\"\"") : text end end end gherkin-4.0.0/lib/gherkin/ast_node.rb0000644000004100000410000000110412706100344017501 0ustar www-datawww-datamodule Gherkin class AstNode attr_reader :rule_type def initialize(rule_type) @rule_type = rule_type @_sub_items = Hash.new { |hash, key| hash[key] = [] } # returns [] for unknown key end def add(rule_type, obj) @_sub_items[rule_type].push(obj) end def get_single(rule_type) @_sub_items[rule_type].first end def get_items(rule_type) @_sub_items[rule_type] end def get_token(token_type) get_single(token_type) end def get_tokens(token_type) @_sub_items[token_type] end end end gherkin-4.0.0/CONTRIBUTING.md0000644000004100000410000000117312706100344015422 0ustar www-datawww-dataPlease read [CONTRIBUTING](https://github.com/cucumber/gherkin/blob/master/CONTRIBUTING.md) first. You should clone the [cucumber/gherkin](https://github.com/cucumber/gherkin) repo if you want to contribute. ## Run tests ### Using make Just run `make` from this directory. Even if you prefer `make` - run `rake` occasionally, as it reports better warnings. ### Using rake Just run `rake` from this directory. Keep in mind that this will only run unit tests. The acceptance tests are only run when you build with `make`. ## Make a release # Change version in `gherkin.gemspec` and commit bundle exec rake build release gherkin-4.0.0/Makefile0000644000004100000410000000523612706100344014635 0ustar www-datawww-dataGOOD_FEATURE_FILES = $(shell find ../testdata/good -name "*.feature") BAD_FEATURE_FILES = $(shell find ../testdata/bad -name "*.feature") TOKENS = $(patsubst ../testdata/%.feature,acceptance/testdata/%.feature.tokens,$(GOOD_FEATURE_FILES)) ASTS = $(patsubst ../testdata/%.feature,acceptance/testdata/%.feature.ast.json,$(GOOD_FEATURE_FILES)) PICKLES = $(patsubst ../testdata/%.feature,acceptance/testdata/%.feature.pickles.json,$(GOOD_FEATURE_FILES)) ERRORS = $(patsubst ../testdata/%.feature,acceptance/testdata/%.feature.errors,$(BAD_FEATURE_FILES)) RUBY_FILES = $(shell find . -name "*.rb") all: .compared .PHONY: all .compared: .built $(TOKENS) $(ASTS) $(PICKLES) $(ERRORS) touch $@ .built: lib/gherkin/parser.rb lib/gherkin/gherkin-languages.json $(RUBY_FILES) Gemfile.lock LICENSE bundle exec rspec --color touch $@ acceptance/testdata/%.feature.tokens: ../testdata/%.feature ../testdata/%.feature.tokens .built mkdir -p `dirname $@` bin/gherkin-generate-tokens $< > $@ diff --unified $<.tokens $@ .DELETE_ON_ERROR: acceptance/testdata/%.feature.tokens acceptance/testdata/%.feature.ast.json: ../testdata/%.feature ../testdata/%.feature.ast.json .built mkdir -p `dirname $@` bin/gherkin-generate-ast $< | jq --sort-keys "." > $@ diff --unified $<.ast.json $@ .DELETE_ON_ERROR: acceptance/testdata/%.feature.ast.json acceptance/testdata/%.feature.pickles.json: ../testdata/%.feature ../testdata/%.feature.pickles.json .built mkdir -p `dirname $@` bin/gherkin-generate-pickles $< | jq --sort-keys "." > $@ diff --unified $<.pickles.json $@ .DELETE_ON_ERROR: acceptance/testdata/%.feature.pickles.json acceptance/testdata/%.feature.errors: ../testdata/%.feature ../testdata/%.feature.errors .built mkdir -p `dirname $@` # Travis disables C extensions for jruby, and it doesn't seem possible to # tell JRuby *not* to print this warning when they're disabled. # Filter out the warning before doing the comparison. ! bin/gherkin-generate-ast $< 2> $@.tmp cat $@.tmp | grep -v "jruby: warning: unknown property jruby.cext.enabled" > $@ diff --unified $<.errors $@ .DELETE_ON_ERROR: acceptance/testdata/%.feature.errors lib/gherkin/gherkin-languages.json: ../gherkin-languages.json cp $^ $@ clean: rm -rf .compared .built acceptance lib/gherkin/parser.rb lib/gherkin/gherkin-languages.json coverage .PHONY: clean lib/gherkin/parser.rb: ../gherkin.berp gherkin-ruby.razor ../bin/berp.exe mono ../bin/berp.exe -g ../gherkin.berp -t gherkin-ruby.razor -o $@ # Remove BOM tail -c +4 $@ > $@.nobom mv $@.nobom $@ Gemfile.lock: Gemfile bundle install LICENSE: ../LICENSE cp $< $@ update-gherkin-languages: lib/gherkin/gherkin-languages.json .PHONY: update-gherkin-languages gherkin-4.0.0/LICENSE0000644000004100000410000000214112706100344014172 0ustar www-datawww-dataThe MIT License (MIT) Copyright (c) Cucumber Ltd, Gaspar Nagy, Björn Rasmusson, Peter Sergeant Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. gherkin-4.0.0/gherkin-ruby.razor0000644000004100000410000001343712706100344016664 0ustar www-datawww-data@using Berp; @helper CallProduction(ProductionRule production) { switch(production.Type) { case ProductionRuleType.Start: @: start_rule(context, :@production.RuleName); break; case ProductionRuleType.End: @: end_rule(context, :@production.RuleName); break; case ProductionRuleType.Process: @: build(context, token); break; } } @helper HandleParserError(IEnumerable expectedTokens, State state) { state_comment = "State: @state.Id - @Raw(state.Comment)" token.detach expected_tokens = ["@Raw(string.Join("\", \"", expectedTokens))"] error = token.eof? ? UnexpectedEOFException.new(token, expected_tokens, state_comment) : UnexpectedTokenException.new(token, expected_tokens, state_comment) raise error if (stop_at_first_error) add_error(context, error) return @state.Id} @helper MatchToken(TokenType tokenType) {match_@(tokenType)(context, token)} # This file is generated. Do not edit! Edit gherkin-ruby.razor instead. require 'gherkin/ast_builder' require 'gherkin/token_matcher' require 'gherkin/token_scanner' require 'gherkin/errors' module Gherkin RULE_TYPE = [ :None, @foreach(var rule in Model.RuleSet.Where(r => !r.TempRule)) { :@rule.Name.Replace("#", "_"), # @rule.ToString(true) } ] class ParserContext attr_reader :token_scanner, :token_matcher, :token_queue, :errors def initialize(token_scanner, token_matcher, token_queue, errors) @@token_scanner = token_scanner @@token_matcher = token_matcher @@token_queue = token_queue @@errors = errors end end class @Model.ParserClassName attr_accessor :stop_at_first_error def initialize(ast_builder=AstBuilder.new) @@ast_builder = ast_builder end def parse(token_scanner, token_matcher=TokenMatcher.new) token_scanner = token_scanner.is_a?(TokenScanner) ? token_scanner : TokenScanner.new(token_scanner) @@ast_builder.reset token_matcher.reset context = ParserContext.new( token_scanner, token_matcher, [], [] ) start_rule(context, :@Model.RuleSet.StartRule.Name); state = 0 token = nil begin token = read_token(context) state = match_token(state, token, context) end until(token.eof?) end_rule(context, :@Model.RuleSet.StartRule.Name) raise CompositeParserException.new(context.errors) if context.errors.any? get_result() end def build(context, token) handle_ast_error(context) do @@ast_builder.build(token) end end def add_error(context, error) context.errors.push(error) raise CompositeParserException, context.errors if context.errors.length > 10 end def start_rule(context, rule_type) handle_ast_error(context) do @@ast_builder.start_rule(rule_type) end end def end_rule(context, rule_type) handle_ast_error(context) do @@ast_builder.end_rule(rule_type) end end def get_result() @@ast_builder.get_result end def read_token(context) context.token_queue.any? ? context.token_queue.shift : context.token_scanner.read end @foreach(var rule in Model.RuleSet.TokenRules) { def match_@(rule.Name.Replace("#", ""))( context, token) @if (rule.Name != "#EOF") { @:return false if token.eof? } return handle_external_error(context, false) do context.token_matcher.match_@(rule.Name.Replace("#", ""))(token) end end } def match_token(state, token, context) case state @foreach(var state in Model.States.Values.Where(s => !s.IsEndState)) { @:when @state.Id @:match_token_at_@(state.Id)(token, context) } else raise InvalidOperationException, "Unknown state: #{state}" end end @foreach(var state in Model.States.Values.Where(s => !s.IsEndState)) { # @Raw(state.Comment) def match_token_at_@(state.Id)(token, context) @foreach(var transition in state.Transitions) { @:if @MatchToken(transition.TokenType) if (transition.LookAheadHint != null) { @:if lookahead_@(transition.LookAheadHint.Id)(context, token) } foreach(var production in transition.Productions) { @CallProduction(production) } @:return @transition.TargetState if (transition.LookAheadHint != null) { @:end } @:end } @HandleParserError(state.Transitions.Select(t => "#" + t.TokenType.ToString()).Distinct(), state) end } @foreach(var lookAheadHint in Model.RuleSet.LookAheadHints) { def lookahead_@(lookAheadHint.Id)(context, currentToken) currentToken.detach token = nil queue = [] match = false loop do token = read_token(context) token.detach queue.push(token) if (false @foreach(var tokenType in lookAheadHint.ExpectedTokens) {|| @MatchToken(tokenType)}) match = true break end break unless (false @foreach(var tokenType in lookAheadHint.Skip) {|| @MatchToken(tokenType)}) end context.token_queue.concat(queue) return match end } private def handle_ast_error(context, &action) handle_external_error(context, true, &action) end def handle_external_error(context, default_value, &action) return action.call if stop_at_first_error begin return action.call rescue CompositeParserException => e e.errors.each { |error| add_error(context, error) } rescue ParserException => e add_error(context, e) end default_value end end end gherkin-4.0.0/README.md0000644000004100000410000000062312706100344014447 0ustar www-datawww-data[![Build Status](https://secure.travis-ci.org/cucumber/gherkin-ruby.svg)](http://travis-ci.org/cucumber/gherkin-ruby) Gherkin parser/compiler for Ruby. Please see [Gherkin](https://github.com/cucumber/gherkin) for details. ## Developers Some files are generated from the `gherkin-ruby.razor` file. Please run the following command to generate the ruby files. ~~~bash cd /ruby make ~~~