regexp_parser 1.7.1 → 2.1.1

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 +4 -4
  2. data/CHANGELOG.md +138 -0
  3. data/Gemfile +6 -1
  4. data/README.md +23 -11
  5. data/Rakefile +8 -8
  6. data/lib/regexp_parser/error.rb +4 -0
  7. data/lib/regexp_parser/expression.rb +13 -21
  8. data/lib/regexp_parser/expression/classes/backref.rb +5 -0
  9. data/lib/regexp_parser/expression/classes/conditional.rb +11 -1
  10. data/lib/regexp_parser/expression/classes/free_space.rb +2 -2
  11. data/lib/regexp_parser/expression/classes/group.rb +28 -3
  12. data/lib/regexp_parser/expression/classes/property.rb +1 -1
  13. data/lib/regexp_parser/expression/classes/root.rb +4 -16
  14. data/lib/regexp_parser/expression/classes/set/range.rb +2 -1
  15. data/lib/regexp_parser/expression/methods/match_length.rb +2 -2
  16. data/lib/regexp_parser/expression/methods/traverse.rb +2 -2
  17. data/lib/regexp_parser/expression/quantifier.rb +10 -1
  18. data/lib/regexp_parser/expression/sequence.rb +3 -19
  19. data/lib/regexp_parser/expression/subexpression.rb +1 -1
  20. data/lib/regexp_parser/lexer.rb +6 -6
  21. data/lib/regexp_parser/parser.rb +325 -344
  22. data/lib/regexp_parser/scanner.rb +1320 -1385
  23. data/lib/regexp_parser/scanner/char_type.rl +11 -11
  24. data/lib/regexp_parser/scanner/property.rl +2 -2
  25. data/lib/regexp_parser/scanner/scanner.rl +231 -253
  26. data/lib/regexp_parser/syntax.rb +8 -6
  27. data/lib/regexp_parser/syntax/any.rb +3 -3
  28. data/lib/regexp_parser/syntax/base.rb +1 -1
  29. data/lib/regexp_parser/syntax/version_lookup.rb +4 -4
  30. data/lib/regexp_parser/version.rb +1 -1
  31. data/regexp_parser.gemspec +1 -1
  32. data/spec/expression/base_spec.rb +10 -0
  33. data/spec/expression/clone_spec.rb +36 -4
  34. data/spec/expression/free_space_spec.rb +2 -2
  35. data/spec/expression/methods/match_length_spec.rb +2 -2
  36. data/spec/expression/subexpression_spec.rb +1 -1
  37. data/spec/expression/to_s_spec.rb +39 -31
  38. data/spec/lexer/literals_spec.rb +24 -49
  39. data/spec/lexer/refcalls_spec.rb +5 -0
  40. data/spec/parser/all_spec.rb +2 -2
  41. data/spec/parser/errors_spec.rb +1 -1
  42. data/spec/parser/escapes_spec.rb +1 -1
  43. data/spec/parser/options_spec.rb +28 -0
  44. data/spec/parser/quantifiers_spec.rb +16 -0
  45. data/spec/parser/refcalls_spec.rb +5 -0
  46. data/spec/parser/set/ranges_spec.rb +3 -3
  47. data/spec/scanner/escapes_spec.rb +12 -1
  48. data/spec/scanner/free_space_spec.rb +32 -0
  49. data/spec/scanner/groups_spec.rb +10 -1
  50. data/spec/scanner/literals_spec.rb +28 -38
  51. data/spec/scanner/options_spec.rb +36 -0
  52. data/spec/scanner/quantifiers_spec.rb +18 -13
  53. data/spec/scanner/refcalls_spec.rb +19 -0
  54. data/spec/scanner/sets_spec.rb +65 -16
  55. data/spec/spec_helper.rb +1 -0
  56. metadata +61 -60
  57. data/spec/expression/root_spec.rb +0 -9
  58. data/spec/expression/sequence_spec.rb +0 -9
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'ice_nine'
1
2
  require 'regexp_parser'
2
3
  require 'regexp_property_values'
3
4
  require_relative 'support/shared_examples'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: regexp_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ammar Ali
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-07 00:00:00.000000000 Z
11
+ date: 2021-02-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A library for tokenizing, lexing, and parsing Ruby regular expressions.
14
14
  email:
@@ -23,6 +23,7 @@ files:
23
23
  - README.md
24
24
  - Rakefile
25
25
  - lib/regexp_parser.rb
26
+ - lib/regexp_parser/error.rb
26
27
  - lib/regexp_parser/expression.rb
27
28
  - lib/regexp_parser/expression/classes/alternation.rb
28
29
  - lib/regexp_parser/expression/classes/anchor.rb
@@ -102,8 +103,6 @@ files:
102
103
  - spec/expression/methods/tests_spec.rb
103
104
  - spec/expression/methods/traverse_spec.rb
104
105
  - spec/expression/options_spec.rb
105
- - spec/expression/root_spec.rb
106
- - spec/expression/sequence_spec.rb
107
106
  - spec/expression/subexpression_spec.rb
108
107
  - spec/expression/to_h_spec.rb
109
108
  - spec/expression/to_s_spec.rb
@@ -124,6 +123,7 @@ files:
124
123
  - spec/parser/free_space_spec.rb
125
124
  - spec/parser/groups_spec.rb
126
125
  - spec/parser/keep_spec.rb
126
+ - spec/parser/options_spec.rb
127
127
  - spec/parser/posix_classes_spec.rb
128
128
  - spec/parser/properties_spec.rb
129
129
  - spec/parser/quantifiers_spec.rb
@@ -143,6 +143,7 @@ files:
143
143
  - spec/scanner/keep_spec.rb
144
144
  - spec/scanner/literals_spec.rb
145
145
  - spec/scanner/meta_spec.rb
146
+ - spec/scanner/options_spec.rb
146
147
  - spec/scanner/properties_spec.rb
147
148
  - spec/scanner/quantifiers_spec.rb
148
149
  - spec/scanner/refcalls_spec.rb
@@ -176,84 +177,84 @@ required_ruby_version: !ruby/object:Gem::Requirement
176
177
  requirements:
177
178
  - - ">="
178
179
  - !ruby/object:Gem::Version
179
- version: 1.9.1
180
+ version: 2.0.0
180
181
  required_rubygems_version: !ruby/object:Gem::Requirement
181
182
  requirements:
182
183
  - - ">="
183
184
  - !ruby/object:Gem::Version
184
185
  version: '0'
185
186
  requirements: []
186
- rubygems_version: 3.1.2
187
+ rubygems_version: 3.2.3
187
188
  signing_key:
188
189
  specification_version: 4
189
190
  summary: Scanner, lexer, parser for ruby's regular expressions
190
191
  test_files:
191
- - spec/token/token_spec.rb
192
- - spec/spec_helper.rb
193
- - spec/lexer/escapes_spec.rb
194
- - spec/lexer/keep_spec.rb
192
+ - spec/expression/base_spec.rb
193
+ - spec/expression/clone_spec.rb
194
+ - spec/expression/conditional_spec.rb
195
+ - spec/expression/free_space_spec.rb
196
+ - spec/expression/methods/match_length_spec.rb
197
+ - spec/expression/methods/match_spec.rb
198
+ - spec/expression/methods/strfregexp_spec.rb
199
+ - spec/expression/methods/tests_spec.rb
200
+ - spec/expression/methods/traverse_spec.rb
201
+ - spec/expression/options_spec.rb
202
+ - spec/expression/subexpression_spec.rb
203
+ - spec/expression/to_h_spec.rb
204
+ - spec/expression/to_s_spec.rb
195
205
  - spec/lexer/all_spec.rb
196
206
  - spec/lexer/conditionals_spec.rb
197
- - spec/lexer/nesting_spec.rb
198
207
  - spec/lexer/delimiters_spec.rb
199
- - spec/lexer/refcalls_spec.rb
208
+ - spec/lexer/escapes_spec.rb
209
+ - spec/lexer/keep_spec.rb
200
210
  - spec/lexer/literals_spec.rb
201
- - spec/parser/escapes_spec.rb
202
- - spec/parser/properties_spec.rb
203
- - spec/parser/sets_spec.rb
204
- - spec/parser/free_space_spec.rb
205
- - spec/parser/keep_spec.rb
211
+ - spec/lexer/nesting_spec.rb
212
+ - spec/lexer/refcalls_spec.rb
206
213
  - spec/parser/all_spec.rb
207
- - spec/parser/conditionals_spec.rb
208
- - spec/parser/types_spec.rb
209
- - spec/parser/anchors_spec.rb
210
214
  - spec/parser/alternation_spec.rb
211
- - spec/parser/posix_classes_spec.rb
212
- - spec/parser/set/ranges_spec.rb
213
- - spec/parser/set/intersections_spec.rb
215
+ - spec/parser/anchors_spec.rb
216
+ - spec/parser/conditionals_spec.rb
214
217
  - spec/parser/errors_spec.rb
215
- - spec/parser/refcalls_spec.rb
218
+ - spec/parser/escapes_spec.rb
219
+ - spec/parser/free_space_spec.rb
216
220
  - spec/parser/groups_spec.rb
221
+ - spec/parser/keep_spec.rb
222
+ - spec/parser/options_spec.rb
223
+ - spec/parser/posix_classes_spec.rb
224
+ - spec/parser/properties_spec.rb
217
225
  - spec/parser/quantifiers_spec.rb
218
- - spec/support/warning_extractor.rb
219
- - spec/support/shared_examples.rb
220
- - spec/support/runner.rb
221
- - spec/expression/subexpression_spec.rb
222
- - spec/expression/methods/match_spec.rb
223
- - spec/expression/methods/match_length_spec.rb
224
- - spec/expression/methods/traverse_spec.rb
225
- - spec/expression/methods/strfregexp_spec.rb
226
- - spec/expression/methods/tests_spec.rb
227
- - spec/expression/free_space_spec.rb
228
- - spec/expression/options_spec.rb
229
- - spec/expression/to_s_spec.rb
230
- - spec/expression/root_spec.rb
231
- - spec/expression/sequence_spec.rb
232
- - spec/expression/clone_spec.rb
233
- - spec/expression/to_h_spec.rb
234
- - spec/expression/conditional_spec.rb
235
- - spec/expression/base_spec.rb
236
- - spec/syntax/syntax_spec.rb
237
- - spec/syntax/syntax_token_map_spec.rb
238
- - spec/syntax/versions/1.9.3_spec.rb
239
- - spec/syntax/versions/2.2.0_spec.rb
240
- - spec/syntax/versions/1.9.1_spec.rb
241
- - spec/syntax/versions/2.0.0_spec.rb
242
- - spec/syntax/versions/1.8.6_spec.rb
243
- - spec/syntax/versions/aliases_spec.rb
244
- - spec/scanner/escapes_spec.rb
245
- - spec/scanner/properties_spec.rb
246
- - spec/scanner/sets_spec.rb
247
- - spec/scanner/free_space_spec.rb
248
- - spec/scanner/keep_spec.rb
226
+ - spec/parser/refcalls_spec.rb
227
+ - spec/parser/set/intersections_spec.rb
228
+ - spec/parser/set/ranges_spec.rb
229
+ - spec/parser/sets_spec.rb
230
+ - spec/parser/types_spec.rb
249
231
  - spec/scanner/all_spec.rb
250
- - spec/scanner/conditionals_spec.rb
251
- - spec/scanner/types_spec.rb
252
232
  - spec/scanner/anchors_spec.rb
253
- - spec/scanner/meta_spec.rb
254
- - spec/scanner/errors_spec.rb
233
+ - spec/scanner/conditionals_spec.rb
255
234
  - spec/scanner/delimiters_spec.rb
256
- - spec/scanner/refcalls_spec.rb
235
+ - spec/scanner/errors_spec.rb
236
+ - spec/scanner/escapes_spec.rb
237
+ - spec/scanner/free_space_spec.rb
257
238
  - spec/scanner/groups_spec.rb
239
+ - spec/scanner/keep_spec.rb
258
240
  - spec/scanner/literals_spec.rb
241
+ - spec/scanner/meta_spec.rb
242
+ - spec/scanner/options_spec.rb
243
+ - spec/scanner/properties_spec.rb
259
244
  - spec/scanner/quantifiers_spec.rb
245
+ - spec/scanner/refcalls_spec.rb
246
+ - spec/scanner/sets_spec.rb
247
+ - spec/scanner/types_spec.rb
248
+ - spec/spec_helper.rb
249
+ - spec/support/runner.rb
250
+ - spec/support/shared_examples.rb
251
+ - spec/support/warning_extractor.rb
252
+ - spec/syntax/syntax_spec.rb
253
+ - spec/syntax/syntax_token_map_spec.rb
254
+ - spec/syntax/versions/1.8.6_spec.rb
255
+ - spec/syntax/versions/1.9.1_spec.rb
256
+ - spec/syntax/versions/1.9.3_spec.rb
257
+ - spec/syntax/versions/2.0.0_spec.rb
258
+ - spec/syntax/versions/2.2.0_spec.rb
259
+ - spec/syntax/versions/aliases_spec.rb
260
+ - spec/token/token_spec.rb
@@ -1,9 +0,0 @@
1
- require 'spec_helper'
2
-
3
- RSpec.describe(Regexp::Expression::Root) do
4
- describe('#initialize') do
5
- it 'supports the old, nonstandard arity for backwards compatibility' do
6
- expect { Root.new }.to output.to_stderr
7
- end
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- require 'spec_helper'
2
-
3
- RSpec.describe(Regexp::Expression::Sequence) do
4
- describe('#initialize') do
5
- it 'supports the old, nonstandard arity for backwards compatibility' do
6
- expect { Sequence.new(0, 0, 0) }.to output.to_stderr
7
- end
8
- end
9
- end