diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-07-14 10:49:37 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-07-14 10:49:37 +0000 |
commit | 3ae08724085c050ef6bd2c7af042aa714c2ad9d9 (patch) | |
tree | ed42eb257a307d5ee6924455d8cb7c6aaffe569a | |
parent | 01ec43d06089361423d61a40521883bf73e1944a (diff) | |
parent | 29d1e993db685c67acc489087a44f0e4137e296c (diff) | |
download | perl-3ae08724085c050ef6bd2c7af042aa714c2ad9d9.tar.gz |
integrate cfgperl contents into mainline
p4raw-id: //depot/perl@6400
-rwxr-xr-x | Configure | 2 | ||||
-rwxr-xr-x | embed.pl | 2 | ||||
-rw-r--r-- | global.sym | 5 | ||||
-rw-r--r-- | proto.h | 2 | ||||
-rw-r--r-- | regcomp.c | 3 | ||||
-rw-r--r-- | regexec.c | 54 | ||||
-rw-r--r-- | t/op/re_tests | 5 | ||||
-rw-r--r-- | toke.c | 22 | ||||
-rw-r--r-- | vms/subconfigure.com | 2 |
9 files changed, 47 insertions, 50 deletions
@@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Wed Jul 12 07:59:35 EET DST 2000 [metaconfig 3.0 PL70] +# Generated on Thu Jul 13 16:16:41 EET DST 2000 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <<EOF @@ -2474,7 +2474,7 @@ s |char* |scan_trans |char *start s |char* |scan_word |char *s|char *dest|STRLEN destlen \ |int allow_package|STRLEN *slp s |char* |skipspace |char *s -s |char* |swallow_bom |char *s +s |char* |swallow_bom |U8 *s s |void |checkcomma |char *s|char *name|char *what s |void |force_ident |char *s|int kind s |void |incline |char *s diff --git a/global.sym b/global.sym index 719e50a2f4..6ee8fc4879 100644 --- a/global.sym +++ b/global.sym @@ -21,6 +21,7 @@ Perl_get_context Perl_set_context Perl_amagic_call Perl_Gv_AMupdate +Perl_apply_attrs_string Perl_avhv_delete_ent Perl_avhv_exists_ent Perl_avhv_fetch_ent @@ -185,6 +186,7 @@ Perl_to_uni_upper_lc Perl_to_uni_title_lc Perl_to_uni_lower_lc Perl_is_utf8_char +Perl_is_utf8_string Perl_is_utf8_alnum Perl_is_utf8_alnumc Perl_is_utf8_idfirst @@ -460,6 +462,8 @@ Perl_utf16_to_utf8 Perl_utf16_to_utf8_reversed Perl_utf8_distance Perl_utf8_hop +Perl_utf8_to_bytes +Perl_bytes_to_utf8 Perl_utf8_to_uv Perl_uv_to_utf8 Perl_warn @@ -543,3 +547,4 @@ Perl_ptr_table_fetch Perl_ptr_table_store Perl_ptr_table_split Perl_sys_intern_clear +Perl_sys_intern_init @@ -1228,7 +1228,7 @@ STATIC char* S_scan_subst(pTHX_ char *start); STATIC char* S_scan_trans(pTHX_ char *start); STATIC char* S_scan_word(pTHX_ char *s, char *dest, STRLEN destlen, int allow_package, STRLEN *slp); STATIC char* S_skipspace(pTHX_ char *s); -STATIC char* S_swallow_bom(pTHX_ char *s); +STATIC char* S_swallow_bom(pTHX_ U8 *s); STATIC void S_checkcomma(pTHX_ char *s, char *name, char *what); STATIC void S_force_ident(pTHX_ char *s, int kind); STATIC void S_incline(pTHX_ char *s); @@ -901,6 +901,9 @@ S_study_chunk(pTHX_ regnode **scanp, I32 *deltap, regnode *last, scan_data_t *da sv_catsv(data->last_found, last_str); data->last_end += l * (mincount - 1); } + } else { + /* start offset must point into the last copy */ + data->last_start_min += minnext * (mincount - 1); } } /* It is counted once already... */ @@ -221,6 +221,22 @@ typedef struct re_cc_state #define regcpblow(cp) LEAVE_SCOPE(cp) +#define TRYPAREN(paren, n, input) { \ + if (paren) { \ + if (n) { \ + PL_regstartp[paren] = HOPc(input, -1) - PL_bostr; \ + PL_regendp[paren] = input - PL_bostr; \ + } \ + else \ + PL_regendp[paren] = -1; \ + } \ + if (regmatch(next)) \ + sayYES; \ + if (paren && n) \ + PL_regendp[paren] = -1; \ +} + + /* * pregexec and friends */ @@ -3001,8 +3017,6 @@ S_regmatch(pTHX_ regnode *prog) else c1 = c2 = -1000; PL_reginput = locinput; - if (paren) - PL_regendp[paren] = -1; if (minmod) { CHECKPOINT lastcp; minmod = 0; @@ -3037,16 +3051,7 @@ S_regmatch(pTHX_ regnode *prog) sayNO; } /* PL_reginput == locinput now */ - if (paren) { - if (ln) { - PL_regstartp[paren] = HOPc(locinput, -1) - PL_bostr; - PL_regendp[paren] = locinput - PL_bostr; - } - else - PL_regendp[paren] = -1; - } - if (regmatch(next)) - sayYES; + TRYPAREN(paren, ln, locinput); PL_reginput = locinput; /* Could be reset... */ REGCP_UNWIND; /* Couldn't or didn't -- move forward. */ @@ -3060,16 +3065,7 @@ S_regmatch(pTHX_ regnode *prog) UCHARAT(PL_reginput) == c1 || UCHARAT(PL_reginput) == c2) { - if (paren) { - if (n) { - PL_regstartp[paren] = HOPc(PL_reginput, -1) - PL_bostr; - PL_regendp[paren] = PL_reginput - PL_bostr; - } - else - PL_regendp[paren] = -1; - } - if (regmatch(next)) - sayYES; + TRYPAREN(paren, n, PL_reginput); REGCP_UNWIND; } /* Couldn't or didn't -- move forward. */ @@ -3103,16 +3099,7 @@ S_regmatch(pTHX_ regnode *prog) UCHARAT(PL_reginput) == c1 || UCHARAT(PL_reginput) == c2) { - if (paren && n) { - if (n) { - PL_regstartp[paren] = HOPc(PL_reginput, -1) - PL_bostr; - PL_regendp[paren] = PL_reginput - PL_bostr; - } - else - PL_regendp[paren] = -1; - } - if (regmatch(next)) - sayYES; + TRYPAREN(paren, n, PL_reginput); REGCP_UNWIND; } /* Couldn't or didn't -- back up. */ @@ -3127,8 +3114,7 @@ S_regmatch(pTHX_ regnode *prog) UCHARAT(PL_reginput) == c1 || UCHARAT(PL_reginput) == c2) { - if (regmatch(next)) - sayYES; + TRYPAREN(paren, n, PL_reginput); REGCP_UNWIND; } /* Couldn't or didn't -- back up. */ diff --git a/t/op/re_tests b/t/op/re_tests index 263bded7c9..b3137c737d 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -751,5 +751,10 @@ tt+$ xxxtt y - - '^\S\s+aa$'m \nx aa y - - (^|a)b ab y - - ^([ab]*?)(b)?(c)$ abac y -$2- -- +(\w)?(abc)\1b abcab n - - +^(?:.,){2}c a,b,c y - - +^(.,){2}c a,b,c y $1 b, +^(?:[^,]*,){2}c a,b,c y - - +^([^,]*,){2}c a,b,c y $1 b, (?i) y - - '(?!\A)x'm a\nxb\n y - - @@ -7407,21 +7407,21 @@ Perl_yyerror(pTHX_ char *s) } STATIC char* -S_swallow_bom(pTHX_ char *s) +S_swallow_bom(pTHX_ U8 *s) { STRLEN slen; slen = SvCUR(PL_linestr); switch (*s) { - case -1: - if ((s[1] & 255) == 254) { + case 0xFF: + if (s[1] == 0xFE) { /* UTF-16 little-endian */ #ifndef PERL_NO_UTF16_FILTER U8 *news; #endif - s += 2; - if (*s == 0 && s[1] == 0) /* UTF-32 little-endian */ + if (s[2] == 0 && s[3] == 0) /* UTF-32 little-endian */ Perl_croak(aTHX_ "Unsupported script encoding"); #ifndef PERL_NO_UTF16_FILTER + s += 2; filter_add(S_utf16rev_textfilter, NULL); New(898, news, (PL_bufend - s) * 3 / 2 + 1, U8); PL_bufend = utf16_to_utf8((U16*)s, news, PL_bufend - s); @@ -7431,9 +7431,8 @@ S_swallow_bom(pTHX_ char *s) #endif } break; - - case -2: - if ((s[1] & 255) == 255) { /* UTF-16 big-endian */ + case 0xFE: + if (s[1] == 0xFF) { /* UTF-16 big-endian */ #ifndef PERL_NO_UTF16_FILTER U8 *news; filter_add(S_utf16_textfilter, NULL); @@ -7445,15 +7444,14 @@ S_swallow_bom(pTHX_ char *s) #endif } break; - - case -17: - if (slen > 2 && (s[1] & 255) == 187 && (s[2] & 255) == 191) { + case 0xEF: + if (slen > 2 && s[1] == 0xBB && s[2] == 0xBF) { s += 3; /* UTF-8 */ } break; case 0: if (slen > 3 && s[1] == 0 && /* UTF-32 big-endian */ - s[2] & 255 == 254 && s[3] & 255 == 255) + s[2] == 0xFE && s[3] == 0xFF) { Perl_croak(aTHX_ "Unsupported script encoding"); } diff --git a/vms/subconfigure.com b/vms/subconfigure.com index ce291f8cba..b986820038 100644 --- a/vms/subconfigure.com +++ b/vms/subconfigure.com @@ -72,7 +72,7 @@ $! ##ADD NEW CONSTANTS HERE## $ perl_i_prot="undef" $ perl_d_getespwnam="undef" $ perl_d_getprpwnam="undef" -$ perl_d_isnan= = "define" +$ perl_d_isnan= "define" $ perl_sizesize = "4" $ perl_shmattype = "" $ perl_mmaptype = "" |