File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -1239,6 +1239,11 @@ class QAST::Compiler is HLL::Compiler {
1239
1239
1240
1240
$ ops ;
1241
1241
}
1242
+
1243
+ method dba ($ node ) {
1244
+ # Doesn't compile into another; really just for the NFA.
1245
+ self . post_new(' Ops' , : result(% * REG <cur >))
1246
+ }
1242
1247
1243
1248
my % cclass_code ;
1244
1249
INIT {
Original file line number Diff line number Diff line change @@ -259,6 +259,8 @@ class QRegex::P6Regex::Actions is HLL::Actions {
259
259
: rxtype<concat >
260
260
);
261
261
}
262
+
263
+ method metachar :sym <mod >($/ ) { make $ < mod_internal > . ast; }
262
264
263
265
method backslash :sym <s >($/ ) {
264
266
make QAST ::Regex. new (: rxtype<cclass >, ' .CCLASS_WHITESPACE' ,
@@ -524,7 +526,12 @@ class QRegex::P6Regex::Actions is HLL::Actions {
524
526
method mod_internal ($/ ) {
525
527
if $ < quote_EXPR > {
526
528
if $ < quote_EXPR > [0 ]. ast ~~ QAST ::SVal {
527
- % * RX { ~ $ < mod_ident >< sym > } := $ < quote_EXPR > [0 ]. ast. value ;
529
+ my $ key := ~ $ < mod_ident >< sym > ;
530
+ my $ val := $ < quote_EXPR > [0 ]. ast. value ;
531
+ % * RX {$ key } := $ val ;
532
+ make $ key eq ' dba'
533
+ ?? QAST ::Regex. new ( : rxtype(' dba' ), : name($ val ) )
534
+ !! 0 ;
528
535
}
529
536
else {
530
537
$/ . CURSOR. panic(" Internal modifier strings must be literals" );
@@ -533,8 +540,8 @@ class QRegex::P6Regex::Actions is HLL::Actions {
533
540
else {
534
541
my $ n := $ < n > [0 ] gt ' ' ?? + $ < n > [0 ] !! 1 ;
535
542
% * RX { ~ $ < mod_ident >< sym > } := $ n ;
543
+ make 0 ;
536
544
}
537
- make 0 ;
538
545
}
539
546
540
547
sub backmod ($ ast , $ backmod ) {
You can’t perform that action at this time.
0 commit comments