#define PL_comppad_name_fill (vTHX->Icomppad_name_fill)
#define PL_comppad_name_floor (vTHX->Icomppad_name_floor)
#define PL_cop_seqmax (vTHX->Icop_seqmax)
-#define PL_copline (vTHX->Icopline)
#define PL_cryptseen (vTHX->Icryptseen)
#define PL_cshlen (vTHX->Icshlen)
#define PL_cshname (vTHX->Icshname)
#define PL_exit_flags (vTHX->Iexit_flags)
#define PL_exitlist (vTHX->Iexitlist)
#define PL_exitlistlen (vTHX->Iexitlistlen)
-#define PL_expect (vTHX->Iexpect)
#define PL_fdpid (vTHX->Ifdpid)
#define PL_filemode (vTHX->Ifilemode)
#define PL_forkprocess (vTHX->Iforkprocess)
#define PL_Icomppad_name_fill PL_comppad_name_fill
#define PL_Icomppad_name_floor PL_comppad_name_floor
#define PL_Icop_seqmax PL_cop_seqmax
-#define PL_Icopline PL_copline
#define PL_Icryptseen PL_cryptseen
#define PL_Icshlen PL_cshlen
#define PL_Icshname PL_cshname
#define PL_Iexit_flags PL_exit_flags
#define PL_Iexitlist PL_exitlist
#define PL_Iexitlistlen PL_exitlistlen
-#define PL_Iexpect PL_expect
#define PL_Ifdpid PL_fdpid
#define PL_Ifilemode PL_filemode
#define PL_Iforkprocess PL_forkprocess
/* Replace: 0 */
#endif
+#if { VERSION >= 5.9.5 }
+# define PL_PARSER_EXISTS
+# define PL_expect (PL_parser ? PL_parser->expect : 0)
+# define PL_copline (PL_parser ? PL_parser->copline : 0)
+#endif
+
=xsinit
#define NEED_PL_signals
ppp_TESTVAR(PL_dirty);
ppp_TESTVAR(PL_dowarn);
ppp_TESTVAR(PL_errgv);
+#ifdef PL_PARSER_EXISTS
+ ppp_TESTVAR(PL_parser); /* just any var that isn't PL_expect */
+#else
ppp_TESTVAR(PL_expect);
+#endif
ppp_TESTVAR(PL_laststatval);
ppp_TESTVAR(PL_no_modify);
ppp_TESTVAR(PL_perl_destruct_level);
/* runtime control stuff */
PERLVARI(Icurcopdb, COP *, NULL)
-PERLVARI(Icopline, line_t, NOLINE)
/* statics moved here for shared library purposes */
PERLVARI(Igensym, I32, 0) /* next symbol for getsym() to define */
PERLVAR(Ioldoldbufptr, char *)
PERLVAR(Ibufend, char *)
-PERLVARI(Iexpect, U8, XSTATE) /* how to interpret ambiguous tokens */
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 */
+
PERLVAR(Imulti_end, I32) /* last line of multi-line string */
PERLVAR(Isubname, SV *) /* name of current subroutine */
PERLVARI(Iisarev, HV*, NULL) /* Reverse map of @ISA dependencies */
-/* If you are adding a U16, see the comment above on where there are 2 bytes
- of gap which currently will be structure padding. */
+/* If you are adding a U8 or U16, see the 'Space' comments above on where
+ * there are gaps which currently will be structure padding. */
/* Within a stable branch, new variables must be added to the very end, before
* this comment, for binary compatibility (the offsets of the old members must
if (ckWARN(WARN_SYNTAX)) {
const line_t oldline = CopLINE(PL_curcop);
- if (PL_copline != NOLINE)
- CopLINE_set(PL_curcop, PL_copline);
+ if (PL_parser && PL_parser->copline != NOLINE)
+ CopLINE_set(PL_curcop, PL_parser->copline);
Perl_warner(aTHX_ packWARN(WARN_SYNTAX), "Found = in conditional, should be ==");
CopLINE_set(PL_curcop, oldline);
}
/* fake up C<use attributes $pkg,$rv,@attrs> */
ENTER; /* need to protect against side-effects of 'use' */
- SAVEI8(PL_expect);
stashsv = stash ? newSVhek(HvNAME_HEK(stash)) : &PL_sv_no;
#define ATTRSMODULE "attributes"
sv_setsv(PL_curstname, sv);
PL_hints |= HINT_BLOCK_SCOPE;
- PL_copline = NOLINE;
- PL_expect = XSTATE;
+ PL_parser->copline = NOLINE;
+ PL_parser->expect = XSTATE;
#ifndef PERL_MAD
op_free(o);
*/
PL_hints |= HINT_BLOCK_SCOPE;
- PL_copline = NOLINE;
- PL_expect = XSTATE;
+ PL_parser->copline = NOLINE;
+ PL_parser->expect = XSTATE;
PL_cop_seqmax++; /* Purely for B::*'s benefit */
#ifdef PERL_MAD
sv = va_arg(*args, SV*);
}
}
- {
- const line_t ocopline = PL_copline;
- COP * const ocurcop = PL_curcop;
- const U8 oexpect = PL_expect;
- utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
- veop, modname, imop);
- PL_expect = oexpect;
- PL_copline = ocopline;
- PL_curcop = ocurcop;
- }
+ /* utilize() fakes up a BEGIN { require ..; import ... }, so make sure
+ * that it has a PL_parser to play with while doing that, and also
+ * that it doesn't mess with any existing parser, by creating a tmp
+ * new parser with lex_start(). This won't actually be used for much,
+ * since pp_require() will create another parser for the real work. */
+
+ ENTER;
+ SAVEVPTR(PL_curcop);
+ lex_start(NULL);
+ utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
+ veop, modname, imop);
+ LEAVE;
}
OP *
HINTS_REFCNT_UNLOCK;
}
- if (PL_copline == NOLINE)
+ if (PL_parser && PL_parser->copline == NOLINE)
CopLINE_set(cop, CopLINE(PL_curcop));
else {
- CopLINE_set(cop, PL_copline);
- PL_copline = NOLINE;
+ CopLINE_set(cop, PL_parser->copline);
+ if (PL_parser)
+ PL_parser->copline = NOLINE;
}
#ifdef USE_ITHREADS
CopFILE_set(cop, CopFILE(PL_curcop)); /* XXX share in a pvtable? */
}
if (warnop) {
const line_t oldline = CopLINE(PL_curcop);
- CopLINE_set(PL_curcop, PL_copline);
+ CopLINE_set(PL_curcop, PL_parser->copline);
Perl_warner(aTHX_ packWARN(WARN_MISC),
"Value of %s%s can be \"0\"; test with defined()",
PL_op_desc[warnop],
redo = LINKLIST(listop);
if (expr) {
- PL_copline = (line_t)whileline;
+ PL_parser->copline = (line_t)whileline;
scalar(listop);
o = new_logop(OP_AND, 0, &expr, &listop);
if (o == expr && o->op_type == OP_CONST && !SvTRUE(cSVOPo->op_sv)) {
wop = newWHILEOP(flags, 1, loop, forline, newOP(OP_ITER, 0), block, cont, 0);
if (madsv)
op_getmad(madsv, (OP*)loop, 'v');
- PL_copline = forline;
+ PL_parser->copline = forline;
return newSTATEOP(0, label, wop);
}
&& (!const_sv || sv_cmp(cv_const_sv(cv), const_sv))))
{
const line_t oldline = CopLINE(PL_curcop);
- if (PL_copline != NOLINE)
- CopLINE_set(PL_curcop, PL_copline);
+ if (PL_parser && PL_parser->copline != NOLINE)
+ CopLINE_set(PL_curcop, PL_parser->copline);
Perl_warner(aTHX_ packWARN(WARN_REDEFINE),
CvCONST(cv) ? "Constant subroutine %s redefined"
: "Subroutine %s redefined", name);
}
done:
- PL_copline = NOLINE;
+ if (PL_parser)
+ PL_parser->copline = NOLINE;
LEAVE_SCOPE(floor);
return cv;
}
ENTER;
SAVECOPLINE(PL_curcop);
- CopLINE_set(PL_curcop, PL_copline);
+ CopLINE_set(PL_curcop, PL_parser ? PL_parser->copline : NOLINE);
SAVEHINTS();
PL_hints &= ~HINT_BLOCK_SCOPE;
const char *redefined_name = HvNAME_get(stash);
if ( strEQ(redefined_name,"autouse") ) {
const line_t oldline = CopLINE(PL_curcop);
- if (PL_copline != NOLINE)
- CopLINE_set(PL_curcop, PL_copline);
+ if (PL_parser && PL_parser->copline != NOLINE)
+ CopLINE_set(PL_curcop, PL_parser->copline);
Perl_warner(aTHX_ packWARN(WARN_REDEFINE),
CvCONST(cv) ? "Constant subroutine %s redefined"
: "Subroutine %s redefined"
if ((cv = GvFORM(gv))) {
if (ckWARN(WARN_REDEFINE)) {
const line_t oldline = CopLINE(PL_curcop);
- if (PL_copline != NOLINE)
- CopLINE_set(PL_curcop, PL_copline);
+ if (PL_parser && PL_parser->copline != NOLINE)
+ CopLINE_set(PL_curcop, PL_parser->copline);
Perl_warner(aTHX_ packWARN(WARN_REDEFINE),
o ? "Format %"SVf" redefined"
: "Format STDOUT redefined", SVfARG(cSVOPo->op_sv));
#else
op_free(o);
#endif
- PL_copline = NOLINE;
+ if (PL_parser)
+ PL_parser->copline = NOLINE;
LEAVE_SCOPE(floor);
#ifdef PERL_MAD
return pegop;
U8 lex_defer; /* state after determined token */
bool lex_dojoin; /* doing an array interpolation */
U8 lex_expect; /* expect after determined token */
+ U8 expect; /* how to interpret ambiguous tokens */
I32 lex_formbrack; /* bracket count at outer format level */
OP *lex_inpat; /* in pattern $) and $| are special */
OP *lex_op; /* extra info to pass back on op */
bool preambled;
SUBLEXINFO sublex_info;
SV *linestr; /* current chunk of src text */
+ line_t copline; /* current line number */
#ifdef PERL_MAD
SV *endwhite;
#define PL_comppad_name_floor (*Perl_Icomppad_name_floor_ptr(aTHX))
#undef PL_cop_seqmax
#define PL_cop_seqmax (*Perl_Icop_seqmax_ptr(aTHX))
-#undef PL_copline
-#define PL_copline (*Perl_Icopline_ptr(aTHX))
#undef PL_cryptseen
#define PL_cryptseen (*Perl_Icryptseen_ptr(aTHX))
#undef PL_cshlen
#define PL_exitlist (*Perl_Iexitlist_ptr(aTHX))
#undef PL_exitlistlen
#define PL_exitlistlen (*Perl_Iexitlistlen_ptr(aTHX))
-#undef PL_expect
-#define PL_expect (*Perl_Iexpect_ptr(aTHX))
#undef PL_fdpid
#define PL_fdpid (*Perl_Ifdpid_ptr(aTHX))
#undef PL_filemode
case 3:
#line 142 "perly.y"
- { if (PL_copline > (line_t)IVAL((ps[(1) - (4)].val.i_tkval)))
- PL_copline = (line_t)IVAL((ps[(1) - (4)].val.i_tkval));
+ { if (PL_parser->copline > (line_t)IVAL((ps[(1) - (4)].val.i_tkval)))
+ PL_parser->copline = (line_t)IVAL((ps[(1) - (4)].val.i_tkval));
(yyval.opval) = block_end((ps[(2) - (4)].val.ival), (ps[(3) - (4)].val.opval));
TOKEN_GETMAD((ps[(1) - (4)].val.i_tkval),(yyval.opval),'{');
TOKEN_GETMAD((ps[(4) - (4)].val.i_tkval),(yyval.opval),'}');
case 6:
#line 159 "perly.y"
{
- PL_expect = XSTATE; (yyval.ival) = block_start(TRUE);
+ PL_parser->expect = XSTATE; (yyval.ival) = block_start(TRUE);
;}
break;
case 7:
#line 166 "perly.y"
- { if (PL_copline > (line_t)IVAL((ps[(1) - (4)].val.i_tkval)))
- PL_copline = (line_t)IVAL((ps[(1) - (4)].val.i_tkval));
+ { if (PL_parser->copline > (line_t)IVAL((ps[(1) - (4)].val.i_tkval)))
+ PL_parser->copline = (line_t)IVAL((ps[(1) - (4)].val.i_tkval));
(yyval.opval) = block_end((ps[(2) - (4)].val.ival), (ps[(3) - (4)].val.opval));
TOKEN_GETMAD((ps[(1) - (4)].val.i_tkval),(yyval.opval),'{');
TOKEN_GETMAD((ps[(4) - (4)].val.i_tkval),(yyval.opval),'}');
(yyval.opval) = IF_MAD(
newOP(OP_NULL, 0),
Nullop);
- PL_copline = NOLINE;
+ PL_parser->copline = NOLINE;
TOKEN_FREE((ps[(1) - (2)].val.p_tkval));
TOKEN_GETMAD((ps[(2) - (2)].val.i_tkval),(yyval.opval),';');
}
- PL_expect = XSTATE;
+ PL_parser->expect = XSTATE;
;}
break;
#line 226 "perly.y"
{
(yyval.opval) = newSTATEOP(0, PVAL((ps[(1) - (3)].val.p_tkval)), (ps[(2) - (3)].val.opval));
- PL_expect = XSTATE;
+ PL_parser->expect = XSTATE;
DO_MAD(
/* sideff might already have a nexstate */
OP* op = ((LISTOP*)(yyval.opval))->op_first;
case 28:
#line 279 "perly.y"
- { PL_copline = (line_t)IVAL((ps[(1) - (6)].val.i_tkval));
+ { PL_parser->copline = (line_t)IVAL((ps[(1) - (6)].val.i_tkval));
(yyval.opval) = newCONDOP(0, (ps[(3) - (6)].val.opval), scope((ps[(5) - (6)].val.opval)), (ps[(6) - (6)].val.opval));
PL_hints |= HINT_BLOCK_SCOPE;
TOKEN_GETMAD((ps[(1) - (6)].val.i_tkval),(yyval.opval),'I');
case 29:
#line 290 "perly.y"
- { PL_copline = (line_t)IVAL((ps[(1) - (7)].val.i_tkval));
+ { PL_parser->copline = (line_t)IVAL((ps[(1) - (7)].val.i_tkval));
(yyval.opval) = block_end((ps[(3) - (7)].val.ival),
newCONDOP(0, (ps[(4) - (7)].val.opval), scope((ps[(6) - (7)].val.opval)), (ps[(7) - (7)].val.opval)));
TOKEN_GETMAD((ps[(1) - (7)].val.i_tkval),(yyval.opval),'I');
case 30:
#line 298 "perly.y"
- { PL_copline = (line_t)IVAL((ps[(1) - (7)].val.i_tkval));
+ { PL_parser->copline = (line_t)IVAL((ps[(1) - (7)].val.i_tkval));
(yyval.opval) = block_end((ps[(3) - (7)].val.ival),
newCONDOP(0, (ps[(4) - (7)].val.opval), scope((ps[(6) - (7)].val.opval)), (ps[(7) - (7)].val.opval)));
TOKEN_GETMAD((ps[(1) - (7)].val.i_tkval),(yyval.opval),'I');
case 35:
#line 326 "perly.y"
{ OP *innerop;
- PL_copline = (line_t)(ps[(2) - (9)].val.i_tkval);
+ PL_parser->copline = (line_t)(ps[(2) - (9)].val.i_tkval);
(yyval.opval) = block_end((ps[(4) - (9)].val.ival),
newSTATEOP(0, PVAL((ps[(1) - (9)].val.p_tkval)),
innerop = newWHILEOP(0, 1, (LOOP*)Nullop,
case 36:
#line 339 "perly.y"
{ OP *innerop;
- PL_copline = (line_t)(ps[(2) - (9)].val.i_tkval);
+ PL_parser->copline = (line_t)(ps[(2) - (9)].val.i_tkval);
(yyval.opval) = block_end((ps[(4) - (9)].val.ival),
newSTATEOP(0, PVAL((ps[(1) - (9)].val.p_tkval)),
innerop = newWHILEOP(0, 1, (LOOP*)Nullop,
case 40:
#line 384 "perly.y"
{ OP *forop;
- PL_copline = (line_t)IVAL((ps[(2) - (12)].val.i_tkval));
+ PL_parser->copline = (line_t)IVAL((ps[(2) - (12)].val.i_tkval));
forop = newSTATEOP(0, PVAL((ps[(1) - (12)].val.p_tkval)),
newWHILEOP(0, 1, (LOOP*)Nullop,
IVAL((ps[(2) - (12)].val.i_tkval)), scalar((ps[(7) - (12)].val.opval)),
case 42:
#line 422 "perly.y"
- { PL_copline = (line_t) (ps[(2) - (8)].val.i_tkval);
+ { PL_parser->copline = (line_t) (ps[(2) - (8)].val.i_tkval);
(yyval.opval) = block_end((ps[(4) - (8)].val.ival),
newSTATEOP(0, PVAL((ps[(1) - (8)].val.p_tkval)),
newGIVENOP((ps[(6) - (8)].val.opval), scope((ps[(8) - (8)].val.opval)),
newOP(OP_NULL,0),
Nullop
);
- PL_expect = XSTATE;
+ PL_parser->expect = XSTATE;
TOKEN_GETMAD((ps[(1) - (1)].val.i_tkval),(yyval.opval),';');
;}
break;
case 101:
#line 769 "perly.y"
{ (yyval.opval) = newBINOP(OP_GELEM, 0, (ps[(1) - (5)].val.opval), scalar((ps[(3) - (5)].val.opval)));
- PL_expect = XOPERATOR;
+ PL_parser->expect = XOPERATOR;
TOKEN_GETMAD((ps[(2) - (5)].val.i_tkval),(yyval.opval),'{');
TOKEN_GETMAD((ps[(4) - (5)].val.i_tkval),(yyval.opval),';');
TOKEN_GETMAD((ps[(5) - (5)].val.i_tkval),(yyval.opval),'}');
case 105:
#line 796 "perly.y"
{ (yyval.opval) = newBINOP(OP_HELEM, 0, oopsHV((ps[(1) - (5)].val.opval)), jmaybe((ps[(3) - (5)].val.opval)));
- PL_expect = XOPERATOR;
+ PL_parser->expect = XOPERATOR;
TOKEN_GETMAD((ps[(2) - (5)].val.i_tkval),(yyval.opval),'{');
TOKEN_GETMAD((ps[(4) - (5)].val.i_tkval),(yyval.opval),';');
TOKEN_GETMAD((ps[(5) - (5)].val.i_tkval),(yyval.opval),'}');
{ (yyval.opval) = newBINOP(OP_HELEM, 0,
ref(newHVREF((ps[(1) - (6)].val.opval)),OP_RV2HV),
jmaybe((ps[(4) - (6)].val.opval)));
- PL_expect = XOPERATOR;
+ PL_parser->expect = XOPERATOR;
TOKEN_GETMAD((ps[(2) - (6)].val.i_tkval),(yyval.opval),'a');
TOKEN_GETMAD((ps[(3) - (6)].val.i_tkval),(yyval.opval),'{');
TOKEN_GETMAD((ps[(5) - (6)].val.i_tkval),(yyval.opval),';');
{ (yyval.opval) = newBINOP(OP_HELEM, 0,
ref(newHVREF((ps[(1) - (5)].val.opval)),OP_RV2HV),
jmaybe((ps[(3) - (5)].val.opval)));
- PL_expect = XOPERATOR;
+ PL_parser->expect = XOPERATOR;
TOKEN_GETMAD((ps[(2) - (5)].val.i_tkval),(yyval.opval),'{');
TOKEN_GETMAD((ps[(4) - (5)].val.i_tkval),(yyval.opval),';');
TOKEN_GETMAD((ps[(5) - (5)].val.i_tkval),(yyval.opval),'}');
newLISTOP(OP_HSLICE, 0,
list((ps[(3) - (5)].val.opval)),
ref(oopsHV((ps[(1) - (5)].val.opval)), OP_HSLICE)));
- PL_expect = XOPERATOR;
+ PL_parser->expect = XOPERATOR;
TOKEN_GETMAD((ps[(2) - (5)].val.i_tkval),(yyval.opval),'{');
TOKEN_GETMAD((ps[(4) - (5)].val.i_tkval),(yyval.opval),';');
TOKEN_GETMAD((ps[(5) - (5)].val.i_tkval),(yyval.opval),'}');
/* An ordinary block */
block : '{' remember lineseq '}'
- { if (PL_copline > (line_t)IVAL($1))
- PL_copline = (line_t)IVAL($1);
+ { if (PL_parser->copline > (line_t)IVAL($1))
+ PL_parser->copline = (line_t)IVAL($1);
$$ = block_end($2, $3);
TOKEN_GETMAD($1,$$,'{');
TOKEN_GETMAD($4,$$,'}');
progstart:
{
- PL_expect = XSTATE; $$ = block_start(TRUE);
+ PL_parser->expect = XSTATE; $$ = block_start(TRUE);
}
;
mblock : '{' mremember lineseq '}'
- { if (PL_copline > (line_t)IVAL($1))
- PL_copline = (line_t)IVAL($1);
+ { if (PL_parser->copline > (line_t)IVAL($1))
+ PL_parser->copline = (line_t)IVAL($1);
$$ = block_end($2, $3);
TOKEN_GETMAD($1,$$,'{');
TOKEN_GETMAD($4,$$,'}');
$$ = IF_MAD(
newOP(OP_NULL, 0),
Nullop);
- PL_copline = NOLINE;
+ PL_parser->copline = NOLINE;
TOKEN_FREE($1);
TOKEN_GETMAD($2,$$,';');
}
- PL_expect = XSTATE;
+ PL_parser->expect = XSTATE;
}
| label sideff ';'
{
$$ = newSTATEOP(0, PVAL($1), $2);
- PL_expect = XSTATE;
+ PL_parser->expect = XSTATE;
DO_MAD(
/* sideff might already have a nexstate */
OP* op = ((LISTOP*)$$)->op_first;
TOKEN_GETMAD($1,$$,'o');
}
| ELSIF '(' mexpr ')' mblock else
- { PL_copline = (line_t)IVAL($1);
+ { PL_parser->copline = (line_t)IVAL($1);
$$ = newCONDOP(0, $3, scope($5), $6);
PL_hints |= HINT_BLOCK_SCOPE;
TOKEN_GETMAD($1,$$,'I');
/* Real conditional expressions */
cond : IF '(' remember mexpr ')' mblock else
- { PL_copline = (line_t)IVAL($1);
+ { PL_parser->copline = (line_t)IVAL($1);
$$ = block_end($3,
newCONDOP(0, $4, scope($6), $7));
TOKEN_GETMAD($1,$$,'I');
TOKEN_GETMAD($5,$$,')');
}
| UNLESS '(' remember miexpr ')' mblock else
- { PL_copline = (line_t)IVAL($1);
+ { PL_parser->copline = (line_t)IVAL($1);
$$ = block_end($3,
newCONDOP(0, $4, scope($6), $7));
TOKEN_GETMAD($1,$$,'I');
/* Loops: while, until, for, and a bare block */
loop : label WHILE '(' remember texpr ')' mintro mblock cont
{ OP *innerop;
- PL_copline = (line_t)$2;
+ PL_parser->copline = (line_t)$2;
$$ = block_end($4,
newSTATEOP(0, PVAL($1),
innerop = newWHILEOP(0, 1, (LOOP*)Nullop,
| label UNTIL '(' remember iexpr ')' mintro mblock cont
{ OP *innerop;
- PL_copline = (line_t)$2;
+ PL_parser->copline = (line_t)$2;
$$ = block_end($4,
newSTATEOP(0, PVAL($1),
innerop = newWHILEOP(0, 1, (LOOP*)Nullop,
mblock
/* basically fake up an initialize-while lineseq */
{ OP *forop;
- PL_copline = (line_t)IVAL($2);
+ PL_parser->copline = (line_t)IVAL($2);
forop = newSTATEOP(0, PVAL($1),
newWHILEOP(0, 1, (LOOP*)Nullop,
IVAL($2), scalar($7),
/* Switch blocks */
switch : label GIVEN '(' remember mydefsv mexpr ')' mblock
- { PL_copline = (line_t) $2;
+ { PL_parser->copline = (line_t) $2;
$$ = block_end($4,
newSTATEOP(0, PVAL($1),
newGIVENOP($6, scope($8),
newOP(OP_NULL,0),
Nullop
);
- PL_expect = XSTATE;
+ PL_parser->expect = XSTATE;
TOKEN_GETMAD($1,$$,';');
}
;
/* In this and all the hash accessors, ';' is
* provided by the tokeniser */
{ $$ = newBINOP(OP_GELEM, 0, $1, scalar($3));
- PL_expect = XOPERATOR;
+ PL_parser->expect = XOPERATOR;
TOKEN_GETMAD($2,$$,'{');
TOKEN_GETMAD($4,$$,';');
TOKEN_GETMAD($5,$$,'}');
}
| scalar '{' expr ';' '}' /* $foo->{bar();} */
{ $$ = newBINOP(OP_HELEM, 0, oopsHV($1), jmaybe($3));
- PL_expect = XOPERATOR;
+ PL_parser->expect = XOPERATOR;
TOKEN_GETMAD($2,$$,'{');
TOKEN_GETMAD($4,$$,';');
TOKEN_GETMAD($5,$$,'}');
{ $$ = newBINOP(OP_HELEM, 0,
ref(newHVREF($1),OP_RV2HV),
jmaybe($4));
- PL_expect = XOPERATOR;
+ PL_parser->expect = XOPERATOR;
TOKEN_GETMAD($2,$$,'a');
TOKEN_GETMAD($3,$$,'{');
TOKEN_GETMAD($5,$$,';');
{ $$ = newBINOP(OP_HELEM, 0,
ref(newHVREF($1),OP_RV2HV),
jmaybe($3));
- PL_expect = XOPERATOR;
+ PL_parser->expect = XOPERATOR;
TOKEN_GETMAD($2,$$,'{');
TOKEN_GETMAD($4,$$,';');
TOKEN_GETMAD($5,$$,'}');
newLISTOP(OP_HSLICE, 0,
list($3),
ref(oopsHV($1), OP_HSLICE)));
- PL_expect = XOPERATOR;
+ PL_parser->expect = XOPERATOR;
TOKEN_GETMAD($2,$$,'{');
TOKEN_GETMAD($4,$$,';');
TOKEN_GETMAD($5,$$,'}');
SvREFCNT(sv) = 1;
SvFLAGS(sv) = 0;
sv->sv_debug_optype = PL_op ? PL_op->op_type : 0;
- sv->sv_debug_line = (U16) ((PL_copline == NOLINE) ?
- (PL_curcop ? CopLINE(PL_curcop) : 0) : PL_copline);
+ sv->sv_debug_line = (U16) ((PL_parser && PL_parser->copline == NOLINE) ?
+ (PL_curcop ? CopLINE(PL_curcop) : 0) : PL_parser->copline);
sv->sv_debug_inpad = 0;
sv->sv_debug_cloned = 0;
sv->sv_debug_file = PL_curcop ? savepv(CopFILE(PL_curcop)): NULL;
parser->preambled = proto->preambled;
parser->sublex_info = proto->sublex_info; /* XXX not quite right */
parser->linestr = sv_dup_inc(proto->linestr, param);
+ parser->expect = proto->expect;
+ parser->copline = proto->copline;
+
#ifdef PERL_MAD
parser->endwhite = proto->endwhite;
/* runtime control stuff */
PL_curcopdb = (COP*)any_dup(proto_perl->Icurcopdb, proto_perl);
- PL_copline = proto_perl->Icopline;
PL_filemode = proto_perl->Ifilemode;
PL_lastfd = proto_perl->Ilastfd;
PL_last_lop = SvPVX(PL_parser->linestr) + (i < 0 ? 0 : i);
}
- PL_expect = proto_perl->Iexpect;
-
PL_multi_end = proto_perl->Imulti_end;
PL_error_count = proto_perl->Ierror_count;