cucumber-tag-expressions 8.0.0 → 8.1.0
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/lib/cucumber/tag_expressions/expressions.rb +1 -1
- data/lib/cucumber/tag_expressions/parser.rb +12 -13
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ca8718895c5d5686b66697971803b693b584e38c34cd5b02433adc38e99562d5
|
|
4
|
+
data.tar.gz: e798b0ef686e5df942edb6289e681d615f734f21848897f9b82549be376cf6bf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0951dd38d6ae796ce4d0eba06c91f4bb760b7b3f4f5f8d212123fd9db486fef7780212ac72ede15342e7528b3f866f531b64a4e484514f798d606c7f9c623980'
|
|
7
|
+
data.tar.gz: a26645be0fbe7176f9da6e25ddcba1ab9837bf3d79bf110490b4909cbe359c86402410263aefc322c0d2da5ce5538c596f8a85d1a8d7621da832deb9eb2d3a5b
|
|
@@ -18,10 +18,9 @@ module Cucumber
|
|
|
18
18
|
tokens.each { |token| expected_token_type = handle_sequential_tokens(token, infix_expression, expected_token_type) }
|
|
19
19
|
while @operators.any?
|
|
20
20
|
raise "Tag expression \"#{infix_expression}\" could not be parsed because of syntax error: Unmatched (." if @operators.last == '('
|
|
21
|
-
|
|
22
|
-
push_expression(pop(@operators))
|
|
21
|
+
push_expression(infix_expression, @operators.pop)
|
|
23
22
|
end
|
|
24
|
-
|
|
23
|
+
@expressions.pop
|
|
25
24
|
end
|
|
26
25
|
|
|
27
26
|
private
|
|
@@ -67,11 +66,11 @@ module Cucumber
|
|
|
67
66
|
tokens
|
|
68
67
|
end
|
|
69
68
|
|
|
70
|
-
def push_expression(token)
|
|
69
|
+
def push_expression(infix_expression, token)
|
|
71
70
|
case token
|
|
72
|
-
when 'and' then @expressions.push(And.new(*
|
|
73
|
-
when 'or' then @expressions.push(Or.new(*
|
|
74
|
-
when 'not' then @expressions.push(Not.new(
|
|
71
|
+
when 'and' then @expressions.push(And.new(*popOperand(infix_expression, @expressions, 2)))
|
|
72
|
+
when 'or' then @expressions.push(Or.new(*popOperand(infix_expression, @expressions, 2)))
|
|
73
|
+
when 'not' then @expressions.push(Not.new(popOperand(infix_expression, @expressions)))
|
|
75
74
|
else @expressions.push(Literal.new(token))
|
|
76
75
|
end
|
|
77
76
|
end
|
|
@@ -92,7 +91,7 @@ module Cucumber
|
|
|
92
91
|
|
|
93
92
|
def handle_binary_operator(infix_expression, token, expected_token_type)
|
|
94
93
|
check(infix_expression, expected_token_type, :operator)
|
|
95
|
-
push_expression(
|
|
94
|
+
push_expression(infix_expression, @operators.pop) while @operators.any? && operator?(@operators.last) && lower_precedence?(token)
|
|
96
95
|
@operators.push(token)
|
|
97
96
|
:operand
|
|
98
97
|
end
|
|
@@ -105,16 +104,16 @@ module Cucumber
|
|
|
105
104
|
|
|
106
105
|
def handle_close_paren(infix_expression, _token, expected_token_type)
|
|
107
106
|
check(infix_expression, expected_token_type, :operator)
|
|
108
|
-
push_expression(
|
|
107
|
+
push_expression(infix_expression, @operators.pop) while @operators.any? && @operators.last != '('
|
|
109
108
|
raise "Tag expression \"#{infix_expression}\" could not be parsed because of syntax error: Unmatched )." if @operators.empty?
|
|
110
109
|
|
|
111
|
-
|
|
110
|
+
@operators.pop if @operators.last == '('
|
|
112
111
|
:operator
|
|
113
112
|
end
|
|
114
113
|
|
|
115
114
|
def handle_literal(infix_expression, token, expected_token_type)
|
|
116
115
|
check(infix_expression, expected_token_type, :operand)
|
|
117
|
-
push_expression(token)
|
|
116
|
+
push_expression(infix_expression, token)
|
|
118
117
|
:operator
|
|
119
118
|
end
|
|
120
119
|
|
|
@@ -124,9 +123,9 @@ module Cucumber
|
|
|
124
123
|
raise "Tag expression \"#{infix_expression}\" could not be parsed because of syntax error: Expected #{expected_token_type}."
|
|
125
124
|
end
|
|
126
125
|
|
|
127
|
-
def
|
|
126
|
+
def popOperand(infix_expression, array, amount = 1)
|
|
128
127
|
result = array.pop(amount)
|
|
129
|
-
raise
|
|
128
|
+
raise "Tag expression \"#{infix_expression}\" could not be parsed because of syntax error: Expected operand." if result.length != amount
|
|
130
129
|
|
|
131
130
|
amount == 1 ? result.first : result
|
|
132
131
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cucumber-tag-expressions
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.
|
|
4
|
+
version: 8.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrea Nodari
|
|
@@ -131,5 +131,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
131
131
|
requirements: []
|
|
132
132
|
rubygems_version: 3.6.9
|
|
133
133
|
specification_version: 4
|
|
134
|
-
summary: cucumber-tag-expressions-8.
|
|
134
|
+
summary: cucumber-tag-expressions-8.1.0
|
|
135
135
|
test_files: []
|