#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_localpatches (vTHX->Ilocalpatches)
#define PL_lockhook (vTHX->Ilockhook)
#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_Ilocalpatches PL_localpatches
#define PL_Ilockhook PL_lockhook
PERLVAR(Isv_no, SV)
PERLVAR(Isv_yes, SV)
-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 */
-/* Space for one more U8 here without increasing the structure size */
+/* Space for two more U8 here without increasing the structure size */
PERLVAR(Imulti_end, I32) /* last line of multi-line string */
break;
case '\023': /* ^S */
if (nextchar == '\0') {
- if (PL_lex_state != LEX_NOTPARSING)
+ if (PL_parser && PL_parser->lex_state != LEX_NOTPARSING)
SvOK_off(sv);
else if (PL_in_eval)
sv_setiv(sv, PL_in_eval & ~(EVAL_INREQUIRE));
return;
if (mp->mad_next)
mad_free(mp->mad_next);
-/* if (PL_lex_state != LEX_NOTPARSING && mp->mad_vlen)
+/* if (PL_parser && PL_parser->lex_state != LEX_NOTPARSING && mp->mad_vlen)
PerlIO_printf(PerlIO_stderr(), "DESTROYING '%c'=<%s>\n", mp->mad_key & 255, mp->mad_val); */
switch (mp->mad_type) {
case MAD_NULL:
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 */
+ U8 lex_state; /* next token is determined */
#ifdef PERL_MAD
SV *endwhite;
init_stacks();
init_ids();
- PL_lex_state = LEX_NOTPARSING;
JMPENV_BOOTSTRAP;
STATUS_ALL_SUCCESS;
#define PL_laststatval (*Perl_Ilaststatval_ptr(aTHX))
#undef PL_laststype
#define PL_laststype (*Perl_Ilaststype_ptr(aTHX))
-#undef PL_lex_state
-#define PL_lex_state (*Perl_Ilex_state_ptr(aTHX))
#undef PL_lineary
#define PL_lineary (*Perl_Ilineary_ptr(aTHX))
#undef PL_localpatches
CvDEPTH(PL_compcv) = 1;
SP = PL_stack_base + POPMARK; /* pop original mark */
PL_op = saveop; /* The caller may need it. */
- PL_lex_state = LEX_NOTPARSING; /* $^S needs this. */
+ PL_parser->lex_state = LEX_NOTPARSING; /* $^S needs this. */
RETURNOP(PL_eval_start);
}
parser->expect = proto->expect;
parser->copline = proto->copline;
parser->last_lop_op = proto->last_lop_op;
+ parser->lex_state = proto->lex_state;
+
parser->linestr = sv_dup_inc(proto->linestr, param);
PL_parser = parser_dup(proto_perl->Iparser, param);
- PL_lex_state = proto_perl->Ilex_state;
-
PL_multi_end = proto_perl->Imulti_end;
PL_error_count = proto_perl->Ierror_count;
#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)
+#define PL_lex_state (PL_parser->lex_state)
#ifdef PERL_MAD
# define PL_endwhite (PL_parser->endwhite)
/* initialise lexer state */
- SAVEI8(PL_lex_state);
SAVECOPLINE(PL_curcop);
SAVEDESTRUCTOR_X(restore_rsfp, PL_rsfp);