twisty_puzzles 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/twisty_puzzles/parser.rb +10 -8
- data/lib/twisty_puzzles/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f95cf6c568aab20bad9dd5d48222afd5261215984a5da7c2c18b9d3bdf315763
|
4
|
+
data.tar.gz: 713e3825d332a49805f4938b8bc2be924f3813d49e25e9997278966409bb73fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e0ba5a01642a11c57a1d83aeb6b22aa4de037fcbbd6a062a2aff29028f37260cd06a38e009fe5683949a65509a899acd925bbe3b58fdf1552760d5664631ade
|
7
|
+
data.tar.gz: 3b2d41b1b10065029813152e693f0c61c6b28557e1794d16dcb4d6c7b300fd7d0d6fa94b2b23de3e01041526ef03463a05a8854b1eec1be7cfaec7ef1943debb
|
@@ -156,7 +156,7 @@ module TwistyPuzzles # rubocop:disable Style/Documentation
|
|
156
156
|
parse_open_bracket
|
157
157
|
first_part = parse_nonempty_moves_with_triggers
|
158
158
|
skip_spaces
|
159
|
-
|
159
|
+
parse_pure_separator
|
160
160
|
second_part = parse_nonempty_moves_with_triggers
|
161
161
|
skip_spaces
|
162
162
|
parse_close_bracket
|
@@ -166,27 +166,27 @@ module TwistyPuzzles # rubocop:disable Style/Documentation
|
|
166
166
|
def parse_pure_commutator_no_brackets
|
167
167
|
first_part_or_algorithm = parse_moves_with_triggers
|
168
168
|
skip_spaces
|
169
|
-
if @scanner.eos? ||
|
169
|
+
if @scanner.eos? || !PURE_SEPARATORS.include?(@scanner.peek(1))
|
170
170
|
return FakeCommutator.new(first_part_or_algorithm)
|
171
171
|
end
|
172
172
|
|
173
173
|
first_part = first_part_or_algorithm
|
174
174
|
complain('move') if first_part.empty?
|
175
|
-
|
175
|
+
parse_pure_separator
|
176
176
|
second_part = parse_nonempty_moves_with_triggers
|
177
177
|
skip_spaces
|
178
178
|
PureCommutator.new(first_part, second_part)
|
179
179
|
end
|
180
180
|
|
181
|
-
def
|
182
|
-
complain('middle of pure commutator') unless @scanner.getch
|
181
|
+
def parse_pure_separator
|
182
|
+
complain('middle of pure commutator') unless PURE_SEPARATORS.include?(@scanner.getch)
|
183
183
|
end
|
184
184
|
|
185
185
|
def parse_commutator_internal_after_separator(setup_or_first_part, separator)
|
186
|
-
if
|
186
|
+
if SETUP_SEPARATORS.include?(separator)
|
187
187
|
inner_commutator = parse_setup_commutator_inner
|
188
188
|
SetupCommutator.new(setup_or_first_part, inner_commutator)
|
189
|
-
elsif separator
|
189
|
+
elsif PURE_SEPARATORS.include?(separator)
|
190
190
|
second_part = parse_nonempty_moves_with_triggers
|
191
191
|
PureCommutator.new(setup_or_first_part, second_part)
|
192
192
|
else
|
@@ -194,7 +194,9 @@ module TwistyPuzzles # rubocop:disable Style/Documentation
|
|
194
194
|
end
|
195
195
|
end
|
196
196
|
|
197
|
-
|
197
|
+
SETUP_SEPARATORS = %w[; :].freeze
|
198
|
+
PURE_SEPARATORS = %w[/ ,].freeze
|
199
|
+
SEPARATORS = (SETUP_SEPARATORS + PURE_SEPARATORS).freeze
|
198
200
|
|
199
201
|
def parse_separator
|
200
202
|
separator = @scanner.getch
|