#define PL_bitcount (vTHX->Ibitcount)
#define PL_body_arenas (vTHX->Ibody_arenas)
#define PL_body_roots (vTHX->Ibody_roots)
-#define PL_bufend (vTHX->Ibufend)
-#define PL_bufptr (vTHX->Ibufptr)
#define PL_checkav (vTHX->Icheckav)
#define PL_checkav_save (vTHX->Icheckav_save)
#define PL_clocktick (vTHX->Iclocktick)
#define PL_inplace (vTHX->Iinplace)
#define PL_isarev (vTHX->Iisarev)
#define PL_known_layers (vTHX->Iknown_layers)
-#define PL_last_lop (vTHX->Ilast_lop)
-#define PL_last_lop_op (vTHX->Ilast_lop_op)
#define PL_last_swash_hv (vTHX->Ilast_swash_hv)
#define PL_last_swash_key (vTHX->Ilast_swash_key)
#define PL_last_swash_klen (vTHX->Ilast_swash_klen)
#define PL_last_swash_slen (vTHX->Ilast_swash_slen)
#define PL_last_swash_tmps (vTHX->Ilast_swash_tmps)
-#define PL_last_uni (vTHX->Ilast_uni)
#define PL_lastfd (vTHX->Ilastfd)
#define PL_laststatval (vTHX->Ilaststatval)
#define PL_laststype (vTHX->Ilaststype)
#define PL_lex_state (vTHX->Ilex_state)
#define PL_lineary (vTHX->Ilineary)
-#define PL_linestart (vTHX->Ilinestart)
#define PL_localpatches (vTHX->Ilocalpatches)
#define PL_lockhook (vTHX->Ilockhook)
#define PL_madskills (vTHX->Imadskills)
#define PL_numeric_name (vTHX->Inumeric_name)
#define PL_numeric_radix_sv (vTHX->Inumeric_radix_sv)
#define PL_numeric_standard (vTHX->Inumeric_standard)
-#define PL_oldbufptr (vTHX->Ioldbufptr)
#define PL_oldname (vTHX->Ioldname)
-#define PL_oldoldbufptr (vTHX->Ioldoldbufptr)
#define PL_op_mask (vTHX->Iop_mask)
#define PL_origalen (vTHX->Iorigalen)
#define PL_origargc (vTHX->Iorigargc)
#define PL_Ibitcount PL_bitcount
#define PL_Ibody_arenas PL_body_arenas
#define PL_Ibody_roots PL_body_roots
-#define PL_Ibufend PL_bufend
-#define PL_Ibufptr PL_bufptr
#define PL_Icheckav PL_checkav
#define PL_Icheckav_save PL_checkav_save
#define PL_Iclocktick PL_clocktick
#define PL_Iinplace PL_inplace
#define PL_Iisarev PL_isarev
#define PL_Iknown_layers PL_known_layers
-#define PL_Ilast_lop PL_last_lop
-#define PL_Ilast_lop_op PL_last_lop_op
#define PL_Ilast_swash_hv PL_last_swash_hv
#define PL_Ilast_swash_key PL_last_swash_key
#define PL_Ilast_swash_klen PL_last_swash_klen
#define PL_Ilast_swash_slen PL_last_swash_slen
#define PL_Ilast_swash_tmps PL_last_swash_tmps
-#define PL_Ilast_uni PL_last_uni
#define PL_Ilastfd PL_lastfd
#define PL_Ilaststatval PL_laststatval
#define PL_Ilaststype PL_laststype
#define PL_Ilex_state PL_lex_state
#define PL_Ilineary PL_lineary
-#define PL_Ilinestart PL_linestart
#define PL_Ilocalpatches PL_localpatches
#define PL_Ilockhook PL_lockhook
#define PL_Imadskills PL_madskills
#define PL_Inumeric_name PL_numeric_name
#define PL_Inumeric_radix_sv PL_numeric_radix_sv
#define PL_Inumeric_standard PL_numeric_standard
-#define PL_Ioldbufptr PL_oldbufptr
#define PL_Ioldname PL_oldname
-#define PL_Ioldoldbufptr PL_oldoldbufptr
#define PL_Iop_mask PL_op_mask
#define PL_Iorigalen PL_origalen
#define PL_Iorigargc PL_origargc
PERLVAR(Ipreambleav, AV *)
PERLVAR(Imess_sv, SV *)
PERLVAR(Iors_sv, SV *) /* output record separator $\ */
- /* Space for one more U16 here without increasing the structure size */
-PERLVAR(Ilast_lop_op, OPCODE) /* last list operator */
PERLVAR(Iin_my, U16) /* we're compiling a "my" (or "our") declaration */
PERLVARI(Ilaststype, U16, OP_STAT)
PERLVARI(Ilaststatval, int, -1)
PERLVAR(Inomemok, bool) /* let malloc context handle nomem */
PERLVARI(Isavebegin, bool, FALSE) /* save BEGINs for compiler */
-PERLVAR(Ilinestart, char *) /* beg. of most recently read line */
-
PERLVAR(Iuid, Uid_t) /* current real user id */
PERLVAR(Ieuid, Uid_t) /* current effective user id */
PERLVAR(Igid, Gid_t) /* current real group id */
PERLVAR(Inexttoke, I32)
#endif
-PERLVAR(Ibufptr, char *)
-PERLVAR(Ioldbufptr, char *)
-PERLVAR(Ioldoldbufptr, char *)
-PERLVAR(Ibufend, char *)
-
PERLVAR(Ilex_state, U8) /* next token is determined */
PERLVAR(Ierror_count, U8) /* how many errors so far, max 10 */
PERLVARI(Icv_has_eval, bool, FALSE) /* PL_compcv includes an entereval or similar */
PERLVAR(Ipadix_floor, I32) /* how low may inner block reset padix */
PERLVAR(Ipad_reset_pending, I32) /* reset pad on next attempted alloc */
-PERLVAR(Ilast_uni, char *) /* position of last named-unary op */
-PERLVAR(Ilast_lop, char *) /* position of last list operator */
PERLVAR(Iin_my_stash, HV *) /* declared class of this "my" declaration */
PERLVAR(Ihints, U32) /* pragma-tic compile-time flags */
NOOP;
#endif
else {
- if ( PL_bufptr > PL_oldbufptr && PL_bufptr[-1] == ','
+ if ( PL_parser->bufptr > PL_parser->oldbufptr
+ && PL_parser->bufptr[-1] == ','
&& ckWARN(WARN_PARENTHESIS))
{
- char *s = PL_bufptr;
+ char *s = PL_parser->bufptr;
bool sigil = FALSE;
/* some heuristics to detect a potential error */
OP *lex_op; /* extra info to pass back on op */
SV *lex_repl; /* runtime replacement from s/// */
U16 lex_inwhat; /* what kind of quoting are we in */
+ OPCODE last_lop_op; /* last list operator */
I32 lex_starts; /* how many interps done on level */
SV *lex_stuff; /* runtime pattern from m// or s/// */
I32 multi_start; /* 1st line of multi-line string */
SUBLEXINFO sublex_info;
SV *linestr; /* current chunk of src text */
line_t copline; /* current line number */
+ char *bufptr;
+ char *oldbufptr;
+ char *oldoldbufptr;
+ char *bufend;
+ char *linestart; /* beginning of most recently read line */
+ char *last_uni; /* position of last named-unary op */
+ char *last_lop; /* position of last list operator */
#ifdef PERL_MAD
SV *endwhite;
U8 super_state; /* lexer state to save */
U16 sub_inwhat; /* "lex_inwhat" to use */
OP *sub_op; /* "lex_op" to use */
- char *super_bufptr; /* PL_bufptr that was */
- char *super_bufend; /* PL_bufend that was */
+ char *super_bufptr; /* PL_parser->bufptr that was */
+ char *super_bufend; /* PL_parser->bufend that was */
};
#include "parser.h"
#define PL_body_arenas (*Perl_Ibody_arenas_ptr(aTHX))
#undef PL_body_roots
#define PL_body_roots (*Perl_Ibody_roots_ptr(aTHX))
-#undef PL_bufend
-#define PL_bufend (*Perl_Ibufend_ptr(aTHX))
-#undef PL_bufptr
-#define PL_bufptr (*Perl_Ibufptr_ptr(aTHX))
#undef PL_checkav
#define PL_checkav (*Perl_Icheckav_ptr(aTHX))
#undef PL_checkav_save
#define PL_isarev (*Perl_Iisarev_ptr(aTHX))
#undef PL_known_layers
#define PL_known_layers (*Perl_Iknown_layers_ptr(aTHX))
-#undef PL_last_lop
-#define PL_last_lop (*Perl_Ilast_lop_ptr(aTHX))
-#undef PL_last_lop_op
-#define PL_last_lop_op (*Perl_Ilast_lop_op_ptr(aTHX))
#undef PL_last_swash_hv
#define PL_last_swash_hv (*Perl_Ilast_swash_hv_ptr(aTHX))
#undef PL_last_swash_key
#define PL_last_swash_slen (*Perl_Ilast_swash_slen_ptr(aTHX))
#undef PL_last_swash_tmps
#define PL_last_swash_tmps (*Perl_Ilast_swash_tmps_ptr(aTHX))
-#undef PL_last_uni
-#define PL_last_uni (*Perl_Ilast_uni_ptr(aTHX))
#undef PL_lastfd
#define PL_lastfd (*Perl_Ilastfd_ptr(aTHX))
#undef PL_laststatval
#define PL_lex_state (*Perl_Ilex_state_ptr(aTHX))
#undef PL_lineary
#define PL_lineary (*Perl_Ilineary_ptr(aTHX))
-#undef PL_linestart
-#define PL_linestart (*Perl_Ilinestart_ptr(aTHX))
#undef PL_localpatches
#define PL_localpatches (*Perl_Ilocalpatches_ptr(aTHX))
#undef PL_lockhook
#define PL_numeric_radix_sv (*Perl_Inumeric_radix_sv_ptr(aTHX))
#undef PL_numeric_standard
#define PL_numeric_standard (*Perl_Inumeric_standard_ptr(aTHX))
-#undef PL_oldbufptr
-#define PL_oldbufptr (*Perl_Ioldbufptr_ptr(aTHX))
#undef PL_oldname
#define PL_oldname (*Perl_Ioldname_ptr(aTHX))
-#undef PL_oldoldbufptr
-#define PL_oldoldbufptr (*Perl_Ioldoldbufptr_ptr(aTHX))
#undef PL_op_mask
#define PL_op_mask (*Perl_Iop_mask_ptr(aTHX))
#undef PL_origalen
parser->linestr = sv_dup_inc(proto->linestr, param);
parser->expect = proto->expect;
parser->copline = proto->copline;
+ parser->last_lop_op = proto->last_lop_op;
+ parser->linestr = sv_dup_inc(proto->linestr, param);
+
+ {
+ char *ols = SvPVX(proto->linestr);
+ char *ls = SvPVX(parser->linestr);
+
+ parser->bufptr = ls + (proto->bufptr >= ols ?
+ proto->bufptr - ols : 0);
+ parser->oldbufptr = ls + (proto->oldbufptr >= ols ?
+ proto->oldbufptr - ols : 0);
+ parser->oldoldbufptr= ls + (proto->oldoldbufptr >= ols ?
+ proto->oldoldbufptr - ols : 0);
+ parser->linestart = ls + (proto->linestart >= ols ?
+ proto->linestart - ols : 0);
+ parser->last_uni = ls + (proto->last_uni >= ols ?
+ proto->last_uni - ols : 0);
+ parser->last_lop = ls + (proto->last_lop >= ols ?
+ proto->last_lop - ols : 0);
+
+ parser->bufend = ls + SvCUR(parser->linestr);
+ }
#ifdef PERL_MAD
parser->endwhite = proto->endwhite;
PL_nexttoke = proto_perl->Inexttoke;
#endif
- if (proto_perl->Iparser) {
- i = proto_perl->Ibufptr - SvPVX_const(proto_perl->Iparser->linestr);
- PL_bufptr = SvPVX(PL_parser->linestr) + (i < 0 ? 0 : i);
- i = proto_perl->Ioldbufptr - SvPVX_const(proto_perl->Iparser->linestr);
- PL_oldbufptr = SvPVX(PL_parser->linestr) + (i < 0 ? 0 : i);
- i = proto_perl->Ioldoldbufptr - SvPVX_const(proto_perl->Iparser->linestr);
- PL_oldoldbufptr = SvPVX(PL_parser->linestr) + (i < 0 ? 0 : i);
- i = proto_perl->Ilinestart - SvPVX_const(proto_perl->Iparser->linestr);
- PL_linestart = SvPVX(PL_parser->linestr) + (i < 0 ? 0 : i);
- PL_bufend = SvPVX(PL_parser->linestr) + SvCUR(PL_parser->linestr);
- i = proto_perl->Ilast_uni - SvPVX_const(proto_perl->Iparser->linestr);
- PL_last_uni = SvPVX(PL_parser->linestr) + (i < 0 ? 0 : i);
- i = proto_perl->Ilast_lop - SvPVX_const(proto_perl->Iparser->linestr);
- PL_last_lop = SvPVX(PL_parser->linestr) + (i < 0 ? 0 : i);
- }
-
PL_multi_end = proto_perl->Imulti_end;
PL_error_count = proto_perl->Ierror_count;
PL_subline = proto_perl->Isubline;
PL_subname = sv_dup_inc(proto_perl->Isubname, param);
- PL_last_lop_op = proto_perl->Ilast_lop_op;
PL_in_my = proto_perl->Iin_my;
PL_in_my_stash = hv_dup(proto_perl->Iin_my_stash, param);
#ifdef FCRYPT
#define PL_linestr (PL_parser->linestr)
#define PL_expect (PL_parser->expect)
#define PL_copline (PL_parser->copline)
-
+#define PL_bufptr (PL_parser->bufptr)
+#define PL_oldbufptr (PL_parser->oldbufptr)
+#define PL_oldoldbufptr (PL_parser->oldoldbufptr)
+#define PL_linestart (PL_parser->linestart)
+#define PL_bufend (PL_parser->bufend)
+#define PL_last_uni (PL_parser->last_uni)
+#define PL_last_lop (PL_parser->last_lop)
+#define PL_last_lop_op (PL_parser->last_lop_op)
#ifdef PERL_MAD
# define PL_endwhite (PL_parser->endwhite)
}
#endif
SAVECOPLINE(PL_curcop);
- SAVEPPTR(PL_bufptr);
- SAVEPPTR(PL_bufend);
- SAVEPPTR(PL_oldbufptr);
- SAVEPPTR(PL_oldoldbufptr);
- SAVEPPTR(PL_last_lop);
- SAVEPPTR(PL_last_uni);
- SAVEPPTR(PL_linestart);
SAVEDESTRUCTOR_X(restore_rsfp, PL_rsfp);
parser->copline = NOLINE;
SvREFCNT_inc_simple_void_NN(line);
parser->linestr = line;
}
- PL_oldoldbufptr = PL_oldbufptr = PL_bufptr = PL_linestart = SvPVX(parser->linestr);
- PL_bufend = PL_bufptr + SvCUR(parser->linestr);
- PL_last_lop = PL_last_uni = NULL;
+ parser->oldoldbufptr =
+ parser->oldbufptr =
+ parser->bufptr =
+ parser->linestart = SvPVX(parser->linestr);
+ parser->bufend = parser->bufptr + SvCUR(parser->linestr);
+ parser->last_lop = parser->last_uni = NULL;
PL_rsfp = 0;
}