Home | History | Annotate | Download | only in yarr

Lines Matching defs:BACKTRACK

72     static inline void appendParenthesesDisjunctionContext(BackTrackInfoParentheses* backTrack, ParenthesesDisjunctionContext* context)
74 context->next = backTrack->lastContext;
75 backTrack->lastContext = context;
76 ++backTrack->matchAmount;
79 static inline void popParenthesesDisjunctionContext(BackTrackInfoParentheses* backTrack)
81 ASSERT(backTrack->matchAmount);
82 ASSERT(backTrack->lastContext);
83 backTrack->lastContext = backTrack->lastContext->next;
84 --backTrack->matchAmount;
378 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + term.frameLocation);
385 if (backTrack->matchAmount) {
386 --backTrack->matchAmount;
393 if ((backTrack->matchAmount < term.atom.quantityCount) && input.checkInput(1)) {
394 ++backTrack->matchAmount;
398 input.uncheckInput(backTrack->matchAmount);
407 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + term.frameLocation);
414 if (backTrack->matchAmount) {
415 --backTrack->matchAmount;
422 if ((backTrack->matchAmount < term.atom.quantityCount) && input.checkInput(1)) {
423 ++backTrack->matchAmount;
427 input.uncheckInput(backTrack->matchAmount);
437 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + term.frameLocation);
457 backTrack->matchAmount = matchAmount;
463 backTrack->matchAmount = 0;
474 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + term.frameLocation);
481 if (backTrack->matchAmount) {
482 --backTrack->matchAmount;
489 if ((backTrack->matchAmount < term.atom.quantityCount) && input.checkInput(1)) {
490 ++backTrack->matchAmount;
494 input.uncheckInput(backTrack->matchAmount);
504 BackTrackInfoBackReference* backTrack = reinterpret_cast<BackTrackInfoBackReference*>(context->frame + term.frameLocation);
522 backTrack->begin = input.getPos();
525 input.setPos(backTrack->begin);
536 backTrack->matchAmount = matchAmount;
541 backTrack->begin = input.getPos();
542 backTrack->matchAmount = 0;
553 BackTrackInfoBackReference* backTrack = reinterpret_cast<BackTrackInfoBackReference*>(context->frame + term.frameLocation);
565 input.setPos(backTrack->begin);
569 if (backTrack->matchAmount) {
570 --backTrack->matchAmount;
577 if ((backTrack->matchAmount < term.atom.quantityCount) && tryConsumeBackReference(matchBegin, matchEnd, term.inputPosition)) {
578 ++backTrack->matchAmount;
581 input.setPos(backTrack->begin);
602 JSRegExpResult parenthesesDoBacktrack(ByteTerm& term, BackTrackInfoParentheses* backTrack)
604 while (backTrack->matchAmount) {
605 ParenthesesDisjunctionContext* context = backTrack->lastContext;
612 popParenthesesDisjunctionContext(backTrack);
627 BackTrackInfoParenthesesOnce* backTrack = reinterpret_cast<BackTrackInfoParenthesesOnce*>(context->frame + term.frameLocation);
632 backTrack->begin = input.getPos();
636 backTrack->begin = notFound;
665 BackTrackInfoParenthesesOnce* backTrack = reinterpret_cast<BackTrackInfoParenthesesOnce*>(context->frame + term.frameLocation);
666 return backTrack->begin != input.getPos();
674 BackTrackInfoParenthesesOnce* backTrack = reinterpret_cast<BackTrackInfoParenthesesOnce*>(context->frame + term.frameLocation);
684 // if we backtrack to this point, there is another chance - try matching nothing.
685 ASSERT(backTrack->begin != notFound);
686 backTrack->begin = notFound;
690 ASSERT(backTrack->begin != notFound);
703 BackTrackInfoParenthesesOnce* backTrack = reinterpret_cast<BackTrackInfoParenthesesOnce*>(context->frame + term.frameLocation);
707 if (backTrack->begin == notFound) {
712 if (backTrack->begin == notFound) {
713 backTrack->begin = input.getPos();
740 BackTrackInfoParenthesesTerminal* backTrack = reinterpret_cast<BackTrackInfoParenthesesTerminal*>(context->frame + term.frameLocation);
741 backTrack->begin = input.getPos();
749 BackTrackInfoParenthesesTerminal* backTrack = reinterpret_cast<BackTrackInfoParenthesesTerminal*>(context->frame + term.frameLocation);
751 if (backTrack->begin == input.getPos())
766 // If we backtrack to this point, we have failed to match this iteration of the parens.
775 // should always be returned as a successful match - we should never backtrack to here.
785 BackTrackInfoParentheticalAssertion* backTrack = reinterpret_cast<BackTrackInfoParentheticalAssertion*>(context->frame + term.frameLocation);
787 backTrack->begin = input.getPos();
796 BackTrackInfoParentheticalAssertion* backTrack = reinterpret_cast<BackTrackInfoParentheticalAssertion*>(context->frame + term.frameLocation);
798 input.setPos(backTrack->begin);
828 BackTrackInfoParentheticalAssertion* backTrack = reinterpret_cast<BackTrackInfoParentheticalAssertion*>(context->frame + term.frameLocation);
830 input.setPos(backTrack->begin);
840 BackTrackInfoParentheses* backTrack = reinterpret_cast<BackTrackInfoParentheses*>(context->frame + term.frameLocation);
843 backTrack->matchAmount = 0;
844 backTrack->lastContext = 0;
849 while (backTrack->matchAmount < term.atom.quantityCount) {
854 appendParenthesesDisjunctionContext(backTrack, context);
861 JSRegExpResult backtrackResult = parenthesesDoBacktrack(term, backTrack);
869 ASSERT(backTrack->matchAmount == term.atom.quantityCount);
870 ParenthesesDisjunctionContext* context = backTrack->lastContext;
876 while (backTrack->matchAmount < term.atom.quantityCount) {
880 appendParenthesesDisjunctionContext(backTrack, context);
892 if (backTrack->matchAmount) {
893 ParenthesesDisjunctionContext* context = backTrack->lastContext;
910 // the 'more' cases. Always backtrack, at least a leetle bit. However cases where
911 // you backtrack an item off the list needs checking, since we'll never have matched
921 BackTrackInfoParentheses* backTrack = reinterpret_cast<BackTrackInfoParentheses*>(context->frame + term.frameLocation);
926 ASSERT(backTrack->matchAmount == term.atom.quantityCount);
929 JSRegExpResult result = parenthesesDoBacktrack(term, backTrack);
935 while (backTrack->matchAmount < term.atom.quantityCount) {
941 appendParenthesesDisjunctionContext(backTrack, context);
948 JSRegExpResult backtrackResult = parenthesesDoBacktrack(term, backTrack);
956 ASSERT(backTrack->matchAmount == term.atom.quantityCount);
957 context = backTrack->lastContext;
963 if (!backTrack->matchAmount)
966 ParenthesesDisjunctionContext* context = backTrack->lastContext;
969 while (backTrack->matchAmount < term.atom.quantityCount) {
973 appendParenthesesDisjunctionContext(backTrack, context);
986 popParenthesesDisjunctionContext(backTrack);
993 if (backTrack->matchAmount) {
994 ParenthesesDisjunctionContext* context = backTrack->lastContext;
1002 if (backTrack->matchAmount < term.atom.quantityCount) {
1006 appendParenthesesDisjunctionContext(backTrack, context);
1018 // Nope - okay backtrack looking for an alternative.
1019 while (backTrack->matchAmount) {
1020 ParenthesesDisjunctionContext* context = backTrack->lastContext;
1023 // successful backtrack! we're back in the game!
1024 if (backTrack->matchAmount) {
1025 context = backTrack->lastContext;
1033 popParenthesesDisjunctionContext(backTrack);
1077 #define BACKTRACK() { --context->term; goto backtrack; }
1085 BACKTRACK();
1115 BackTrackInfoAlternative* backTrack = reinterpret_cast<BackTrackInfoAlternative*>(context->frame + currentTerm().frameLocation);
1116 backTrack->offset = offset;
1124 BACKTRACK();
1128 BACKTRACK();
1132 BACKTRACK();
1138 BACKTRACK();
1143 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + currentTerm().frameLocation);
1152 backTrack->matchAmount = matchAmount;
1157 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + currentTerm().frameLocation);
1158 backTrack->matchAmount = 0;
1166 BACKTRACK();
1171 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + currentTerm().frameLocation);
1180 backTrack->matchAmount = matchAmount;
1185 BackTrackInfoPatternCharacter* backTrack = reinterpret_cast<BackTrackInfoPatternCharacter*>(context->frame + currentTerm().frameLocation);
1186 backTrack->matchAmount = 0;
1193 BACKTRACK();
1197 BACKTRACK();
1206 BACKTRACK();
1211 BACKTRACK();
1215 BACKTRACK();
1219 BACKTRACK();
1223 BACKTRACK();
1227 BACKTRACK();
1231 BACKTRACK();
1236 BACKTRACK();
1246 backtrack:
1286 BACKTRACK();
1289 // We should never backtrack back into an alternative of the main body of the regex.
1290 BackTrackInfoAlternative* backTrack = reinterpret_cast<BackTrackInfoAlternative*>(context->frame + currentTerm().frameLocation);
1291 unsigned offset = backTrack->offset;
1293 BACKTRACK();
1299 BACKTRACK();
1307 BACKTRACK();
1314 BACKTRACK();
1318 BACKTRACK();
1322 BACKTRACK();
1331 BACKTRACK();
1336 BACKTRACK();
1340 BACKTRACK();
1344 BACKTRACK();
1348 BACKTRACK();
1352 BACKTRACK();
1356 BACKTRACK();
1360 BACKTRACK();
1364 BACKTRACK();