- Timestamp:
- 08/16/08 06:31:54 (3 months ago)
- Files:
-
- 1 modified
-
src/perl6/Cursor.pmc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/perl6/Cursor.pmc
r21901 r21904 520 520 for my $pat (@pats) { 521 521 $pat =~ s/\.\?$//; # ltm backoff doesn't need tre workaround 522 $pat =~ s/\\>/\\b/g; # perl regex doesn't use \> 522 523 } 523 524 … … 530 531 return unless $lexer; 531 532 532 pos($$buf) = $C->{_pos}; 533 my $P = $C->{_pos}; 534 pos($$buf) = $P; 533 535 534 536 if ($DEBUG & DEBUG::lexer) { … … 539 541 } 540 542 541 ##########################################542 # No normal p5 match/subst below here!!! #543 ##########################################544 543 { 545 use re::engine::TRE;546 547 544 # if trystate is defined, the "obvious" LTM failed, so must back off 548 545 # a parallel nfa matcher might or might not do better here... … … 572 569 if ($l == -1) { 573 570 my $p = '^' . $pats[$px]; 571 pos($$buf) = $P; 574 572 if (($$buf =~ m/$p/xgc)) { 575 $$rxlens[$px] = $l = $+[0] - $-[0];573 $$rxlens[$px] = $l = pos($$buf) - $P; 576 574 if ($l == $$trylen) { 577 575 push @result, $fates->[$px]; … … 592 590 else { 593 591 my $p = '^' . $pats[$px]; 592 pos($$buf) = $P; 594 593 if ($$buf =~ m/$p/xgc) { 595 594 push @result, $fates->[$px]; … … 604 603 return @result; 605 604 } 605 606 ########################################## 607 # No normal p5 match/subst below here!!! # 608 ########################################## 609 use re::engine::TRE; 610 606 611 607 612 $self->deb("/ running tre match at @{[ pos($$buf) ]} /") if $DEBUG & DEBUG::lexer; … … 1441 1446 pos($$buf) = $P; 1442 1447 if ($$buf =~ /$qr/gc) { 1443 my $len = $+[0]- $P;1448 my $len = pos($$buf) - $P; 1444 1449 $self->deb("PATTERN $qr matched @{[substr($$buf,$P,$len)]} at $P $len") if $DEBUG & DEBUG::matchers; 1445 1450 my $r = $self->cursor($P+$len);
