@@ -512,48 +512,6 @@ class QRegex::P6Regex::Actions is HLL::Actions {
512
512
$ ast ;
513
513
}
514
514
515
- our sub buildsub ($ qast , $ block = PAST::Block. new (: blocktype<method >), : $ anon ) {
516
- my $ blockid := $ block . subid;
517
- my $ hashpast := PAST::Op. new ( : pasttype<hash > );
518
- for capnames($ qast , 0 ) {
519
- if $ _ . key gt ' ' {
520
- $ hashpast . push ($ _ . key );
521
- $ hashpast . push (
522
- nqp ::iscclass(pir::const::CCLASS_NUMERIC, $ _ . key , 0 ) + ($ _ . value > 1 ) * 2 );
523
- }
524
- }
525
- my $ initpast := PAST::Stmts. new ();
526
- my $ capblock := PAST::Block. new ( : hll<nqp >, : namespace([' Sub' ]), : lexical(0 ),
527
- : name($ blockid ~ ' _caps' ), $ hashpast );
528
- $ initpast . push (PAST::Stmt. new ($ capblock ));
529
-
530
- my $ nfapast := QRegex::NFA. new . addnode($ qast ). past;
531
- if $ nfapast {
532
- my $ nfablock := PAST::Block. new (
533
- : hll<nqp >, : namespace([' Sub' ]), : lexical(0 ),
534
- : name($ blockid ~ ' _nfa' ), $ nfapast );
535
- $ initpast . push (PAST::Stmt. new ($ nfablock ));
536
- }
537
- alt_nfas($ qast , $ blockid , $ initpast );
538
-
539
- unless $ block . symbol(' $¢' ) {
540
- $ initpast . push (PAST::Var. new (: name<$¢ >, : scope<lexical >, : isdecl(1 )));
541
- $ block . symbol(' $¢' , : scope<lexical >);
542
- }
543
-
544
- $ block <orig_qast > := $ qast ;
545
-
546
- $ qast := QAST ::Regex. new ( : rxtype<concat >,
547
- QAST ::Regex. new ( : rxtype<scan > ),
548
- $ qast ,
549
- ($ anon ??
550
- QAST ::Regex. new ( : rxtype<pass > ) !!
551
- QAST ::Regex. new ( : rxtype<pass >, : name(% * RX <name >) )));
552
- $ block . push ($ initpast );
553
- $ block . push (PAST::QAST. new ($ qast ));
554
- $ block ;
555
- }
556
-
557
515
our sub qbuildsub ($ qast , $ block = QAST ::Block. new (), : $ anon , : $ addself ) {
558
516
my $ blockid := $ block . cuid;
559
517
my $ hashpast := QAST ::Op. new ( : op<hash > );
@@ -646,28 +604,6 @@ class QRegex::P6Regex::Actions is HLL::Actions {
646
604
% capnames ;
647
605
}
648
606
649
- sub alt_nfas ($ ast , $ subid , $ initpast ) {
650
- my $ rxtype := $ ast . rxtype;
651
- if $ rxtype eq ' alt' {
652
- my $ nfapast := PAST::Op. new ( : pasttype(' list' ) );
653
- $ ast . name (PAST::Node. unique (' alt_nfa_' ) ~ ' _' ~ ~ nqp ::time_n());
654
- for $ ast . list {
655
- alt_nfas($ _ , $ subid , $ initpast );
656
- $ nfapast . push (QRegex::NFA. new . addnode($ _ ). past(: non_empty));
657
- }
658
- my $ nfablock := PAST::Block. new (
659
- : hll<nqp >, : namespace([' Sub' ]), : lexical(0 ),
660
- : name($ subid ~ ' _' ~ $ ast . name ), $ nfapast );
661
- $ initpast . push (PAST::Stmt. new ($ nfablock ));
662
- }
663
- elsif $ rxtype eq ' subcapture' || $ rxtype eq ' quant' {
664
- alt_nfas($ ast [0 ], $ subid , $ initpast )
665
- }
666
- elsif $ rxtype eq ' concat' || $ rxtype eq ' altseq' || $ rxtype eq ' conj' || $ rxtype eq ' conjseq' {
667
- for $ ast . list { alt_nfas($ _ , $ subid , $ initpast ) }
668
- }
669
- }
670
-
671
607
sub qalt_nfas ($ ast , $ subid , $ initpast ) {
672
608
my $ rxtype := $ ast . rxtype;
673
609
if $ rxtype eq ' alt' {
0 commit comments