summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-06-28 09:56:53 -0600
committerKarl Williamson <khw@cpan.org>2014-06-28 19:47:21 -0600
commitdc023dbb5508b25bc7dab35c42cc34fe58fc4037 (patch)
tree2b7c02c506c3dfb46a974ad9d761066e5cc04bb1 /toke.c
parent93293564d3da2e1d1365ac6f254016fec190c216 (diff)
downloadperl-dc023dbb5508b25bc7dab35c42cc34fe58fc4037.tar.gz
toke.c: White-space alignment, add comment
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/toke.c b/toke.c
index 68f7f52f89..2842115574 100644
--- a/toke.c
+++ b/toke.c
@@ -2786,20 +2786,19 @@ STATIC char *
S_scan_const(pTHX_ char *start)
{
char *send = PL_bufend; /* end of the constant */
- SV *sv = newSV(send - start); /* sv for the constant. See
- note below on sizing. */
+ SV *sv = newSV(send - start); /* sv for the constant. See note below
+ on sizing. */
char *s = start; /* start of the constant */
char *d = SvPVX(sv); /* destination for copies */
- bool dorange = FALSE; /* are we in a translit range? */
- bool didrange = FALSE; /* did we just finish a range? */
- bool in_charclass = FALSE; /* within /[...]/ */
- bool has_utf8 = FALSE; /* Output constant is UTF8 */
- bool this_utf8 = cBOOL(UTF); /* Is the source string assumed
- to be UTF8? But, this can
- show as true when the source
- isn't utf8, as for example
- when it is entirely composed
- of hex constants */
+ bool dorange = FALSE; /* are we in a translit range? */
+ bool didrange = FALSE; /* did we just finish a range? */
+ bool in_charclass = FALSE; /* within /[...]/ */
+ bool has_utf8 = FALSE; /* Output constant is UTF8 */
+ bool this_utf8 = cBOOL(UTF); /* Is the source string assumed to be
+ UTF8? But, this can show as true
+ when the source isn't utf8, as for
+ example when it is entirely composed
+ of hex constants */
SV *res; /* result from charnames */
/* Note on sizing: The scanned constant is placed into sv, which is
@@ -2867,9 +2866,9 @@ S_scan_const(pTHX_ char *start)
i = d - SvPVX_const(sv); /* remember current offset */
#ifdef EBCDIC
SvGROW(sv,
- SvLEN(sv) + (has_utf8 ?
- (512 - UTF_CONTINUATION_MARK +
- UNISKIP(0x100))
+ SvLEN(sv) + ((has_utf8)
+ ? (512 - UTF_CONTINUATION_MARK
+ + UNISKIP(0x100))
: 256));
/* How many two-byte within 0..255: 128 in UTF-8,
* 96 in UTF-8-mod. */
@@ -2910,6 +2909,8 @@ S_scan_const(pTHX_ char *start)
}
#ifdef EBCDIC
+ /* Because of the discontinuities in EBCDIC A-Z and a-z, expand
+ * any subsets of these ranges into individual characters */
if (literal_endpoint == 2 &&
((isLOWER_A(min) && isLOWER_A(max)) ||
(isUPPER_A(min) && isUPPER_A(max))))