srl_ruby 0.4.8 → 0.4.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4142454106f1b3b0a0e1e9b7c382ba6c5088f34a7b4d2e4c9437164537bb766a
4
- data.tar.gz: 2ded972212dc2db8b037aba56aec6f79917a90a945f56c8f9f72b1bd88cd8b69
3
+ metadata.gz: 53f0b4c07147644a3298d66dd4db0b7108fc1cc630debc1be7dc5721bca244bf
4
+ data.tar.gz: 410029ea6b5ddc36c6161d50701500af1cb406e8b39bbfa2b6d6d60839db41eb
5
5
  SHA512:
6
- metadata.gz: d7da9074cd772c28dc7eeaa8072d39fb5a91a08dba1665982fbf08303582c84742cf72ca6785ed18f1944cb11fcfd25fb011a37f93055c552011543235799669
7
- data.tar.gz: '070724971995e366a27232732d5accf62c3e2141807ae80a7548d0ae98a28004bf811c50119001e581648c3e262cba7295ee6117bab5f1bddea3110e692d9c94'
6
+ metadata.gz: 0e6124858fe023541f5fc291790251c2c87a2c36cbf28f9285d4b4ed6b87c3705ce381da3536c5e70627101f17c3b203673ea175fbb3fe58f7d193219ef959c0
7
+ data.tar.gz: a74fb973b4d74fe3546e10e9466654998f0f675ebaf9253932d8fb04b516feea767ab511c86fd11522df58084049a2b0f6455e1fd54ecde7920fd8f32550fc0b
data/.rubocop.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  AllCops:
2
2
  Exclude:
3
3
  - 'exp/**/*'
4
+ - 'demo/**/*'
4
5
 
5
6
  Gemspec/DateAssignment:
6
7
  Enabled: true
@@ -83,6 +84,9 @@ Layout/TrailingWhitespace:
83
84
  Lint/AmbiguousAssignment:
84
85
  Enabled: true
85
86
 
87
+ Lint/AmbiguousOperatorPrecedence: # new in 1.21
88
+ Enabled: true
89
+
86
90
  Lint/AmbiguousRange:
87
91
  Enabled: true
88
92
 
@@ -104,6 +108,9 @@ Lint/EmptyClass:
104
108
  Lint/EmptyInPattern:
105
109
  Enabled: true
106
110
 
111
+ Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
112
+ Enabled: true
113
+
107
114
  Lint/LambdaWithoutLiteralBlock:
108
115
  Enabled: true
109
116
 
@@ -125,6 +132,9 @@ Lint/RaiseException:
125
132
  Lint/RedundantDirGlobSort:
126
133
  Enabled: true
127
134
 
135
+ Lint/RequireRelativeSelfPath: # new in 1.22
136
+ Enabled: true
137
+
128
138
  Lint/RescueException:
129
139
  Enabled: true
130
140
 
@@ -212,6 +222,9 @@ Naming/MethodName:
212
222
  Naming/VariableName:
213
223
  Enabled: false
214
224
 
225
+ Security/IoMethods: # new in 1.22
226
+ Enabled: true
227
+
215
228
  Style/Alias:
216
229
  Enabled: true
217
230
 
@@ -258,7 +271,7 @@ Style/Documentation:
258
271
  Enabled: false
259
272
 
260
273
  Style/DocumentDynamicEvalDefinition:
261
- Enabled: false
274
+ Enabled: true
262
275
 
263
276
  Style/ExpandPathArguments:
264
277
  Enabled: false
@@ -305,6 +318,12 @@ Style/Next:
305
318
  Style/NilLambda:
306
319
  Enabled: true
307
320
 
321
+ Style/NumberedParameters: # new in 1.22
322
+ Enabled: true
323
+
324
+ Style/NumberedParametersLimit: # new in 1.22
325
+ Enabled: true
326
+
308
327
  Style/NumericLiterals:
309
328
  Enabled: false
310
329
 
@@ -332,6 +351,9 @@ Style/RegexpLiteral:
332
351
  Style/PercentLiteralDelimiters:
333
352
  Enabled: false
334
353
 
354
+ Style/SelectByRegexp: # new in 1.22
355
+ Enabled: true
356
+
335
357
  Style/StderrPuts:
336
358
  Enabled: false
337
359
 
@@ -448,4 +470,4 @@ Style/StringChars:
448
470
  Enabled: true
449
471
 
450
472
  Style/StringConcatenation:
451
- Enabled: true
473
+ Enabled: true
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [0.4.9] - 2021-11-01
2
+ - Code update to align with `Rley` v. 0.8.08
3
+
4
+ ### Changed
5
+ - File `ast_builder.rb` Updated some `reduce_...` methods to cope with ? quantifier change
6
+ - File `srl_ruby.gemspec` Updated the dependency towards Rley
7
+ - File `.rubocop.yml` Added newest cops from 1.21 and 1.22
8
+
9
+ ### Fixed
10
+ - File `grammar.rb` is now calling `Rley::grammar_builder` factory method.
11
+ - File `rule_file_grammar.rb` is now calling `Rley::grammar_builder` factory method.
12
+
1
13
  ## [0.4.8] - 2021-08-27
2
14
  - Updated dependencies (Bundler >~ 2.2), (Rley >~ 0.8.03)
3
15
  - Grammar refactoring to take profit of new Rley rule syntax.
@@ -120,7 +120,7 @@ module SrlRuby
120
120
 
121
121
  # rule('expression' => 'pattern (flags)?').tag 'flagged_expr'
122
122
  def reduce_flagged_expr(_production, aRange, theTokens, theChildren)
123
- @options = theChildren[1] if theChildren[1]
123
+ @options = theChildren[1].first if theChildren[1]
124
124
  return_first_child(aRange, theTokens, theChildren)
125
125
  end
126
126
 
@@ -163,7 +163,7 @@ module SrlRuby
163
163
 
164
164
  # rule('quantifiable' => 'begin_anchor? anchorable end_anchor?')
165
165
  def reduce_quantifiable(_production, _range, _tokens, theChildren)
166
- Regex::Concatenation.new(*theChildren.compact)
166
+ Regex::Concatenation.new(*theChildren.flatten.compact)
167
167
  end
168
168
 
169
169
  # rule 'begin_anchor' => %w[STARTS WITH]
@@ -195,7 +195,7 @@ module SrlRuby
195
195
 
196
196
  # rule('assertable' => 'term quantifier?').tag 'assertable'
197
197
  def reduce_assertable(_production, _range, _tokens, theChildren)
198
- (term, quantifier) = theChildren
198
+ (term, quantifier) = theChildren.flatten
199
199
  quantifier ? repetition(term, quantifier) : term
200
200
  end
201
201
 
@@ -5,7 +5,7 @@ require 'rley' # Load the gem
5
5
  module SrlRuby
6
6
  ########################################
7
7
  # SRL grammar
8
- builder = Rley::Notation::GrammarBuilder.new do
8
+ builder = Rley::grammar_builder do
9
9
  # Separators...
10
10
  add_terminals('LPAREN', 'RPAREN', 'COMMA')
11
11
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SrlRuby
4
- VERSION = '0.4.8'
4
+ VERSION = '0.4.9'
5
5
  end
@@ -7,7 +7,7 @@ require 'rley' # Load the Rley gem
7
7
  # [File format](https://github.com/SimpleRegex/Test-Rules/blob/master/README.md)
8
8
  ########################################
9
9
  # Define a grammar for basic arithmetical expressions
10
- builder = Rley::Notation::GrammarBuilder.new do
10
+ builder = Rley::grammar_builder do
11
11
  # Punctuation
12
12
  add_terminals('COLON', 'DASH')
13
13
 
@@ -89,6 +89,8 @@ module Regex # Open this namespace, to get rid of scope qualifiers
89
89
 
90
90
  # Try with our escape sequence samples
91
91
  (SampleDigrams + SampleNumEscs).each do |escape_seq|
92
+
93
+ # Build a string from escape sequence literal
92
94
  expectation = String.class_eval(%Q|"#{escape_seq}"|, __FILE__, __LINE__)
93
95
  new_ch = Character.new(escape_seq).to_str
94
96
  new_ch == expectation
@@ -113,6 +115,8 @@ module Regex # Open this namespace, to get rid of scope qualifiers
113
115
 
114
116
  # Try with our escape sequence samples
115
117
  (SampleDigrams + SampleNumEscs).each do |escape_seq|
118
+
119
+ # Get ordinal value of given escape sequence
116
120
  expectation = String.class_eval(%Q|"#{escape_seq}".ord()|, __FILE__, __LINE__)
117
121
  expect(Character.new(escape_seq).codepoint).to eq(expectation)
118
122
  end
data/srl_ruby.gemspec CHANGED
@@ -68,7 +68,7 @@ SUMMARY
68
68
  spec.required_ruby_version = '>= 2.5.0'
69
69
 
70
70
  # Runtime dependencies
71
- spec.add_dependency 'rley', '~> 0.8.02'
71
+ spec.add_dependency 'rley', '~> 0.8.08'
72
72
 
73
73
  # Development dependencies
74
74
  spec.add_development_dependency 'bundler', '~> 2.2.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: srl_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.8
4
+ version: 0.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitri Geshef
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-27 00:00:00.000000000 Z
11
+ date: 2021-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rley
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.8.02
19
+ version: 0.8.08
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.8.02
26
+ version: 0.8.08
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement