regexp_parser 2.7.0 → 2.8.1
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 +62 -3
- data/Gemfile +3 -3
- data/LICENSE +1 -1
- data/README.md +33 -30
- 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/properties/long.csv +11 -0
- data/lib/regexp_parser/scanner/properties/short.csv +2 -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 +17 -1
- data/lib/regexp_parser/syntax/token/virtual.rb +11 -0
- data/lib/regexp_parser/version.rb +1 -1
- metadata +9 -3
@@ -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
|
@@ -59,7 +59,7 @@ module Regexp::Syntax
|
|
59
59
|
|
60
60
|
Age_V3_1_0 = %i[age=13.0]
|
61
61
|
|
62
|
-
Age_V3_2_0 = %i[age=14.0]
|
62
|
+
Age_V3_2_0 = %i[age=14.0 age=15.0]
|
63
63
|
|
64
64
|
Age = all[:Age_V]
|
65
65
|
|
@@ -321,6 +321,8 @@ module Regexp::Syntax
|
|
321
321
|
|
322
322
|
Script_V3_2_0 = %i[
|
323
323
|
cypro_minoan
|
324
|
+
kawi
|
325
|
+
nag_mundari
|
324
326
|
old_uyghur
|
325
327
|
tangsa
|
326
328
|
toto
|
@@ -667,11 +669,18 @@ module Regexp::Syntax
|
|
667
669
|
|
668
670
|
UnicodeBlock_V3_2_0 = %i[
|
669
671
|
in_arabic_extended_b
|
672
|
+
in_arabic_extended_c
|
673
|
+
in_cjk_unified_ideographs_extension_h
|
670
674
|
in_cypro_minoan
|
675
|
+
in_cyrillic_extended_d
|
676
|
+
in_devanagari_extended_a
|
671
677
|
in_ethiopic_extended_b
|
678
|
+
in_kaktovik_numerals
|
672
679
|
in_kana_extended_b
|
680
|
+
in_kawi
|
673
681
|
in_latin_extended_f
|
674
682
|
in_latin_extended_g
|
683
|
+
in_nag_mundari
|
675
684
|
in_old_uyghur
|
676
685
|
in_tangsa
|
677
686
|
in_toto
|
@@ -690,6 +699,10 @@ module Regexp::Syntax
|
|
690
699
|
emoji_presentation
|
691
700
|
]
|
692
701
|
|
702
|
+
Emoji_V2_6_0 = %i[
|
703
|
+
extended_pictographic
|
704
|
+
]
|
705
|
+
|
693
706
|
Emoji = all[:Emoji_V]
|
694
707
|
|
695
708
|
V1_9_0 = Category::All + POSIX + all[:V1_9_0]
|
@@ -713,5 +726,8 @@ module Regexp::Syntax
|
|
713
726
|
|
714
727
|
Map[UnicodeProperty::Type] = UnicodeProperty::All
|
715
728
|
Map[UnicodeProperty::NonType] = UnicodeProperty::All
|
729
|
+
|
730
|
+
# alias for symmetry between token symbol and Token module name
|
731
|
+
Property = UnicodeProperty
|
716
732
|
end
|
717
733
|
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.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: 2023-
|
11
|
+
date: 2023-06-10 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,9 @@ 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
|
62
67
|
- lib/regexp_parser/scanner/properties/long.csv
|
63
68
|
- lib/regexp_parser/scanner/properties/short.csv
|
64
69
|
- lib/regexp_parser/scanner/property.rl
|
@@ -80,6 +85,7 @@ files:
|
|
80
85
|
- lib/regexp_parser/syntax/token/posix_class.rb
|
81
86
|
- lib/regexp_parser/syntax/token/quantifier.rb
|
82
87
|
- lib/regexp_parser/syntax/token/unicode_property.rb
|
88
|
+
- lib/regexp_parser/syntax/token/virtual.rb
|
83
89
|
- lib/regexp_parser/syntax/version_lookup.rb
|
84
90
|
- lib/regexp_parser/syntax/versions.rb
|
85
91
|
- lib/regexp_parser/syntax/versions/1.8.6.rb
|
@@ -125,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
131
|
- !ruby/object:Gem::Version
|
126
132
|
version: '0'
|
127
133
|
requirements: []
|
128
|
-
rubygems_version: 3.4.
|
134
|
+
rubygems_version: 3.4.10
|
129
135
|
signing_key:
|
130
136
|
specification_version: 4
|
131
137
|
summary: Scanner, lexer, parser for ruby's regular expressions
|