regexp_parser 2.9.1 → 2.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/regexp_parser/expression/classes/keep.rb +1 -1
- data/lib/regexp_parser/parser.rb +3 -3
- data/lib/regexp_parser/scanner/scanner.rl +2 -2
- data/lib/regexp_parser/scanner.rb +725 -768
- data/lib/regexp_parser/version.rb +1 -1
- data/regexp_parser.gemspec +2 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e429c2cc03b2c9c31e3bf5c3dc71ffc15c5032a35f52c3abae9134d02c45496f
|
4
|
+
data.tar.gz: 6a89f8618748c8ab479c4d81ff44c9fabfb461337993fcc641da23d6c349a1ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f9cb8133b24db6f8bb2199356101c234960839ae1251a77da6fe4faeaafc2ab1d6f679f5a6e081860d4a9137a91aeb7793dbc617f04c9747b9110d64134d45f
|
7
|
+
data.tar.gz: bdfe1c9a13fef4f891c28787588c92be37c1c8a61e0d473d05482a67207675be090ec5a74d12b46cf93c8d2565388c6680acd89ad65bc63454514ee720181c82
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Regexp::Expression
|
2
2
|
module Keep
|
3
|
-
#
|
3
|
+
# TODO: in regexp_parser v3.0.0 this should possibly be a Subexpression
|
4
4
|
# that contains all expressions to its left.
|
5
5
|
class Mark < Regexp::Expression::Base; end
|
6
6
|
end
|
data/lib/regexp_parser/parser.rb
CHANGED
@@ -575,18 +575,18 @@ class Regexp::Parser
|
|
575
575
|
options_stack.last
|
576
576
|
end
|
577
577
|
|
578
|
-
# Assigns referenced expressions to
|
578
|
+
# Assigns referenced expressions to referring expressions, e.g. if there is
|
579
579
|
# an instance of Backreference::Number, its #referenced_expression is set to
|
580
580
|
# the instance of Group::Capture that it refers to via its number.
|
581
581
|
def assign_referenced_expressions
|
582
|
-
# find all
|
582
|
+
# find all referenceable and referring expressions
|
583
583
|
targets = { 0 => root }
|
584
584
|
referrers = []
|
585
585
|
root.each_expression do |exp|
|
586
586
|
exp.is_a?(Group::Capture) && targets[exp.identifier] = exp
|
587
587
|
referrers << exp if exp.referential?
|
588
588
|
end
|
589
|
-
# assign reference expression to
|
589
|
+
# assign reference expression to referring expressions
|
590
590
|
# (in a second iteration because there might be forward references)
|
591
591
|
referrers.each do |exp|
|
592
592
|
exp.referenced_expression = targets[exp.reference] ||
|
@@ -78,8 +78,8 @@
|
|
78
78
|
# try to treat every other group head as options group, like Ruby
|
79
79
|
group_options = '?' . ( [^!#'():<=>~]+ . ':'? ) ?;
|
80
80
|
|
81
|
-
group_name_id_ab = ([
|
82
|
-
group_name_id_sq = ([^0-9\-']
|
81
|
+
group_name_id_ab = ([^!=0-9\->] | utf8_multibyte) . ([^>] | utf8_multibyte)*;
|
82
|
+
group_name_id_sq = ([^0-9\-'] | utf8_multibyte) . ([^'] | utf8_multibyte)*;
|
83
83
|
group_number = '-'? . [0-9]+;
|
84
84
|
group_level = [+\-] . [0-9]+;
|
85
85
|
|