summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorSADAHIRO Tomoyuki <BQW10602@nifty.com>2005-08-12 09:20:39 +0900
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-08-18 08:58:54 +0000
commit4c3a8340729ab239a926a5263f711fc20a0e2468 (patch)
tree9af0206d5b494de99caa5e5bb7a304365d288a53 /toke.c
parentbc6dddacc1f7827aa418855fd57066ca3b6f5230 (diff)
downloadperl-4c3a8340729ab239a926a5263f711fc20a0e2468.tar.gz
Re: Transliteration operator(tr//)on EBCDIC platform
Message-Id: <20050812001541.EA69.BQW10602@nifty.com> p4raw-id: //depot/perl@25303
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/toke.c b/toke.c
index 19bac4f6af..1b16de04ba 100644
--- a/toke.c
+++ b/toke.c
@@ -1368,6 +1368,9 @@ S_scan_const(pTHX_ char *start)
I32 has_utf8 = FALSE; /* Output constant is UTF8 */
I32 this_utf8 = UTF; /* The source string is assumed to be UTF8 */
UV uv;
+#ifdef EBCDIC
+ UV literal_endpoint = 0;
+#endif
const char *leaveit = /* set of acceptably-backslashed characters */
PL_lex_inpat
@@ -1417,8 +1420,9 @@ S_scan_const(pTHX_ char *start)
}
#ifdef EBCDIC
- if ((isLOWER(min) && isLOWER(max)) ||
- (isUPPER(min) && isUPPER(max))) {
+ if (literal_endpoint == 2 &&
+ ((isLOWER(min) && isLOWER(max)) ||
+ (isUPPER(min) && isUPPER(max)))) {
if (isLOWER(min)) {
for (i = min; i <= max; i++)
if (isLOWER(i))
@@ -1437,6 +1441,9 @@ S_scan_const(pTHX_ char *start)
/* mark the range as done, and continue */
dorange = FALSE;
didrange = TRUE;
+#ifdef EBCDIC
+ literal_endpoint = 0;
+#endif
continue;
}
@@ -1455,6 +1462,9 @@ S_scan_const(pTHX_ char *start)
}
else {
didrange = FALSE;
+#ifdef EBCDIC
+ literal_endpoint = 0;
+#endif
}
}
@@ -1788,6 +1798,10 @@ S_scan_const(pTHX_ char *start)
s++;
continue;
} /* end if (backslash) */
+#ifdef EBCDIC
+ else
+ literal_endpoint++;
+#endif
default_action:
/* If we started with encoded form, or already know we want it