/[pcre]/code/trunk/pcre_dfa_exec.c
ViewVC logotype

Diff of /code/trunk/pcre_dfa_exec.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 530 by ph10, Tue Jun 1 13:42:06 2010 UTC revision 535 by ph10, Thu Jun 3 19:18:24 2010 UTC
# Line 922  for (;;) Line 922  for (;;)
922            if (utf8) BACKCHAR(temp);            if (utf8) BACKCHAR(temp);
923  #endif  #endif
924            GETCHARTEST(d, temp);            GETCHARTEST(d, temp);
925  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
926            if ((md->poptions & PCRE_UCP) != 0)            if ((md->poptions & PCRE_UCP) != 0)
927              {              {
928              if (d == '_') left_word = TRUE; else              if (d == '_') left_word = TRUE; else
929                {                {
930                int cat = UCD_CATEGORY(d);                int cat = UCD_CATEGORY(d);
931                left_word = (cat == ucp_L || cat == ucp_N);                left_word = (cat == ucp_L || cat == ucp_N);
932                }                }
933              }              }
934            else            else
935  #endif  #endif
936            left_word = d < 256 && (ctypes[d] & ctype_word) != 0;            left_word = d < 256 && (ctypes[d] & ctype_word) != 0;
937            }            }
938          else left_word = FALSE;          else left_word = FALSE;
939    
940          if (clen > 0)          if (clen > 0)
941            {            {
942  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
943            if ((md->poptions & PCRE_UCP) != 0)            if ((md->poptions & PCRE_UCP) != 0)
944              {              {
945              if (c == '_') right_word = TRUE; else              if (c == '_') right_word = TRUE; else
946                {                {
947                int cat = UCD_CATEGORY(c);                int cat = UCD_CATEGORY(c);
948                right_word = (cat == ucp_L || cat == ucp_N);                right_word = (cat == ucp_L || cat == ucp_N);
949                }                }
950              }              }
951            else            else
952  #endif  #endif
953            right_word = c < 256 && (ctypes[c] & ctype_word) != 0;            right_word = c < 256 && (ctypes[c] & ctype_word) != 0;
954            }            }
955          else right_word = FALSE;          else right_word = FALSE;
956    
957          if ((left_word == right_word) == (codevalue == OP_NOT_WORD_BOUNDARY))          if ((left_word == right_word) == (codevalue == OP_NOT_WORD_BOUNDARY))
# Line 979  for (;;) Line 979  for (;;)
979            break;            break;
980    
981            case PT_LAMP:            case PT_LAMP:
982            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
983                 prop->chartype == ucp_Lt;                 prop->chartype == ucp_Lt;
984            break;            break;
985    
# Line 994  for (;;) Line 994  for (;;)
994            case PT_SC:            case PT_SC:
995            OK = prop->script == code[2];            OK = prop->script == code[2];
996            break;            break;
997    
998            /* These are specials for combination cases. */            /* These are specials for combination cases. */
999    
1000            case PT_ALNUM:            case PT_ALNUM:
1001            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1002                 _pcre_ucp_gentype[prop->chartype] == ucp_N;                 _pcre_ucp_gentype[prop->chartype] == ucp_N;
1003            break;            break;
1004    
1005            case PT_SPACE:    /* Perl space */            case PT_SPACE:    /* Perl space */
1006            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1007                 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;                 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
1008            break;            break;
1009    
1010            case PT_PXSPACE:  /* POSIX space */            case PT_PXSPACE:  /* POSIX space */
1011            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1012                 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||                 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
1013                 c == CHAR_FF || c == CHAR_CR;                 c == CHAR_FF || c == CHAR_CR;
1014            break;            break;
1015    
1016            case PT_WORD:            case PT_WORD:
1017            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1018                 _pcre_ucp_gentype[prop->chartype] == ucp_N ||                 _pcre_ucp_gentype[prop->chartype] == ucp_N ||
1019                 c == CHAR_UNDERSCORE;                 c == CHAR_UNDERSCORE;
1020            break;            break;
1021    
1022            /* Should never occur, but keep compilers from grumbling. */            /* Should never occur, but keep compilers from grumbling. */
1023    
# Line 1173  for (;;) Line 1173  for (;;)
1173            break;            break;
1174    
1175            case PT_LAMP:            case PT_LAMP:
1176            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
1177              prop->chartype == ucp_Lt;              prop->chartype == ucp_Lt;
1178            break;            break;
1179    
# Line 1190  for (;;) Line 1190  for (;;)
1190            break;            break;
1191    
1192            /* These are specials for combination cases. */            /* These are specials for combination cases. */
1193    
1194            case PT_ALNUM:            case PT_ALNUM:
1195            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1196                 _pcre_ucp_gentype[prop->chartype] == ucp_N;                 _pcre_ucp_gentype[prop->chartype] == ucp_N;
1197            break;            break;
1198    
1199            case PT_SPACE:    /* Perl space */            case PT_SPACE:    /* Perl space */
1200            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1201                 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;                 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
1202            break;            break;
1203    
1204            case PT_PXSPACE:  /* POSIX space */            case PT_PXSPACE:  /* POSIX space */
1205            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1206                 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||                 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
1207                 c == CHAR_FF || c == CHAR_CR;                 c == CHAR_FF || c == CHAR_CR;
1208            break;            break;
1209    
1210            case PT_WORD:            case PT_WORD:
1211            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1212                 _pcre_ucp_gentype[prop->chartype] == ucp_N ||                 _pcre_ucp_gentype[prop->chartype] == ucp_N ||
1213                 c == CHAR_UNDERSCORE;                 c == CHAR_UNDERSCORE;
1214            break;            break;
1215    
1216            /* Should never occur, but keep compilers from grumbling. */            /* Should never occur, but keep compilers from grumbling. */
1217    
# Line 1420  for (;;) Line 1420  for (;;)
1420            break;            break;
1421    
1422            case PT_LAMP:            case PT_LAMP:
1423            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
1424              prop->chartype == ucp_Lt;              prop->chartype == ucp_Lt;
1425            break;            break;
1426    
# Line 1435  for (;;) Line 1435  for (;;)
1435            case PT_SC:            case PT_SC:
1436            OK = prop->script == code[3];            OK = prop->script == code[3];
1437            break;            break;
1438    
1439            /* These are specials for combination cases. */            /* These are specials for combination cases. */
1440    
1441            case PT_ALNUM:            case PT_ALNUM:
1442            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1443                 _pcre_ucp_gentype[prop->chartype] == ucp_N;                 _pcre_ucp_gentype[prop->chartype] == ucp_N;
1444            break;            break;
1445    
1446            case PT_SPACE:    /* Perl space */            case PT_SPACE:    /* Perl space */
1447            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1448                 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;                 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
1449            break;            break;
1450    
1451            case PT_PXSPACE:  /* POSIX space */            case PT_PXSPACE:  /* POSIX space */
1452            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1453                 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||                 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
1454                 c == CHAR_FF || c == CHAR_CR;                 c == CHAR_FF || c == CHAR_CR;
1455            break;            break;
1456    
1457            case PT_WORD:            case PT_WORD:
1458            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1459                 _pcre_ucp_gentype[prop->chartype] == ucp_N ||                 _pcre_ucp_gentype[prop->chartype] == ucp_N ||
1460                 c == CHAR_UNDERSCORE;                 c == CHAR_UNDERSCORE;
1461            break;            break;
1462    
1463            /* Should never occur, but keep compilers from grumbling. */            /* Should never occur, but keep compilers from grumbling. */
1464    
# Line 1692  for (;;) Line 1692  for (;;)
1692            break;            break;
1693    
1694            case PT_LAMP:            case PT_LAMP:
1695            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||            OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
1696              prop->chartype == ucp_Lt;              prop->chartype == ucp_Lt;
1697            break;            break;
1698    
# Line 1707  for (;;) Line 1707  for (;;)
1707            case PT_SC:            case PT_SC:
1708            OK = prop->script == code[5];            OK = prop->script == code[5];
1709            break;            break;
1710    
1711            /* These are specials for combination cases. */            /* These are specials for combination cases. */
1712    
1713            case PT_ALNUM:            case PT_ALNUM:
1714            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1715                 _pcre_ucp_gentype[prop->chartype] == ucp_N;                 _pcre_ucp_gentype[prop->chartype] == ucp_N;
1716            break;            break;
1717    
1718            case PT_SPACE:    /* Perl space */            case PT_SPACE:    /* Perl space */
1719            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1720                 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;                 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
1721            break;            break;
1722    
1723            case PT_PXSPACE:  /* POSIX space */            case PT_PXSPACE:  /* POSIX space */
1724            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
1725                 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||                 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
1726                 c == CHAR_FF || c == CHAR_CR;                 c == CHAR_FF || c == CHAR_CR;
1727            break;            break;
1728    
1729            case PT_WORD:            case PT_WORD:
1730            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||            OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
1731                 _pcre_ucp_gentype[prop->chartype] == ucp_N ||                 _pcre_ucp_gentype[prop->chartype] == ucp_N ||
1732                 c == CHAR_UNDERSCORE;                 c == CHAR_UNDERSCORE;
1733            break;            break;
1734    
1735            /* Should never occur, but keep compilers from grumbling. */            /* Should never occur, but keep compilers from grumbling. */
1736    
# Line 2623  for (;;) Line 2623  for (;;)
2623    
2624            do { end_subpattern += GET(end_subpattern, 1); }            do { end_subpattern += GET(end_subpattern, 1); }
2625              while (*end_subpattern == OP_ALT);              while (*end_subpattern == OP_ALT);
2626            next_state_offset =            next_state_offset =
2627              (int)(end_subpattern - start_code + LINK_SIZE + 1);              (int)(end_subpattern - start_code + LINK_SIZE + 1);
2628    
2629            /* If the end of this subpattern is KETRMAX or KETRMIN, we must            /* If the end of this subpattern is KETRMAX or KETRMIN, we must

Legend:
Removed from v.530  
changed lines
  Added in v.535

  ViewVC Help
Powered by ViewVC 1.1.5