Changeset 31454 in webkit for trunk/JavaScriptCore/pcre
- Timestamp:
- Mar 31, 2008, 1:01:09 AM (17 years ago)
- Location:
- trunk/JavaScriptCore/pcre
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/pcre/pcre_compile.cpp
r31388 r31454 637 637 /* Handle single-character metacharacters. In multiline mode, ^ disables 638 638 the setting of any following char as a first character. */ 639 639 640 640 case '^': 641 641 if (options & MatchAcrossMultipleLinesOption) { 642 642 if (firstbyte == REQ_UNSET) 643 643 firstbyte = REQ_NONE; 644 } 644 *code++ = OP_BOL; 645 } else 646 *code++ = OP_CIRC; 645 647 previous = NULL; 646 *code++ = OP_CIRC;647 648 break; 648 649 649 650 case '$': 650 651 previous = NULL; 651 *code++ = OP_DOLL; 652 if (options & MatchAcrossMultipleLinesOption) 653 *code++ = OP_EOL; 654 else 655 *code++ = OP_DOLL; 652 656 break; 653 657 654 658 /* There can never be a first char if '.' is first, whatever happens about 655 659 repeats. The value of reqbyte doesn't change either. */ 656 660 657 661 case '.': 658 662 if (firstbyte == REQ_UNSET) … … 1905 1909 1906 1910 /* Explicit ^ */ 1907 return op == OP_CIRC ;1911 return op == OP_CIRC || op == OP_BOL; 1908 1912 } 1909 1913 -
trunk/JavaScriptCore/pcre/pcre_exec.cpp
r31048 r31454 653 653 RRETURN; 654 654 655 /* Start of subject , or after internal newline if multiline. */656 655 /* Start of subject. */ 656 657 657 BEGIN_OPCODE(CIRC): 658 if (stack.currentFrame->args.subjectPtr != md.startSubject && (!md.multiline || !isNewline(stack.currentFrame->args.subjectPtr[-1])))658 if (stack.currentFrame->args.subjectPtr != md.startSubject) 659 659 RRETURN_NO_MATCH; 660 660 stack.currentFrame->args.instructionPtr++; 661 661 NEXT_OPCODE; 662 663 /* End of subject, or before internal newline if multiline. */ 664 662 663 /* After internal newline if multiline. */ 664 665 BEGIN_OPCODE(BOL): 666 if (stack.currentFrame->args.subjectPtr != md.startSubject && !isNewline(stack.currentFrame->args.subjectPtr[-1])) 667 RRETURN_NO_MATCH; 668 stack.currentFrame->args.instructionPtr++; 669 NEXT_OPCODE; 670 671 /* End of subject. */ 672 665 673 BEGIN_OPCODE(DOLL): 666 if (stack.currentFrame->args.subjectPtr < md.endSubject && (!md.multiline || !isNewline(*stack.currentFrame->args.subjectPtr))) 674 if (stack.currentFrame->args.subjectPtr < md.endSubject) 675 RRETURN_NO_MATCH; 676 stack.currentFrame->args.instructionPtr++; 677 NEXT_OPCODE; 678 679 /* Before internal newline if multiline. */ 680 681 BEGIN_OPCODE(EOL): 682 if (stack.currentFrame->args.subjectPtr < md.endSubject && !isNewline(*stack.currentFrame->args.subjectPtr)) 667 683 RRETURN_NO_MATCH; 668 684 stack.currentFrame->args.instructionPtr++; … … 2055 2071 DPRINTF((">>>> returning %d\n", returnCode)); 2056 2072 return returnCode; 2057 } while ( startMatch <= endSubject);2073 } while (!(re->options & IsAnchoredOption) && startMatch <= endSubject); 2058 2074 2059 2075 if (using_temporary_offsets) { -
trunk/JavaScriptCore/pcre/pcre_internal.h
r28793 r31454 232 232 macro(CIRC) \ 233 233 macro(DOLL) \ 234 macro(BOL) \ 235 macro(EOL) \ 234 236 macro(CHAR) \ 235 237 macro(CHAR_IGNORING_CASE) \
Note:
See TracChangeset
for help on using the changeset viewer.