summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1997-01-17 08:39:00 +1200
committerChip Salzenberg <chip@atlantic.net>1997-01-17 08:39:00 +1200
commitfa83b5b6263413f922909c255e021c32c808b32d (patch)
tree4f21edebbdd75d0613487aca81c35c1190e483d9 /toke.c
parent743c51bca697772277895eb80832bcfbd65530df (diff)
downloadperl-fa83b5b6263413f922909c255e021c32c808b32d.tar.gz
[inseparable changes from patch from perl5.003_21 to perl5.003_22]perl-5.003_22
CORE LANGUAGE CHANGES Subject: Fix parsing of C< ${ xyz } > From: Chip Salzenberg <chip@atlantic.net> Files: toke.c Subject: Don't parse method calls in strings From: Chip Salzenberg <chip@atlantic.net> Files: toke.c OTHER CORE CHANGES Subject: Fix memory corruption from formats From: Chip Salzenberg <chip@atlantic.net> Files: op.c perl.c perly.c perly.c.diff perly.y proto.h sv.c toke.c
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/toke.c b/toke.c
index ad978a884b..24805a7d38 100644
--- a/toke.c
+++ b/toke.c
@@ -2010,7 +2010,9 @@ yylex()
bufptr = s;
return yylex(); /* ignore fake brackets */
}
- if (*s != '[' && *s != '{' && (*s != '-' || s[1] != '>'))
+ if (*s == '-' && s[1] == '>')
+ lex_state = LEX_INTERPENDMAYBE;
+ else if (*s != '[' && *s != '{')
lex_state = LEX_INTERPEND;
}
}
@@ -4350,8 +4352,13 @@ I32 ck_uni;
}
if (bracket) {
if (isSPACE(s[-1])) {
- while (s < send && (*s == ' ' || *s == '\t')) s++;
- *d = *s;
+ while (s < send) {
+ char ch = *s++;
+ if (ch != ' ' && ch != '\t') {
+ *d = ch;
+ break;
+ }
+ }
}
if (isIDFIRST(*d)) {
d++;
@@ -5062,7 +5069,8 @@ set_csh()
}
int
-start_subparse()
+start_subparse(flags)
+U32 flags;
{
int oldsavestack_ix = savestack_ix;
CV* outsidecv = compcv;
@@ -5084,7 +5092,8 @@ start_subparse()
SAVEI32(pad_reset_pending);
compcv = (CV*)NEWSV(1104,0);
- sv_upgrade((SV *)compcv, SVt_PVCV);
+ sv_upgrade((SV *)compcv, (flags & CVf_FORMAT) ? SVt_PVFM : SVt_PVCV);
+ CvFLAGS(compcv) |= flags;
comppad = newAV();
comppad_name = newAV();