diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1997-01-17 08:39:00 +1200 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-01-17 08:39:00 +1200 |
commit | fa83b5b6263413f922909c255e021c32c808b32d (patch) | |
tree | 4f21edebbdd75d0613487aca81c35c1190e483d9 /toke.c | |
parent | 743c51bca697772277895eb80832bcfbd65530df (diff) | |
download | perl-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.c | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -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(); |