lib/gherkin/token_matcher.rb in cucumber-gherkin-30.0.0 vs lib/gherkin/token_matcher.rb in cucumber-gherkin-30.0.1
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require 'cucumber/messages'
require_relative 'dialect'
require_relative 'errors'
module Gherkin
@@ -33,11 +35,11 @@
match_title_line(token, :RuleLine, @dialect.rule_keywords)
end
def match_ScenarioLine(token)
match_title_line(token, :ScenarioLine, @dialect.scenario_keywords) ||
- match_title_line(token, :ScenarioLine, @dialect.scenario_outline_keywords)
+ match_title_line(token, :ScenarioLine, @dialect.scenario_outline_keywords)
end
def match_BackgroundLine(token)
match_title_line(token, :BackgroundLine, @dialect.background_keywords)
end
@@ -81,11 +83,11 @@
def match_DocStringSeparator(token)
if @active_doc_string_separator.nil?
# open
_match_DocStringSeparator(token, '"""', true) ||
- _match_DocStringSeparator(token, '```', true)
+ _match_DocStringSeparator(token, '```', true)
else
# close
_match_DocStringSeparator(token, @active_doc_string_separator, false)
end
end
@@ -119,14 +121,15 @@
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
+ 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