regexp_parser 2.7.0 → 2.8.0
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 +4 -4
- data/CHANGELOG.md +55 -3
- data/Gemfile +2 -2
- data/README.md +32 -29
- data/lib/regexp_parser/expression/base.rb +0 -7
- data/lib/regexp_parser/expression/classes/alternation.rb +1 -1
- data/lib/regexp_parser/expression/classes/backreference.rb +4 -6
- data/lib/regexp_parser/expression/classes/character_set/range.rb +2 -7
- data/lib/regexp_parser/expression/classes/character_set.rb +3 -4
- data/lib/regexp_parser/expression/classes/conditional.rb +2 -14
- data/lib/regexp_parser/expression/classes/escape_sequence.rb +3 -1
- data/lib/regexp_parser/expression/classes/free_space.rb +3 -1
- data/lib/regexp_parser/expression/classes/group.rb +0 -22
- data/lib/regexp_parser/expression/classes/posix_class.rb +5 -1
- data/lib/regexp_parser/expression/classes/unicode_property.rb +5 -2
- data/lib/regexp_parser/expression/methods/construct.rb +2 -4
- data/lib/regexp_parser/expression/methods/parts.rb +23 -0
- data/lib/regexp_parser/expression/methods/printing.rb +26 -0
- data/lib/regexp_parser/expression/methods/tests.rb +40 -3
- data/lib/regexp_parser/expression/methods/traverse.rb +33 -20
- data/lib/regexp_parser/expression/quantifier.rb +30 -17
- data/lib/regexp_parser/expression/sequence.rb +5 -9
- data/lib/regexp_parser/expression/sequence_operation.rb +4 -9
- data/lib/regexp_parser/expression/shared.rb +37 -24
- data/lib/regexp_parser/expression/subexpression.rb +20 -18
- data/lib/regexp_parser/expression.rb +2 -0
- data/lib/regexp_parser/lexer.rb +15 -7
- data/lib/regexp_parser/parser.rb +85 -86
- data/lib/regexp_parser/scanner/errors/premature_end_error.rb +8 -0
- data/lib/regexp_parser/scanner/errors/scanner_error.rb +6 -0
- data/lib/regexp_parser/scanner/errors/validation_error.rb +63 -0
- data/lib/regexp_parser/scanner/mapping.rb +89 -0
- data/lib/regexp_parser/scanner/property.rl +1 -1
- data/lib/regexp_parser/scanner/scanner.rl +35 -129
- data/lib/regexp_parser/scanner.rb +1084 -1303
- data/lib/regexp_parser/syntax/token/backreference.rb +3 -0
- data/lib/regexp_parser/syntax/token/character_set.rb +3 -0
- data/lib/regexp_parser/syntax/token/escape.rb +3 -1
- data/lib/regexp_parser/syntax/token/meta.rb +9 -2
- data/lib/regexp_parser/syntax/token/unicode_property.rb +3 -0
- data/lib/regexp_parser/syntax/token/virtual.rb +11 -0
- data/lib/regexp_parser/version.rb +1 -1
- metadata +9 -2
@@ -1,6 +1,5 @@
|
|
1
1
|
module Regexp::Syntax
|
2
2
|
module Token
|
3
|
-
# TODO: unify naming with RE::EscapeSequence, one way or the other, in v3.0.0
|
4
3
|
module Escape
|
5
4
|
Basic = %i[backslash literal]
|
6
5
|
|
@@ -27,5 +26,8 @@ module Regexp::Syntax
|
|
27
26
|
end
|
28
27
|
|
29
28
|
Map[Escape::Type] = Escape::All
|
29
|
+
|
30
|
+
# alias for symmetry between Token::* and Expression::*
|
31
|
+
EscapeSequence = Escape
|
30
32
|
end
|
31
33
|
end
|
@@ -1,13 +1,20 @@
|
|
1
1
|
module Regexp::Syntax
|
2
2
|
module Token
|
3
3
|
module Meta
|
4
|
-
Basic
|
5
|
-
|
4
|
+
Basic = %i[dot]
|
5
|
+
Alternation = %i[alternation]
|
6
|
+
Extended = Basic + Alternation
|
6
7
|
|
7
8
|
All = Extended
|
8
9
|
Type = :meta
|
9
10
|
end
|
10
11
|
|
11
12
|
Map[Meta::Type] = Meta::All
|
13
|
+
|
14
|
+
# alias for symmetry between Token::* and Expression::*
|
15
|
+
module Alternation
|
16
|
+
All = Meta::Alternation
|
17
|
+
Type = Meta::Type
|
18
|
+
end
|
12
19
|
end
|
13
20
|
end
|
@@ -713,5 +713,8 @@ module Regexp::Syntax
|
|
713
713
|
|
714
714
|
Map[UnicodeProperty::Type] = UnicodeProperty::All
|
715
715
|
Map[UnicodeProperty::NonType] = UnicodeProperty::All
|
716
|
+
|
717
|
+
# alias for symmetry between token symbol and Token module name
|
718
|
+
Property = UnicodeProperty
|
716
719
|
end
|
717
720
|
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: 2.
|
4
|
+
version: 2.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ammar Ali
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A library for tokenizing, lexing, and parsing Ruby regular expressions.
|
14
14
|
email:
|
@@ -47,6 +47,8 @@ files:
|
|
47
47
|
- lib/regexp_parser/expression/methods/match.rb
|
48
48
|
- lib/regexp_parser/expression/methods/match_length.rb
|
49
49
|
- lib/regexp_parser/expression/methods/options.rb
|
50
|
+
- lib/regexp_parser/expression/methods/parts.rb
|
51
|
+
- lib/regexp_parser/expression/methods/printing.rb
|
50
52
|
- lib/regexp_parser/expression/methods/strfregexp.rb
|
51
53
|
- lib/regexp_parser/expression/methods/tests.rb
|
52
54
|
- lib/regexp_parser/expression/methods/traverse.rb
|
@@ -59,6 +61,10 @@ files:
|
|
59
61
|
- lib/regexp_parser/parser.rb
|
60
62
|
- lib/regexp_parser/scanner.rb
|
61
63
|
- lib/regexp_parser/scanner/char_type.rl
|
64
|
+
- lib/regexp_parser/scanner/errors/premature_end_error.rb
|
65
|
+
- lib/regexp_parser/scanner/errors/scanner_error.rb
|
66
|
+
- lib/regexp_parser/scanner/errors/validation_error.rb
|
67
|
+
- lib/regexp_parser/scanner/mapping.rb
|
62
68
|
- lib/regexp_parser/scanner/properties/long.csv
|
63
69
|
- lib/regexp_parser/scanner/properties/short.csv
|
64
70
|
- lib/regexp_parser/scanner/property.rl
|
@@ -80,6 +86,7 @@ files:
|
|
80
86
|
- lib/regexp_parser/syntax/token/posix_class.rb
|
81
87
|
- lib/regexp_parser/syntax/token/quantifier.rb
|
82
88
|
- lib/regexp_parser/syntax/token/unicode_property.rb
|
89
|
+
- lib/regexp_parser/syntax/token/virtual.rb
|
83
90
|
- lib/regexp_parser/syntax/version_lookup.rb
|
84
91
|
- lib/regexp_parser/syntax/versions.rb
|
85
92
|
- lib/regexp_parser/syntax/versions/1.8.6.rb
|