regexp_parser 1.8.1 → 1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +11 -7
- data/lib/regexp_parser/expression.rb +6 -2
- data/lib/regexp_parser/syntax/version_lookup.rb +2 -2
- data/lib/regexp_parser/version.rb +1 -1
- metadata +58 -58
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d1c795eb67eee01aa7976a672349b9a0c7f6364262ffb8f53488f6d9949db07
|
4
|
+
data.tar.gz: a38fddc769f16841e54f5dde90535e31ef7145e5bd41560ccf70443968495493
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dfcd3ba9f2a09370142e892184ccb9a1a973e24dea691582ca43cc670589dd7050eb30dbd924ae9e0584d124183dc2f62adca475628a726ecffaa22fcfb8903
|
7
|
+
data.tar.gz: cd23a308e4d62af9a07bbec164c96ca3213de5a4f686c450fc90bca56387faa88febb8a3387e810d0fd8b78e06b191bd76777fe8b3f3cda9da5582b9009d1144
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
### [1.8.2] - 2020-10-11 - [Janosch Müller](mailto:janosch84@gmail.com)
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
|
7
|
+
- fix `FrozenError` in `Expression::Base#repetitions` on Ruby 3.0
|
8
|
+
* thanks to [Thomas Walpole](https://github.com/twalpole)
|
9
|
+
- removed "unknown future version" warning on Ruby 3.0
|
10
|
+
|
3
11
|
### [1.8.1] - 2020-09-28 - [Janosch Müller](mailto:janosch84@gmail.com)
|
4
12
|
|
5
13
|
### Fixed
|
data/README.md
CHANGED
@@ -8,8 +8,8 @@ A Ruby gem for tokenizing, parsing, and transforming regular expressions.
|
|
8
8
|
* A scanner/tokenizer based on [Ragel](http://www.colm.net/open-source/ragel/)
|
9
9
|
* A lexer that produces a "stream" of token objects.
|
10
10
|
* A parser that produces a "tree" of Expression objects (OO API)
|
11
|
-
* Runs on Ruby 2.x and JRuby runtimes
|
12
|
-
* Recognizes Ruby 1.8, 1.9, and
|
11
|
+
* Runs on Ruby 2.x, 3.x and JRuby runtimes
|
12
|
+
* Recognizes Ruby 1.8, 1.9, 2.x and 3.x regular expressions [See Supported Syntax](#supported-syntax)
|
13
13
|
|
14
14
|
|
15
15
|
_For examples of regexp_parser in use, see [Example Projects](#example-projects)._
|
@@ -18,7 +18,7 @@ _For examples of regexp_parser in use, see [Example Projects](#example-projects)
|
|
18
18
|
---
|
19
19
|
## Requirements
|
20
20
|
|
21
|
-
* Ruby >=
|
21
|
+
* Ruby >= 2.0
|
22
22
|
* Ragel >= 6.0, but only if you want to build the gem or work on the scanner.
|
23
23
|
|
24
24
|
|
@@ -317,7 +317,7 @@ Expression class. See the next section for details._
|
|
317
317
|
|
318
318
|
## Supported Syntax
|
319
319
|
The three modules support all the regular expression syntax features of Ruby 1.8,
|
320
|
-
1.9, and
|
320
|
+
1.9, 2.x and 3.x:
|
321
321
|
|
322
322
|
_Note that not all of these are available in all versions of Ruby_
|
323
323
|
|
@@ -440,13 +440,17 @@ rake install
|
|
440
440
|
## Example Projects
|
441
441
|
Projects using regexp_parser.
|
442
442
|
|
443
|
+
- [capybara](https://github.com/teamcapybara/capybara) is an integration testing tool that uses regexp_parser to convert Regexps to css/xpath selectors.
|
444
|
+
|
445
|
+
- [js_regex](https://github.com/janosch-x/js_regex) converts Ruby regular expressions to JavaScript-compatible regular expressions.
|
446
|
+
|
443
447
|
- [meta_re](https://github.com/ammar/meta_re) is a regular expression preprocessor with alias support.
|
444
448
|
|
445
449
|
- [mutant](https://github.com/mbj/mutant) (before v0.9.0) manipulates your regular expressions (amongst others) to see if your tests cover their behavior.
|
446
450
|
|
447
|
-
- [
|
451
|
+
- [rubocop](https://github.com/rubocop-hq/rubocop) is a linter for Ruby that uses regexp_parser to lint Regexps.
|
448
452
|
|
449
|
-
- [
|
453
|
+
- [twitter-cldr-rb](https://github.com/twitter/twitter-cldr-rb) is a localization helper that uses regexp_parser to generate examples of postal codes.
|
450
454
|
|
451
455
|
|
452
456
|
## References
|
@@ -475,4 +479,4 @@ Documentation and books used while working on this project.
|
|
475
479
|
|
476
480
|
---
|
477
481
|
##### Copyright
|
478
|
-
_Copyright (c) 2010-
|
482
|
+
_Copyright (c) 2010-2020 Ammar Ali. See LICENSE file for details._
|
@@ -80,8 +80,12 @@ module Regexp::Expression
|
|
80
80
|
return 1..1 unless quantified?
|
81
81
|
min = quantifier.min
|
82
82
|
max = quantifier.max < 0 ? Float::INFINITY : quantifier.max
|
83
|
-
|
84
|
-
|
83
|
+
range = min..max
|
84
|
+
# fix Range#minmax on old Rubies - https://bugs.ruby-lang.org/issues/15807
|
85
|
+
if RUBY_VERSION.to_f < 2.7
|
86
|
+
range.define_singleton_method(:minmax) { [min, max] }
|
87
|
+
end
|
88
|
+
range
|
85
89
|
end
|
86
90
|
|
87
91
|
def greedy?
|
@@ -74,9 +74,9 @@ module Regexp::Syntax
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def warn_if_future_version(const_name)
|
77
|
-
return if comparable_version(const_name) < comparable_version('
|
77
|
+
return if comparable_version(const_name) < comparable_version('4.0.0')
|
78
78
|
|
79
|
-
warn('This library has only been tested up to Ruby
|
79
|
+
warn('This library has only been tested up to Ruby 3.x, '\
|
80
80
|
"but you are running with #{const_get(const_name).inspect}")
|
81
81
|
end
|
82
82
|
end
|
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.8.
|
4
|
+
version: 1.8.2
|
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-
|
11
|
+
date: 2020-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A library for tokenizing, lexing, and parsing Ruby regular expressions.
|
14
14
|
email:
|
@@ -185,79 +185,79 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
185
|
- !ruby/object:Gem::Version
|
186
186
|
version: '0'
|
187
187
|
requirements: []
|
188
|
-
rubygems_version: 3.1
|
188
|
+
rubygems_version: 3.2.0.rc.1
|
189
189
|
signing_key:
|
190
190
|
specification_version: 4
|
191
191
|
summary: Scanner, lexer, parser for ruby's regular expressions
|
192
192
|
test_files:
|
193
|
-
- spec/
|
194
|
-
- spec/
|
195
|
-
- spec/
|
196
|
-
- spec/
|
193
|
+
- spec/expression/base_spec.rb
|
194
|
+
- spec/expression/clone_spec.rb
|
195
|
+
- spec/expression/conditional_spec.rb
|
196
|
+
- spec/expression/free_space_spec.rb
|
197
|
+
- spec/expression/methods/match_length_spec.rb
|
198
|
+
- spec/expression/methods/match_spec.rb
|
199
|
+
- spec/expression/methods/strfregexp_spec.rb
|
200
|
+
- spec/expression/methods/tests_spec.rb
|
201
|
+
- spec/expression/methods/traverse_spec.rb
|
202
|
+
- spec/expression/options_spec.rb
|
203
|
+
- spec/expression/root_spec.rb
|
204
|
+
- spec/expression/sequence_spec.rb
|
205
|
+
- spec/expression/subexpression_spec.rb
|
206
|
+
- spec/expression/to_h_spec.rb
|
207
|
+
- spec/expression/to_s_spec.rb
|
197
208
|
- spec/lexer/all_spec.rb
|
198
209
|
- spec/lexer/conditionals_spec.rb
|
199
|
-
- spec/lexer/nesting_spec.rb
|
200
210
|
- spec/lexer/delimiters_spec.rb
|
201
|
-
- spec/lexer/
|
211
|
+
- spec/lexer/escapes_spec.rb
|
212
|
+
- spec/lexer/keep_spec.rb
|
202
213
|
- spec/lexer/literals_spec.rb
|
214
|
+
- spec/lexer/nesting_spec.rb
|
215
|
+
- spec/lexer/refcalls_spec.rb
|
216
|
+
- spec/parser/all_spec.rb
|
217
|
+
- spec/parser/alternation_spec.rb
|
218
|
+
- spec/parser/anchors_spec.rb
|
219
|
+
- spec/parser/conditionals_spec.rb
|
220
|
+
- spec/parser/errors_spec.rb
|
203
221
|
- spec/parser/escapes_spec.rb
|
204
|
-
- spec/parser/properties_spec.rb
|
205
|
-
- spec/parser/sets_spec.rb
|
206
222
|
- spec/parser/free_space_spec.rb
|
223
|
+
- spec/parser/groups_spec.rb
|
207
224
|
- spec/parser/keep_spec.rb
|
208
225
|
- spec/parser/options_spec.rb
|
209
|
-
- spec/parser/all_spec.rb
|
210
|
-
- spec/parser/conditionals_spec.rb
|
211
|
-
- spec/parser/types_spec.rb
|
212
|
-
- spec/parser/anchors_spec.rb
|
213
|
-
- spec/parser/alternation_spec.rb
|
214
226
|
- spec/parser/posix_classes_spec.rb
|
215
|
-
- spec/parser/
|
216
|
-
- spec/parser/set/intersections_spec.rb
|
217
|
-
- spec/parser/errors_spec.rb
|
218
|
-
- spec/parser/refcalls_spec.rb
|
219
|
-
- spec/parser/groups_spec.rb
|
227
|
+
- spec/parser/properties_spec.rb
|
220
228
|
- spec/parser/quantifiers_spec.rb
|
221
|
-
- spec/
|
222
|
-
- spec/
|
223
|
-
- spec/
|
224
|
-
- spec/
|
225
|
-
- spec/
|
226
|
-
- spec/expression/methods/match_length_spec.rb
|
227
|
-
- spec/expression/methods/traverse_spec.rb
|
228
|
-
- spec/expression/methods/strfregexp_spec.rb
|
229
|
-
- spec/expression/methods/tests_spec.rb
|
230
|
-
- spec/expression/free_space_spec.rb
|
231
|
-
- spec/expression/options_spec.rb
|
232
|
-
- spec/expression/to_s_spec.rb
|
233
|
-
- spec/expression/root_spec.rb
|
234
|
-
- spec/expression/sequence_spec.rb
|
235
|
-
- spec/expression/clone_spec.rb
|
236
|
-
- spec/expression/to_h_spec.rb
|
237
|
-
- spec/expression/conditional_spec.rb
|
238
|
-
- spec/expression/base_spec.rb
|
239
|
-
- spec/syntax/syntax_spec.rb
|
240
|
-
- spec/syntax/syntax_token_map_spec.rb
|
241
|
-
- spec/syntax/versions/1.9.3_spec.rb
|
242
|
-
- spec/syntax/versions/2.2.0_spec.rb
|
243
|
-
- spec/syntax/versions/1.9.1_spec.rb
|
244
|
-
- spec/syntax/versions/2.0.0_spec.rb
|
245
|
-
- spec/syntax/versions/1.8.6_spec.rb
|
246
|
-
- spec/syntax/versions/aliases_spec.rb
|
247
|
-
- spec/scanner/escapes_spec.rb
|
248
|
-
- spec/scanner/properties_spec.rb
|
249
|
-
- spec/scanner/sets_spec.rb
|
250
|
-
- spec/scanner/free_space_spec.rb
|
251
|
-
- spec/scanner/keep_spec.rb
|
252
|
-
- spec/scanner/options_spec.rb
|
229
|
+
- spec/parser/refcalls_spec.rb
|
230
|
+
- spec/parser/set/intersections_spec.rb
|
231
|
+
- spec/parser/set/ranges_spec.rb
|
232
|
+
- spec/parser/sets_spec.rb
|
233
|
+
- spec/parser/types_spec.rb
|
253
234
|
- spec/scanner/all_spec.rb
|
254
|
-
- spec/scanner/conditionals_spec.rb
|
255
|
-
- spec/scanner/types_spec.rb
|
256
235
|
- spec/scanner/anchors_spec.rb
|
257
|
-
- spec/scanner/
|
258
|
-
- spec/scanner/errors_spec.rb
|
236
|
+
- spec/scanner/conditionals_spec.rb
|
259
237
|
- spec/scanner/delimiters_spec.rb
|
260
|
-
- spec/scanner/
|
238
|
+
- spec/scanner/errors_spec.rb
|
239
|
+
- spec/scanner/escapes_spec.rb
|
240
|
+
- spec/scanner/free_space_spec.rb
|
261
241
|
- spec/scanner/groups_spec.rb
|
242
|
+
- spec/scanner/keep_spec.rb
|
262
243
|
- spec/scanner/literals_spec.rb
|
244
|
+
- spec/scanner/meta_spec.rb
|
245
|
+
- spec/scanner/options_spec.rb
|
246
|
+
- spec/scanner/properties_spec.rb
|
263
247
|
- spec/scanner/quantifiers_spec.rb
|
248
|
+
- spec/scanner/refcalls_spec.rb
|
249
|
+
- spec/scanner/sets_spec.rb
|
250
|
+
- spec/scanner/types_spec.rb
|
251
|
+
- spec/spec_helper.rb
|
252
|
+
- spec/support/runner.rb
|
253
|
+
- spec/support/shared_examples.rb
|
254
|
+
- spec/support/warning_extractor.rb
|
255
|
+
- spec/syntax/syntax_spec.rb
|
256
|
+
- spec/syntax/syntax_token_map_spec.rb
|
257
|
+
- spec/syntax/versions/1.8.6_spec.rb
|
258
|
+
- spec/syntax/versions/1.9.1_spec.rb
|
259
|
+
- spec/syntax/versions/1.9.3_spec.rb
|
260
|
+
- spec/syntax/versions/2.0.0_spec.rb
|
261
|
+
- spec/syntax/versions/2.2.0_spec.rb
|
262
|
+
- spec/syntax/versions/aliases_spec.rb
|
263
|
+
- spec/token/token_spec.rb
|