#define PL_cshlen (vTHX->Icshlen)
#define PL_cshname (vTHX->Icshname)
#define PL_curcopdb (vTHX->Icurcopdb)
-#define PL_curforce (vTHX->Icurforce)
#define PL_curstname (vTHX->Icurstname)
#define PL_custom_op_descs (vTHX->Icustom_op_descs)
#define PL_custom_op_names (vTHX->Icustom_op_names)
#define PL_my_cxt_keys (vTHX->Imy_cxt_keys)
#define PL_my_cxt_list (vTHX->Imy_cxt_list)
#define PL_my_cxt_size (vTHX->Imy_cxt_size)
-#define PL_nexttoke (vTHX->Inexttoke)
-#define PL_nexttype (vTHX->Inexttype)
-#define PL_nextval (vTHX->Inextval)
#define PL_nice_chunk (vTHX->Inice_chunk)
#define PL_nice_chunk_size (vTHX->Inice_chunk_size)
#define PL_nomemok (vTHX->Inomemok)
#define PL_Icshlen PL_cshlen
#define PL_Icshname PL_cshname
#define PL_Icurcopdb PL_curcopdb
-#define PL_Icurforce PL_curforce
#define PL_Icurstname PL_curstname
#define PL_Icustom_op_descs PL_custom_op_descs
#define PL_Icustom_op_names PL_custom_op_names
#define PL_Imy_cxt_keys PL_my_cxt_keys
#define PL_Imy_cxt_list PL_my_cxt_list
#define PL_Imy_cxt_size PL_my_cxt_size
-#define PL_Inexttoke PL_nexttoke
-#define PL_Inexttype PL_nexttype
-#define PL_Inextval PL_nextval
#define PL_Inice_chunk PL_nice_chunk
#define PL_Inice_chunk_size PL_nice_chunk_size
#define PL_Inomemok PL_nomemok
PERLVAR(Isv_no, SV)
PERLVAR(Isv_yes, SV)
-/* What we know when we're in LEX_KNOWNEXT state. */
-#ifdef PERL_MAD
-PERLVARA(Inexttoke,5, NEXTTOKE) /* value of next token, if any */
-PERLVAR(Icurforce, I32)
-#else
-PERLVARA(Inextval,5, YYSTYPE) /* value of next token, if any */
-PERLVARA(Inexttype,5, I32) /* type of next token */
-PERLVAR(Inexttoke, I32)
-#endif
-
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 */
SV *thisstuff;
SV *thistoken;
SV *thiswhite;
+
+/* What we know when we're in LEX_KNOWNEXT state. */
+ NEXTTOKE nexttoke[5]; /* value of next token, if any */
+ I32 curforce;
+#else
+ YYSTYPE nextval[5]; /* value of next token, if any */
+ I32 nexttype[5]; /* type of next token */
+ I32 nexttoke;
#endif
+
} yy_parser;
#define PL_cshname (*Perl_Icshname_ptr(aTHX))
#undef PL_curcopdb
#define PL_curcopdb (*Perl_Icurcopdb_ptr(aTHX))
-#undef PL_curforce
-#define PL_curforce (*Perl_Icurforce_ptr(aTHX))
#undef PL_curstname
#define PL_curstname (*Perl_Icurstname_ptr(aTHX))
#undef PL_custom_op_descs
#define PL_my_cxt_list (*Perl_Imy_cxt_list_ptr(aTHX))
#undef PL_my_cxt_size
#define PL_my_cxt_size (*Perl_Imy_cxt_size_ptr(aTHX))
-#undef PL_nexttoke
-#define PL_nexttoke (*Perl_Inexttoke_ptr(aTHX))
-#undef PL_nexttype
-#define PL_nexttype (*Perl_Inexttype_ptr(aTHX))
-#undef PL_nextval
-#define PL_nextval (*Perl_Inextval_ptr(aTHX))
#undef PL_nice_chunk
#define PL_nice_chunk (*Perl_Inice_chunk_ptr(aTHX))
#undef PL_nice_chunk_size
parser->thisstuff = proto->thisstuff;
parser->thistoken = proto->thistoken;
parser->thiswhite = proto->thiswhite;
+
+ Copy(proto->nexttoke, parser->nexttoke, 5, NEXTTOKE);
+ parser->curforce = proto->curforce;
+#else
+ Copy(proto->nextval, parser->nextval, 5, YYSTYPE);
+ Copy(proto->nexttype, parser->nexttype, 5, I32);
+ parser->nexttoke = proto->nexttoke;
#endif
return parser;
}
PL_lex_state = proto_perl->Ilex_state;
-#ifdef PERL_MAD
- Copy(proto_perl->Inexttoke, PL_nexttoke, 5, NEXTTOKE);
- PL_curforce = proto_perl->Icurforce;
-#else
- Copy(proto_perl->Inextval, PL_nextval, 5, YYSTYPE);
- Copy(proto_perl->Inexttype, PL_nexttype, 5, I32);
- PL_nexttoke = proto_perl->Inexttoke;
-#endif
-
PL_multi_end = proto_perl->Imulti_end;
PL_error_count = proto_perl->Ierror_count;
# define PL_thisstuff (PL_parser->thisstuff)
# define PL_thistoken (PL_parser->thistoken)
# define PL_thiswhite (PL_parser->thiswhite)
+# define PL_thiswhite (PL_parser->thiswhite)
+# define PL_nexttoke (PL_parser->nexttoke)
+# define PL_curforce (PL_parser->curforce)
+#else
+# define PL_nexttoke (PL_parser->nexttoke)
+# define PL_nexttype (PL_parser->nexttype)
+# define PL_nextval (PL_parser->nextval)
#endif
static int
/* initialise lexer state */
SAVEI8(PL_lex_state);
-#ifdef PERL_MAD
- if (PL_lex_state == LEX_KNOWNEXT) {
- I32 toke = parser->old_parser->lasttoke;
- while (--toke >= 0) {
- SAVEI32(PL_nexttoke[toke].next_type);
- SAVEVPTR(PL_nexttoke[toke].next_val);
- if (PL_madskills)
- SAVEVPTR(PL_nexttoke[toke].next_mad);
- }
- }
- SAVEI32(PL_curforce);
- PL_curforce = -1;
-#else
- if (PL_lex_state == LEX_KNOWNEXT) {
- I32 toke = PL_nexttoke;
- while (--toke >= 0) {
- SAVEI32(PL_nexttype[toke]);
- SAVEVPTR(PL_nextval[toke]);
- }
- SAVEI32(PL_nexttoke);
- }
-#endif
SAVECOPLINE(PL_curcop);
SAVEDESTRUCTOR_X(restore_rsfp, PL_rsfp);
+#ifdef PERL_MAD
+ parser->curforce = -1;
+#else
+ parser->nexttoke = 0;
+#endif
parser->copline = NOLINE;
PL_lex_state = LEX_NORMAL;
parser->expect = XSTATE;
Newx(parser->lex_brackstack, 120, char);
Newx(parser->lex_casestack, 12, char);
*parser->lex_casestack = '\0';
-#ifndef PERL_MAD
- PL_nexttoke = 0;
-#endif
if (line) {
s = SvPV_const(line, len);