Skip to content
This repository
Browse code

First batch of !cursor_start updates.

  • Loading branch information...
commit c7f057b1eddab6d7dbb658ec126107f260dbe490 1 parent c56d322
Jonathan Worthington authored February 11, 2013

Showing 1 changed file with 23 additions and 23 deletions. Show diff stats Hide diff stats

  1. 46  src/QRegex/Cursor.nqp
46  src/QRegex/Cursor.nqp
@@ -221,7 +221,7 @@ role NQPCursorRole is export {
221 221
             $!restart(self);
222 222
         }
223 223
         else {
224  
-            my $cur := self."!cursor_start"();
  224
+            my $cur := self."!cursor_start_cur"();
225 225
             $cur."!cursor_fail"();
226 226
             $cur
227 227
         }
@@ -274,7 +274,7 @@ role NQPCursorRole is export {
274 274
             $cur := self."$rxname"();
275 275
             @fates := @EMPTY if nqp::getattr_i($cur, $?CLASS, '$!pos') >= 0;
276 276
         }
277  
-        $cur // self."!cursor_start"();
  277
+        $cur // self."!cursor_start_cur"();
278 278
     }
279 279
 
280 280
     method !protoregex_nfa($name) {
@@ -397,7 +397,7 @@ role NQPCursorRole is export {
397 397
     }
398 398
 
399 399
     method !BACKREF($name) {
400  
-        my $cur   := self."!cursor_start"();
  400
+        my $cur   := self."!cursor_start_cur"();
401 401
         my int $n := $!cstack ?? nqp::elems($!cstack) - 1 !! -1;
402 402
         $n-- while $n >= 0 && (nqp::isnull(nqp::getattr($!cstack[$n], $?CLASS, '$!name')) ||
403 403
                                nqp::getattr($!cstack[$n], $?CLASS, '$!name') ne $name);
@@ -413,7 +413,7 @@ role NQPCursorRole is export {
413 413
     }
414 414
 
415 415
     method !LITERAL(str $str, int $i = 0) {
416  
-        my $cur := self."!cursor_start"();
  416
+        my $cur := self."!cursor_start_cur"();
417 417
         my int $litlen := nqp::chars($str);
418 418
         my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
419 419
         $cur."!cursor_pass"($!pos + $litlen)
@@ -424,7 +424,7 @@ role NQPCursorRole is export {
424 424
     }
425 425
 
426 426
     method at($pos) {
427  
-        my $cur := self."!cursor_start"();
  427
+        my $cur := self."!cursor_start_cur"();
428 428
         $cur."!cursor_pass"($!pos) if +$pos == $!pos;
429 429
         $cur;
430 430
     }
@@ -433,7 +433,7 @@ role NQPCursorRole is export {
433 433
         my int $orig_highwater := nqp::getattr_i($!shared, ParseShared, '$!highwater');
434 434
         my $orig_highexpect := nqp::getattr($!shared, ParseShared, '@!highexpect');
435 435
         nqp::bindattr($!shared, ParseShared, '@!highexpect', []);
436  
-        my $cur := self."!cursor_start"();
  436
+        my $cur := self."!cursor_start_cur"();
437 437
         nqp::bindattr_i($cur, $?CLASS, '$!pos', $!pos);
438 438
         nqp::getattr_i($regex($cur), $?CLASS, '$!pos') >= 0 ??
439 439
             $cur."!cursor_pass"($!pos, 'before') !!
@@ -449,7 +449,7 @@ role NQPCursorRole is export {
449 449
         my int $orig_highwater := nqp::getattr_i($!shared, ParseShared, '$!highwater');
450 450
         my $orig_highexpect := nqp::getattr($!shared, ParseShared, '@!highexpect');
451 451
         nqp::bindattr($!shared, ParseShared, '@!highexpect', []);
452  
-        my $cur := self."!cursor_start"();
  452
+        my $cur := self."!cursor_start_cur"();
453 453
         my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
454 454
         my $shared := nqp::clone($!shared);
455 455
         nqp::bindattr_s($shared, ParseShared, '$!target', $target.reverse());
@@ -467,7 +467,7 @@ role NQPCursorRole is export {
467 467
     method ws() {
468 468
         # skip over any whitespace, fail if between two word chars
469 469
         my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
470  
-        my $cur := self."!cursor_start"();
  470
+        my $cur := self."!cursor_start_cur"();
471 471
         $!pos >= nqp::chars($target)
472 472
           ?? $cur."!cursor_pass"($!pos, 'ws')
473 473
           !! ($!pos < 1
@@ -481,7 +481,7 @@ role NQPCursorRole is export {
481 481
     }
482 482
     
483 483
     method ww() {
484  
-        my $cur := self."!cursor_start"();
  484
+        my $cur := self."!cursor_start_cur"();
485 485
         my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
486 486
         $cur."!cursor_pass"($!pos, "ww")
487 487
             if $!pos > 0
@@ -492,7 +492,7 @@ role NQPCursorRole is export {
492 492
     }
493 493
 
494 494
     method wb() {
495  
-        my $cur := self."!cursor_start"();
  495
+        my $cur := self."!cursor_start_cur"();
496 496
         my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
497 497
         $cur."!cursor_pass"($!pos, "wb")
498 498
             if ($!pos == 0 && nqp::iscclass(nqp::const::CCLASS_WORD, $target, $!pos))
@@ -504,7 +504,7 @@ role NQPCursorRole is export {
504 504
     }
505 505
 
506 506
     method ident() {
507  
-        my $cur := self."!cursor_start"();
  507
+        my $cur := self."!cursor_start_cur"();
508 508
         my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
509 509
         $cur."!cursor_pass"(
510 510
                 nqp::findnotcclass(
@@ -517,7 +517,7 @@ role NQPCursorRole is export {
517 517
     }
518 518
 
519 519
     method alpha() {
520  
-        my $cur := self."!cursor_start"();
  520
+        my $cur := self."!cursor_start_cur"();
521 521
         my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
522 522
         $cur."!cursor_pass"($!pos+1, 'alpha')
523 523
           if $!pos < nqp::chars($target)
@@ -527,7 +527,7 @@ role NQPCursorRole is export {
527 527
     }
528 528
 
529 529
     method alnum() {
530  
-        my $cur := self."!cursor_start"();
  530
+        my $cur := self."!cursor_start_cur"();
531 531
         my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
532 532
         $cur."!cursor_pass"($!pos+1, 'alnum')
533 533
           if $!pos < nqp::chars($target)
@@ -537,7 +537,7 @@ role NQPCursorRole is export {
537 537
     }
538 538
 
539 539
     method upper() {
540  
-        my $cur := self."!cursor_start"();
  540
+        my $cur := self."!cursor_start_cur"();
541 541
         my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
542 542
         $cur."!cursor_pass"($!pos+1, 'upper')
543 543
           if $!pos < nqp::chars($target)
@@ -546,7 +546,7 @@ role NQPCursorRole is export {
546 546
     }
547 547
 
548 548
     method lower() {
549  
-        my $cur := self."!cursor_start"();
  549
+        my $cur := self."!cursor_start_cur"();
550 550
         my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
551 551
         $cur."!cursor_pass"($!pos+1, 'lower')
552 552
           if $!pos < nqp::chars($target)
@@ -555,7 +555,7 @@ role NQPCursorRole is export {
555 555
     }
556 556
 
557 557
     method digit() {
558  
-        my $cur := self."!cursor_start"();
  558
+        my $cur := self."!cursor_start_cur"();
559 559
         my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
560 560
         $cur."!cursor_pass"($!pos+1, 'digit')
561 561
           if $!pos < nqp::chars($target)
@@ -564,7 +564,7 @@ role NQPCursorRole is export {
564 564
     }
565 565
 
566 566
     method xdigit() {
567  
-        my $cur := self."!cursor_start"();
  567
+        my $cur := self."!cursor_start_cur"();
568 568
         my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
569 569
         $cur."!cursor_pass"($!pos+1, 'xdigit')
570 570
           if $!pos < nqp::chars($target)
@@ -573,7 +573,7 @@ role NQPCursorRole is export {
573 573
     }
574 574
 
575 575
     method space() {
576  
-        my $cur := self."!cursor_start"();
  576
+        my $cur := self."!cursor_start_cur"();
577 577
         my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
578 578
         $cur."!cursor_pass"($!pos+1, 'space')
579 579
           if $!pos < nqp::chars($target)
@@ -582,7 +582,7 @@ role NQPCursorRole is export {
582 582
     }
583 583
 
584 584
     method blank() {
585  
-        my $cur := self."!cursor_start"();
  585
+        my $cur := self."!cursor_start_cur"();
586 586
         my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
587 587
         $cur."!cursor_pass"($!pos+1, 'blank')
588 588
           if $!pos < nqp::chars($target)
@@ -591,7 +591,7 @@ role NQPCursorRole is export {
591 591
     }
592 592
 
593 593
     method cntrl() {
594  
-        my $cur := self."!cursor_start"();
  594
+        my $cur := self."!cursor_start_cur"();
595 595
         my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
596 596
         $cur."!cursor_pass"($!pos+1, 'cntrl')
597 597
           if $!pos < nqp::chars($target)
@@ -600,7 +600,7 @@ role NQPCursorRole is export {
600 600
     }
601 601
 
602 602
     method punct() {
603  
-        my $cur := self."!cursor_start"();
  603
+        my $cur := self."!cursor_start_cur"();
604 604
         my str $target := nqp::getattr_s($!shared, ParseShared, '$!target');
605 605
         $cur."!cursor_pass"($!pos+1, 'punct')
606 606
           if $!pos < nqp::chars($target)
@@ -709,7 +709,7 @@ class NQPCursor does NQPCursorRole {
709 709
     method !INTERPOLATE($var) {
710 710
         if nqp::islist($var) {
711 711
             my int $maxlen := -1;
712  
-            my $cur := self.'!cursor_start'();
  712
+            my $cur := self.'!cursor_start_cur'();
713 713
             my int $pos := nqp::getattr_i($cur, $?CLASS, '$!from');
714 714
             my str $tgt := $cur.target;
715 715
             my int $eos := nqp::chars($tgt);
@@ -733,7 +733,7 @@ class NQPCursor does NQPCursorRole {
733 733
         }
734 734
         else {
735 735
             return $var(self) if nqp::isinvokable($var);
736  
-            my $cur := self.'!cursor_start'();
  736
+            my $cur := self.'!cursor_start_cur'();
737 737
             my int $pos := nqp::getattr_i($cur, $?CLASS, '$!from');
738 738
             my str $tgt := $cur.target;
739 739
             my int $len := nqp::chars($var);

0 notes on commit c7f057b

Please sign in to comment.
Something went wrong with that request. Please try again.