@@ -323,6 +323,28 @@ class QAST::Compiler is HLL::Compiler {
323
323
$ ops ;
324
324
}
325
325
326
+ method subcapture ($ node ) {
327
+ my $ ops := self . post_new(' Ops' , : result(% * REG <cur >));
328
+ my $ prefix := self . unique (' rxcap' );
329
+ my $ donelabel := self . post_new(' Label' , : result($ prefix ~ ' _done' ));
330
+ my $ faillabel := self . post_new(' Label' , : result($ prefix ~ ' _fail' ));
331
+ my $ name := $ * PASTCOMPILER . as_post($ node . name , : rtype<* >);
332
+ self . regex_mark($ ops , $ faillabel , % * REG <pos >, 0 );
333
+ $ ops . push (self . regex_post($ node [0 ]));
334
+ self . regex_peek($ ops , $ faillabel , ' $I11' );
335
+ $ ops . push ($ name );
336
+ $ ops . push_pirop(' repr_bind_attr_int' , % * REG <cur >, % * REG <curclass >, ' "$!pos"' , ' $I11' );
337
+ $ ops . push_pirop(' callmethod' , ' "!cursor_start"' , % * REG <cur >, : result<$P11 >);
338
+ $ ops . push_pirop(' callmethod' , ' "!cursor_pass"' , ' $P11' , % * REG <pos >);
339
+ $ ops . push_pirop(' callmethod' , ' "!cursor_capture"' , % * REG <cur >,
340
+ ' $P11' , $ name , : result(% * REG <caps >));
341
+ $ ops . push_pirop(' goto' , $ donelabel );
342
+ $ ops . push ($ faillabel );
343
+ $ ops . push_pirop(' goto' , % * REG <fail >);
344
+ $ ops . push ($ donelabel );
345
+ $ ops ;
346
+ }
347
+
326
348
method subrule ($ node ) {
327
349
my $ ops := self . post_new(' Ops' , : result(% * REG <cur >));
328
350
my $ name := $ * PASTCOMPILER . as_post($ node . name , : rtype<* >);
0 commit comments