diff options
-rw-r--r-- | embedvar.h | 2 | ||||
-rw-r--r-- | intrpvar.h | 3 | ||||
-rw-r--r-- | mg.c | 2 | ||||
-rw-r--r-- | op.c | 2 | ||||
-rw-r--r-- | parser.h | 1 | ||||
-rw-r--r-- | perl.c | 1 | ||||
-rw-r--r-- | perlapi.h | 2 | ||||
-rw-r--r-- | pp_ctl.c | 2 | ||||
-rw-r--r-- | sv.c | 4 | ||||
-rw-r--r-- | toke.c | 2 |
10 files changed, 8 insertions, 13 deletions
diff --git a/embedvar.h b/embedvar.h index 2218a38cf8..f5334b5d06 100644 --- a/embedvar.h +++ b/embedvar.h @@ -233,7 +233,6 @@ #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) @@ -484,7 +483,6 @@ #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 diff --git a/intrpvar.h b/intrpvar.h index 02fc97efcd..e2c7b1942f 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -285,10 +285,9 @@ PERLVAR(Isv_undef, SV) 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 */ @@ -807,7 +807,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) 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)); @@ -2818,7 +2818,7 @@ Perl_mad_free(pTHX_ MADPROP* mp) 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: @@ -69,6 +69,7 @@ typedef struct yy_parser { 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; @@ -293,7 +293,6 @@ perl_construct(pTHXx) init_stacks(); init_ids(); - PL_lex_state = LEX_NOTPARSING; JMPENV_BOOTSTRAP; STATUS_ALL_SUCCESS; @@ -342,8 +342,6 @@ END_EXTERN_C #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 @@ -3009,7 +3009,7 @@ S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq) 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); } @@ -9575,6 +9575,8 @@ Perl_parser_dup(pTHX_ const yy_parser *proto, CLONE_PARAMS* param) 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); @@ -11257,8 +11259,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, 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; @@ -60,6 +60,7 @@ #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) @@ -663,7 +664,6 @@ Perl_lex_start(pTHX_ SV *line) /* initialise lexer state */ - SAVEI8(PL_lex_state); SAVECOPLINE(PL_curcop); SAVEDESTRUCTOR_X(restore_rsfp, PL_rsfp); |