File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,11 @@ class QRegex::P5Regex::Actions is HLL::Actions {
168
168
QAST ::Regex. new ( : rxtype<altseq >, | @ alts );
169
169
make $ qast ;
170
170
}
171
+
172
+ method p5backslash :sym <A >($/ ) {
173
+ make QAST ::Regex. new ( : rxtype<anchor >, : subtype<bos >, : node($/ ) );
174
+
175
+ }
171
176
172
177
method p5backslash :sym <s >($/ ) {
173
178
make QAST ::Regex. new (: rxtype<cclass >, ' .CCLASS_WHITESPACE' ,
@@ -181,6 +186,21 @@ class QRegex::P5Regex::Actions is HLL::Actions {
181
186
QAST ::Node. new ( QAST ::SVal. new ( : value(' wb' ) ) ));
182
187
}
183
188
189
+ method p5backslash :sym <z >($/ ) {
190
+ make QAST ::Regex. new ( : rxtype<anchor >, : subtype<eos >, : node($/ ) );
191
+ }
192
+
193
+ method p5backslash :sym <Z >($/ ) {
194
+ make QAST ::Regex. new (
195
+ : rxtype(' concat' ),
196
+ QAST ::Regex. new (
197
+ : rxtype(' quant' ), : min (0 ), : max (1 ),
198
+ QAST ::Regex. new ( : rxtype(' literal' ), " \n " )
199
+ ),
200
+ QAST ::Regex. new ( : rxtype<anchor >, : subtype(' eos' ), : node($/ ) )
201
+ );
202
+ }
203
+
184
204
method p5backslash :sym <misc >($/ ) {
185
205
if $ < litchar > {
186
206
make QAST ::Regex. new ( ~ $ < litchar > , : rxtype(' literal' ), : node($/ ) );
Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ grammar QRegex::P5Regex::Grammar is HLL::Grammar {
81
81
82
82
proto token p5backslash { <...> }
83
83
84
+ token p5backslash :sym <A > { <sym > }
85
+ token p5backslash :sym <z > { <sym > }
86
+ token p5backslash :sym <Z > { <sym > }
84
87
token p5backslash :sym <b > { $ < sym > =[<[ bB ] >] }
85
88
token p5backslash :sym <s > { $ < sym > =[<[ dDnNsSwW ] >] }
86
89
token p5backslash :sym <misc > { $ < litchar > =(\W ) | $ < number > =(\d + ) }
Original file line number Diff line number Diff line change @@ -47,3 +47,10 @@ ab\d+cdef ab42cdef y digit
47
47
a\D+f abcdef y not digit
48
48
a\D+f ab0cdef n not digit
49
49
\Ba\B a- n not boundary
50
+ a\Z a\n y basic \Z + (1)
51
+ a\Z a y basic \Z + (2)
52
+ a\Z ab n basic \Z - (1)
53
+ a\Z a\nb n basic \Z - (2)
54
+ a\z a y basic \z +
55
+ a\z a\n n basic \z - (1)
56
+ a\z a\nb n basic \z - (2)
You can’t perform that action at this time.
0 commit comments