@@ -34,7 +34,7 @@ class QRegex::NFA {
34
34
$ to := self . addstate() if $ to < 0 ;
35
35
my $ st := $ ! states [$ from ];
36
36
nqp :: push ($ st , $ action );
37
- nqp :: push ($ st , $ value );
37
+ nqp :: push ($ st , nqp ::istype( $ value , QAST ::SVal) ?? $ value . value !! $ value );
38
38
nqp :: push ($ st , $ to );
39
39
$ to ;
40
40
}
@@ -278,9 +278,6 @@ class QRegex::NFA {
278
278
}
279
279
$ list . push ($ arglist );
280
280
}
281
- elsif $ _ ~~ QAST ::SVal {
282
- $ list . push ($ _ );
283
- }
284
281
elsif + $ _ eq $ _ {
285
282
$ list . push (QAST ::IVal. new ( : value($ _ ) ));
286
283
}
@@ -300,7 +297,12 @@ class QRegex::NFA {
300
297
if nqp :: can ($ cursor , $ name ) {
301
298
if ! nqp ::existskey(% seen , $ name ) {
302
299
my $ meth := $ cursor . HOW . find_method($ cursor , $ name , : no_trace(1 ));
303
- @ substates := $ meth . nqpattr(' nfa' ) if nqp :: can ($ meth , ' nqpattr' );
300
+ if nqp :: can ($ meth , ' NFA' ) {
301
+ @ substates := $ meth . NFA();
302
+ }
303
+ elsif nqp :: can ($ meth , ' nqpattr' ) {
304
+ @ substates := $ meth . nqpattr(' nfa' );
305
+ }
304
306
@ substates := [] if nqp ::isnull(@ substates );
305
307
}
306
308
if ! @ substates && ! nqp ::existskey(% seen , $ name ) {
0 commit comments