srl_ruby 0.4.4 → 0.4.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +278 -22
  3. data/CHANGELOG.md +39 -0
  4. data/Gemfile +2 -0
  5. data/LICENSE.txt +1 -1
  6. data/README.md +1 -1
  7. data/Rakefile +3 -0
  8. data/appveyor.yml +15 -14
  9. data/bin/srl2ruby +17 -12
  10. data/bin/srl2ruby_cli_parser.rb +6 -6
  11. data/features/lib/step_definitions/srl_testing_steps.rb +2 -0
  12. data/features/lib/support/env..rb +2 -0
  13. data/lib/regex/abstract_method.rb +2 -0
  14. data/lib/regex/alternation.rb +3 -3
  15. data/lib/regex/anchor.rb +3 -0
  16. data/lib/regex/atomic_expression.rb +2 -0
  17. data/lib/regex/capturing_group.rb +8 -3
  18. data/lib/regex/char_class.rb +4 -2
  19. data/lib/regex/char_range.rb +4 -3
  20. data/lib/regex/char_shorthand.rb +3 -0
  21. data/lib/regex/character.rb +7 -2
  22. data/lib/regex/compound_expression.rb +2 -0
  23. data/lib/regex/concatenation.rb +3 -1
  24. data/lib/regex/expression.rb +6 -1
  25. data/lib/regex/lookaround.rb +3 -1
  26. data/lib/regex/match_option.rb +2 -0
  27. data/lib/regex/monadic_expression.rb +2 -0
  28. data/lib/regex/multiplicity.rb +9 -9
  29. data/lib/regex/non_capturing_group.rb +3 -1
  30. data/lib/regex/polyadic_expression.rb +4 -0
  31. data/lib/regex/quantifiable.rb +3 -1
  32. data/lib/regex/raw_expression.rb +2 -0
  33. data/lib/regex/repetition.rb +2 -0
  34. data/lib/regex/wildcard.rb +2 -5
  35. data/lib/srl_ruby/ast_builder.rb +82 -115
  36. data/lib/srl_ruby/grammar.rb +80 -92
  37. data/lib/srl_ruby/regex_repr.rb +2 -0
  38. data/lib/srl_ruby/tokenizer.rb +11 -5
  39. data/lib/srl_ruby/version.rb +3 -1
  40. data/lib/srl_ruby.rb +2 -0
  41. data/spec/acceptance/srl_test_suite_spec.rb +2 -0
  42. data/spec/acceptance/support/rule_file_ast_builder.rb +2 -0
  43. data/spec/acceptance/support/rule_file_grammar.rb +7 -5
  44. data/spec/acceptance/support/rule_file_nodes.rb +2 -0
  45. data/spec/acceptance/support/rule_file_parser.rb +2 -0
  46. data/spec/acceptance/support/rule_file_tokenizer.rb +11 -4
  47. data/spec/regex/atomic_expression_spec.rb +2 -0
  48. data/spec/regex/character_spec.rb +12 -6
  49. data/spec/regex/match_option_spec.rb +2 -0
  50. data/spec/regex/monadic_expression_spec.rb +2 -0
  51. data/spec/regex/multiplicity_spec.rb +4 -0
  52. data/spec/regex/repetition_spec.rb +2 -0
  53. data/spec/spec_helper.rb +2 -0
  54. data/spec/srl_ruby/srl_ruby_spec.rb +2 -0
  55. data/spec/srl_ruby/tokenizer_spec.rb +2 -0
  56. data/spec/srl_ruby_spec.rb +8 -6
  57. data/srl_ruby.gemspec +7 -5
  58. metadata +16 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3fb6ab4f66212ea614cfbfab2f7b17049425844e
4
- data.tar.gz: 634718cf4229710eed018512b44f29781acebc4a
2
+ SHA256:
3
+ metadata.gz: 4142454106f1b3b0a0e1e9b7c382ba6c5088f34a7b4d2e4c9437164537bb766a
4
+ data.tar.gz: 2ded972212dc2db8b037aba56aec6f79917a90a945f56c8f9f72b1bd88cd8b69
5
5
  SHA512:
6
- metadata.gz: 51ef6aead6683f95d965f2b9882f929af3d1b4f73cc8948982161d8f05843e196b39e21868c2620bab825f88697174b4b82378fc548e5f0f21b920717685378a
7
- data.tar.gz: bb3c755844c7ad3e655d423de9956c3ccafde8c9efc2df5841b995546f0cf83b7b3880afa8ded4cd888944eaae53d7c889e96e7e09b743ece728aa7041734727
6
+ metadata.gz: d7da9074cd772c28dc7eeaa8072d39fb5a91a08dba1665982fbf08303582c84742cf72ca6785ed18f1944cb11fcfd25fb011a37f93055c552011543235799669
7
+ data.tar.gz: '070724971995e366a27232732d5accf62c3e2141807ae80a7548d0ae98a28004bf811c50119001e581648c3e262cba7295ee6117bab5f1bddea3110e692d9c94'
data/.rubocop.yml CHANGED
@@ -2,9 +2,22 @@ AllCops:
2
2
  Exclude:
3
3
  - 'exp/**/*'
4
4
 
5
+ Gemspec/DateAssignment:
6
+ Enabled: true
7
+
8
+ Layout/ArgumentAlignment:
9
+ Enabled: false
10
+
11
+ Layout/ArrayAlignment:
12
+ Enabled: true
13
+ EnforcedStyle: with_fixed_indentation
14
+
5
15
  Layout/CaseIndentation:
6
16
  Enabled: false
7
17
 
18
+ Layout/ClosingHeredocIndentation:
19
+ Enabled: false
20
+
8
21
  Layout/CommentIndentation:
9
22
  Enabled: false
10
23
 
@@ -13,7 +26,7 @@ Layout/ElseAlignment:
13
26
 
14
27
  Layout/EmptyLines:
15
28
  Enabled: false
16
-
29
+
17
30
  Layout/EndAlignment:
18
31
  Enabled: false
19
32
 
@@ -21,39 +34,118 @@ Layout/EndOfLine:
21
34
  Enabled: true
22
35
  EnforcedStyle: lf
23
36
 
37
+ Layout/FirstArgumentIndentation:
38
+ Enabled: false
39
+
40
+ Layout/HashAlignment:
41
+ Enabled: false
42
+
24
43
  Layout/IndentationWidth:
25
44
  Enabled: false
26
45
 
27
46
  Layout/IndentationConsistency:
28
47
  Enabled: true
29
-
30
- Layout/IndentHeredoc:
48
+
49
+ Layout/HeredocIndentation:
31
50
  Enabled: false
32
-
51
+
52
+ Layout/LineEndStringConcatenationIndentation:
53
+ Enabled: true
54
+
33
55
  Layout/MultilineHashBraceLayout:
34
56
  Enabled: true
35
57
 
58
+ Layout/MultilineMethodCallBraceLayout:
59
+ Enabled: true
60
+ EnforcedStyle: same_line
61
+
36
62
  Layout/SpaceAroundOperators:
37
63
  Enabled: true
38
64
 
65
+ Layout/SpaceBeforeBrackets:
66
+ Enabled: true
67
+
39
68
  Layout/SpaceInsideParens:
40
69
  Enabled: true
41
-
42
- Layout/Tab:
70
+
71
+ Layout/IndentationStyle:
72
+ Enabled: true
73
+
74
+ Layout/SpaceAroundMethodCallOperator:
43
75
  Enabled: true
44
-
45
- Layout/TrailingBlankLines:
76
+
77
+ Layout/TrailingEmptyLines:
46
78
  Enabled: true
47
79
 
48
80
  Layout/TrailingWhitespace:
49
81
  Enabled: true
50
82
 
83
+ Lint/AmbiguousAssignment:
84
+ Enabled: true
85
+
86
+ Lint/AmbiguousRange:
87
+ Enabled: true
88
+
89
+ Lint/DeprecatedConstants:
90
+ Enabled: true
91
+
92
+ Lint/DuplicateBranch:
93
+ Enabled: true
94
+
95
+ Lint/DuplicateRegexpCharacterClassElement:
96
+ Enabled: true
97
+
98
+ Lint/EmptyBlock:
99
+ Enabled: true
100
+
101
+ Lint/EmptyClass:
102
+ Enabled: false
103
+
104
+ Lint/EmptyInPattern:
105
+ Enabled: true
106
+
107
+ Lint/LambdaWithoutLiteralBlock:
108
+ Enabled: true
109
+
51
110
  Lint/Loop:
52
111
  Enabled: true
53
112
 
113
+ Lint/NoReturnInBeginEndBlocks:
114
+ Enabled: true
115
+
116
+ Lint/NumberedParameterAssignment:
117
+ Enabled: true
118
+
119
+ Lint/OrAssignmentToConstant:
120
+ Enabled: true
121
+
122
+ Lint/RaiseException:
123
+ Enabled: true
124
+
125
+ Lint/RedundantDirGlobSort:
126
+ Enabled: true
127
+
54
128
  Lint/RescueException:
55
129
  Enabled: true
56
130
 
131
+ Lint/StructNewOverride:
132
+ Enabled: true
133
+
134
+ Lint/SymbolConversion:
135
+ Enabled: true
136
+
137
+ Lint/ToEnumArguments:
138
+ Enabled: true
139
+
140
+ Lint/TripleQuotes:
141
+ Enabled: true
142
+
143
+ Lint/UnexpectedBlockArity:
144
+ Enabled: true
145
+
146
+ Lint/UnmodifiedReduceAccumulator:
147
+ Enabled: true
148
+
57
149
  Lint/UnusedMethodArgument:
58
150
  Enabled: true
59
151
 
@@ -73,20 +165,24 @@ Metrics/BlockLength:
73
165
  Enabled: true
74
166
  Max: 350
75
167
 
168
+ Metrics/BlockNesting:
169
+ Enabled: true
170
+ Max: 5
171
+
76
172
  Metrics/ClassLength:
77
173
  Enabled: true
78
- Max: 350
174
+ Max: 450
79
175
 
80
176
  Metrics/CyclomaticComplexity:
81
177
  Enabled: false
82
178
 
83
- Metrics/LineLength:
179
+ Layout/LineLength:
84
180
  Enabled: false
85
181
  Max: 90
86
182
 
87
183
  Metrics/MethodLength:
88
184
  Enabled: true
89
- Max: 40
185
+ Max: 60
90
186
 
91
187
  Metrics/ModuleLength:
92
188
  Enabled: true
@@ -100,11 +196,17 @@ Naming/ConstantName:
100
196
 
101
197
  Naming/ClassAndModuleCamelCase:
102
198
  Enabled: false
103
-
104
- Naming/UncommunicativeBlockParamName:
199
+
200
+ Naming/BlockParameterName:
105
201
  Enabled: true
106
-
107
- Naming/UncommunicativeMethodParamName:
202
+
203
+ Naming/InclusiveLanguage:
204
+ Enabled: true
205
+
206
+ Naming/MethodParameterName:
207
+ Enabled: false
208
+
209
+ Naming/MethodName:
108
210
  Enabled: false
109
211
 
110
212
  Naming/VariableName:
@@ -113,8 +215,8 @@ Naming/VariableName:
113
215
  Style/Alias:
114
216
  Enabled: true
115
217
 
116
- Layout/AlignHash:
117
- Enabled: false
218
+ Style/ArgumentsForwarding:
219
+ Enabled: true
118
220
 
119
221
  Style/AsciiComments:
120
222
  Enabled: false
@@ -134,6 +236,9 @@ Style/ClassCheck:
134
236
  Style/ClassVars:
135
237
  Enabled: false
136
238
 
239
+ Style/CollectionCompact:
240
+ Enabled: true
241
+
137
242
  Style/ColonMethodCall:
138
243
  Enabled: false
139
244
 
@@ -152,44 +257,195 @@ Style/DefWithParentheses:
152
257
  Style/Documentation:
153
258
  Enabled: false
154
259
 
260
+ Style/DocumentDynamicEvalDefinition:
261
+ Enabled: false
262
+
155
263
  Style/ExpandPathArguments:
156
264
  Enabled: false
157
265
 
266
+ Style/ExponentialNotation:
267
+ Enabled: true
268
+
158
269
  Style/GuardClause:
159
270
  Enabled: false
160
271
 
272
+ Style/HashEachMethods:
273
+ Enabled: true
274
+
275
+ Style/HashExcept:
276
+ Enabled: true
277
+
278
+ Style/HashTransformKeys:
279
+ Enabled: true
280
+
281
+ Style/HashTransformValues:
282
+ Enabled: true
283
+
161
284
  Style/IfUnlessModifier:
162
285
  Enabled: false
163
286
 
287
+ Style/InPatternThen:
288
+ Enabled: true
289
+
164
290
  Style/InverseMethods:
291
+ Enabled: false
292
+
293
+ Style/MissingRespondToMissing:
294
+ Enabled: false
295
+
296
+ Style/MultilineInPatternThen:
297
+ Enabled: true
298
+
299
+ Style/NegatedIfElseCondition:
165
300
  Enabled: true
166
301
 
167
302
  Style/Next:
168
303
  Enabled: false
169
304
 
305
+ Style/NilLambda:
306
+ Enabled: true
307
+
308
+ Style/NumericLiterals:
309
+ Enabled: false
310
+
311
+ Style/QuotedSymbols:
312
+ Enabled: true
313
+
170
314
  Style/RaiseArgs:
171
315
  Enabled: true
172
316
 
317
+ Style/RedundantArgument:
318
+ Enabled: true
319
+
173
320
  Style/RedundantReturn:
174
321
  Enabled: false
175
-
322
+
176
323
  Style/RedundantSelf:
177
324
  Enabled: true
178
325
 
326
+ Style/RedundantSelfAssignmentBranch:
327
+ Enabled: true
328
+
179
329
  Style/RegexpLiteral:
180
330
  Enabled: false
181
331
 
182
332
  Style/PercentLiteralDelimiters:
183
333
  Enabled: false
184
-
334
+
185
335
  Style/StderrPuts:
186
- Enabled: false
336
+ Enabled: false
187
337
 
188
338
  Style/StringLiterals:
189
339
  Enabled: true
190
340
 
341
+ Style/SwapValues:
342
+ Enabled: true
343
+
191
344
  Style/TernaryParentheses:
192
345
  Enabled: false
193
-
346
+
194
347
  Style/UnlessElse:
195
- Enabled: false
348
+ Enabled: false
349
+
350
+ # Rubocop complains when it doesn't find an explicit setting for the following cops:
351
+ Layout/EmptyLinesAroundAttributeAccessor:
352
+ Enabled: true
353
+
354
+ Lint/BinaryOperatorWithIdenticalOperands:
355
+ Enabled: true
356
+
357
+ Lint/DeprecatedOpenSSLConstant:
358
+ Enabled: true
359
+
360
+ Lint/DuplicateElsifCondition:
361
+ Enabled: true
362
+
363
+ Lint/DuplicateRescueException:
364
+ Enabled: true
365
+
366
+ Lint/EmptyConditionalBody:
367
+ Enabled: true
368
+
369
+ Lint/FloatComparison:
370
+ Enabled: true
371
+
372
+ Lint/MissingSuper:
373
+ Enabled: true
374
+
375
+ Lint/MixedRegexpCaptureTypes:
376
+ Enabled: true
377
+
378
+ Lint/OutOfRangeRegexpRef:
379
+ Enabled: true
380
+
381
+ Lint/SelfAssignment:
382
+ Enabled: true
383
+
384
+ Lint/TopLevelReturnWithArgument:
385
+ Enabled: true
386
+
387
+ Lint/UnreachableLoop:
388
+ Enabled: true
389
+
390
+ Style/AccessorGrouping:
391
+ Enabled: true
392
+
393
+ Style/ArrayCoercion:
394
+ Enabled: true
395
+
396
+ Style/BisectedAttrAccessor:
397
+ Enabled: true
398
+
399
+ Style/CaseLikeIf:
400
+ Enabled: true
401
+
402
+ Style/EndlessMethod:
403
+ Enabled: true
404
+
405
+ Style/ExplicitBlockArgument:
406
+ Enabled: true
407
+
408
+ Style/GlobalStdStream:
409
+ Enabled: true
410
+
411
+ Style/HashAsLastArrayItem:
412
+ Enabled: true
413
+
414
+ Style/HashConversion:
415
+ Enabled: true
416
+
417
+ Style/HashLikeCase:
418
+ Enabled: true
419
+
420
+ Style/IfWithBooleanLiteralBranches:
421
+ Enabled: true
422
+
423
+ Style/OptionalBooleanParameter:
424
+ Enabled: true
425
+
426
+ Style/RedundantAssignment:
427
+ Enabled: true
428
+
429
+ Style/RedundantFetchBlock:
430
+ Enabled: true
431
+
432
+ Style/RedundantFileExtensionInRequire:
433
+ Enabled: true
434
+
435
+ Style/RedundantRegexpCharacterClass:
436
+ Enabled: true
437
+
438
+ Style/RedundantRegexpEscape:
439
+ Enabled: true
440
+
441
+ Style/SingleArgumentDig:
442
+ Enabled: true
443
+
444
+ Style/SlicingWithRange:
445
+ Enabled: true
446
+
447
+ Style/StringChars:
448
+ Enabled: true
449
+
450
+ Style/StringConcatenation:
451
+ Enabled: true
data/CHANGELOG.md CHANGED
@@ -1,3 +1,42 @@
1
+ ## [0.4.8] - 2021-08-27
2
+ - Updated dependencies (Bundler >~ 2.2), (Rley >~ 0.8.03)
3
+ - Grammar refactoring to take profit of new Rley rule syntax.
4
+
5
+ ### Changed
6
+ - File `srl_ruby.gemspec` Updated the dependencies
7
+ - File `grammar.rb` Grammar refactored (use ? * + modifiers in production rules)
8
+ - class `ASTBuilder` updated `reduce_` to reflect new refactored production rules.
9
+
10
+ ## [0.4.7] - 2021-08-24
11
+ - Updated dependencies (Ruby >= 2.5), (Rley >= 0.8.02)
12
+ - Code restyling to please rubocop 1.19.1.
13
+ ### Changed
14
+ - File `srl_ruby.gemspec` Updated the dependencies
15
+ - File `.rubocop.yml` Added configuration for newest cops
16
+
17
+ ## [0.4.6] - 2019-08-17
18
+ - Code refactoring to use string frozen magic comments (as a consequence, skeem runs only on Rubies 2.3 or newer).
19
+ - Code restyling to please rubocop 0.7.40.
20
+ ### Changed
21
+ - File `README.md` updated note on compatibility with Rubies
22
+
23
+
24
+ ## [0.4.5] - 2019-01-13
25
+ - Removed Ruby versions older than 2.3 in CI testing because of breaking changes by Bundler 2.0
26
+
27
+ ### Changed
28
+ * Files `.travis.yml`, `appveyor.yml` updated.
29
+
30
+ ## [0.4.5] - 2019-01-02
31
+ ### Changed
32
+ - Minor code re-styling to please Rubocop 0.62.0.
33
+ - File `.travis.yml` Updated Ruby versions for CI builds
34
+ - File `.appveyor.yml` Sequence of Ruby versions refactored
35
+ - File `LICENSE.txt`: updated years in copyright text.
36
+
37
+ ### Fixed
38
+ - Method `ASTBuilder#reduce_pattern_sequence` was broken for lookbehind assertions.
39
+
1
40
  ## [0.4.4] - 2018-11-24
2
41
  ### Changed
3
42
  - File `srl_ruby.gemspec` Updated Rley dependency.