cucumber-gherkin 30.0.0 → 30.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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: 1308541679426354d1774c47cfb156d478c1c2a9f2cbe955f80923edde84ed50
|
4
|
+
data.tar.gz: a8d129ee4f5e4cb39b61137499050ea473fb96f5544a3a83c644e4aba709c74b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a28a2b1875e3b1efa780c83f1e4ff5146a7b2241751baa0b1a78469e0b594145bc0b57dee802b3feddfa79020397d3ad3ac65692fd79ec43880da8a40fc2f05
|
7
|
+
data.tar.gz: f032122f07f9b07fc596a2c45333490d4f5fabaea3220678871a146802063719c82f8698808c41e699b9a60c211e0209fb97b6431ea3416be63e3ba2703ea374
|
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
|
|