cucumber-gherkin 30.0.0 → 30.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/gherkin +1 -0
- data/bin/gherkin-ruby +2 -0
- data/lib/gherkin/ast_builder.rb +5 -4
- data/lib/gherkin/ast_node.rb +2 -0
- data/lib/gherkin/dialect.rb +2 -0
- data/lib/gherkin/errors.rb +4 -2
- data/lib/gherkin/gherkin_line.rb +4 -2
- data/lib/gherkin/parser.rb +162 -162
- data/lib/gherkin/pickles/compiler.rb +17 -7
- data/lib/gherkin/query.rb +2 -0
- data/lib/gherkin/stream/parser_message_stream.rb +2 -0
- data/lib/gherkin/token.rb +2 -0
- data/lib/gherkin/token_formatter_builder.rb +9 -3
- data/lib/gherkin/token_matcher.rb +10 -7
- data/lib/gherkin/token_scanner.rb +6 -2
- data/lib/gherkin.rb +2 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8e28c956d49e3459e25aa1dc8aedf72dfbfa31d904426676f1c38126f5954a1
|
4
|
+
data.tar.gz: 4f9821c2a63ed6d29c19270081b04389c3c53e6440af042e7e748c7066fad584
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f517b44e24aa884a2c213a782b931a09f45e1642da6a74b36536f83e5b2863f3b2a45256174fc1886ecd3fbe491ead2f308782ec4b2f431fe86b4a29ba827c8
|
7
|
+
data.tar.gz: 378cd806e477186a82ab8a884e927eb4318bf0d03afa50df71f73f02f8f4b2dac0477141ed665002914e26d182ff5aae0c608c404f32b2ab833978eb0142908a
|
data/bin/gherkin
CHANGED
data/bin/gherkin-ruby
CHANGED
data/lib/gherkin/ast_builder.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'cucumber/messages'
|
2
4
|
require_relative 'ast_node'
|
3
5
|
|
@@ -17,7 +19,7 @@ module Gherkin
|
|
17
19
|
@stack.push AstNode.new(rule_type)
|
18
20
|
end
|
19
21
|
|
20
|
-
def end_rule(
|
22
|
+
def end_rule(_rule_type)
|
21
23
|
node = @stack.pop
|
22
24
|
current_node.add(node.rule_type, transform_node(node))
|
23
25
|
end
|
@@ -79,8 +81,7 @@ module Gherkin
|
|
79
81
|
cells: get_cells(token)
|
80
82
|
)
|
81
83
|
end
|
82
|
-
ensure_cell_count(rows)
|
83
|
-
rows
|
84
|
+
rows.tap { ensure_cell_count(rows) }
|
84
85
|
end
|
85
86
|
|
86
87
|
def ensure_cell_count(rows)
|
@@ -116,7 +117,7 @@ module Gherkin
|
|
116
117
|
data_table = node.get_single(:DataTable)
|
117
118
|
doc_string = node.get_single(:DocString)
|
118
119
|
|
119
|
-
|
120
|
+
Cucumber::Messages::Step.new(
|
120
121
|
location: get_location(step_line, 0),
|
121
122
|
keyword: step_line.matched_keyword,
|
122
123
|
keyword_type: step_line.matched_keyword_type,
|
data/lib/gherkin/ast_node.rb
CHANGED
data/lib/gherkin/dialect.rb
CHANGED
data/lib/gherkin/errors.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Gherkin
|
2
4
|
class ParserError < StandardError; end
|
3
5
|
class AstNodeNotLocatedException < StandardError; end
|
@@ -30,7 +32,7 @@ module Gherkin
|
|
30
32
|
end
|
31
33
|
|
32
34
|
class UnexpectedTokenException < ParserException
|
33
|
-
def initialize(received_token, expected_token_types,
|
35
|
+
def initialize(received_token, expected_token_types, _state_comment)
|
34
36
|
message = "expected: #{expected_token_types.join(", ")}, got '#{received_token.token_value.strip}'"
|
35
37
|
column = received_token.location[:column]
|
36
38
|
location = (column.nil? || column.zero?) ? { line: received_token.location[:line], column: received_token.line.indent + 1 } : received_token.location
|
@@ -39,7 +41,7 @@ module Gherkin
|
|
39
41
|
end
|
40
42
|
|
41
43
|
class UnexpectedEOFException < ParserException
|
42
|
-
def initialize(received_token, expected_token_types,
|
44
|
+
def initialize(received_token, expected_token_types, _state_comment)
|
43
45
|
message = "unexpected end of file, expected: #{expected_token_types.join(", ")}"
|
44
46
|
super(message, received_token.location)
|
45
47
|
end
|
data/lib/gherkin/gherkin_line.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Gherkin
|
2
4
|
class GherkinLine
|
3
5
|
attr_reader :indent, :trimmed_line_text
|
@@ -88,7 +90,7 @@ module Gherkin
|
|
88
90
|
items = uncommented_line.split('@')
|
89
91
|
|
90
92
|
tags = []
|
91
|
-
items.each
|
93
|
+
items.each do |untrimmed|
|
92
94
|
item = untrimmed.strip
|
93
95
|
next if item.length == 0
|
94
96
|
|
@@ -99,7 +101,7 @@ module Gherkin
|
|
99
101
|
|
100
102
|
tags << Span.new(column, '@' + item)
|
101
103
|
column += untrimmed.length + 1
|
102
|
-
|
104
|
+
end
|
103
105
|
tags
|
104
106
|
end
|
105
107
|
|