summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/toke.c b/toke.c
index 69e2873ddb..ff9ae2802d 100644
--- a/toke.c
+++ b/toke.c
@@ -482,9 +482,9 @@ S_incline(pTHX_ char *s)
ch = *t;
*t = '\0';
if (t - s > 0)
- PL_curcop->cop_filegv = gv_fetchfile(s);
+ CopFILEGV_set(PL_curcop, gv_fetchfile(s));
else
- PL_curcop->cop_filegv = gv_fetchfile(PL_origfilename);
+ CopFILEGV_set(PL_curcop, gv_fetchfile(PL_origfilename));
*t = ch;
PL_curcop->cop_line = atoi(n)-1;
}
@@ -598,7 +598,7 @@ S_skipspace(pTHX_ register char *s)
sv_upgrade(sv, SVt_PVMG);
sv_setpvn(sv,PL_bufptr,PL_bufend-PL_bufptr);
- av_store(GvAV(PL_curcop->cop_filegv),(I32)PL_curcop->cop_line,sv);
+ av_store(CopFILEAV(PL_curcop),(I32)PL_curcop->cop_line,sv);
}
}
}
@@ -2338,7 +2338,7 @@ Perl_yylex(pTHX)
sv_upgrade(sv, SVt_PVMG);
sv_setsv(sv,PL_linestr);
- av_store(GvAV(PL_curcop->cop_filegv),(I32)PL_curcop->cop_line,sv);
+ av_store(CopFILEAV(PL_curcop),(I32)PL_curcop->cop_line,sv);
}
goto retry;
}
@@ -2387,7 +2387,7 @@ Perl_yylex(pTHX)
sv_upgrade(sv, SVt_PVMG);
sv_setsv(sv,PL_linestr);
- av_store(GvAV(PL_curcop->cop_filegv),(I32)PL_curcop->cop_line,sv);
+ av_store(CopFILEAV(PL_curcop),(I32)PL_curcop->cop_line,sv);
}
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
if (PL_curcop->cop_line == 1) {
@@ -2428,7 +2428,7 @@ Perl_yylex(pTHX)
*/
SV *x = GvSV(gv_fetchpv("\030", TRUE, SVt_PV));
assert(SvPOK(x) || SvGMAGICAL(x));
- if (sv_eq(x, GvSV(PL_curcop->cop_filegv))) {
+ if (sv_eq(x, CopFILESV(PL_curcop))) {
sv_setpvn(x, ipath, ipathend - ipath);
SvSETMAGIC(x);
}
@@ -3737,7 +3737,7 @@ Perl_yylex(pTHX)
case KEY___FILE__:
yylval.opval = (OP*)newSVOP(OP_CONST, 0,
- newSVsv(GvSV(PL_curcop->cop_filegv)));
+ newSVsv(CopFILESV(PL_curcop)));
TERM(THING);
case KEY___LINE__:
@@ -6128,8 +6128,7 @@ S_scan_heredoc(pTHX_ register char *s)
sv_upgrade(sv, SVt_PVMG);
sv_setsv(sv,PL_linestr);
- av_store(GvAV(PL_curcop->cop_filegv),
- (I32)PL_curcop->cop_line,sv);
+ av_store(CopFILEAV(PL_curcop), (I32)PL_curcop->cop_line,sv);
}
if (*s == term && memEQ(s,PL_tokenbuf,len)) {
s = PL_bufend - 1;
@@ -6452,8 +6451,7 @@ S_scan_str(pTHX_ char *start, int keep_quoted, int keep_delims)
sv_upgrade(sv, SVt_PVMG);
sv_setsv(sv,PL_linestr);
- av_store(GvAV(PL_curcop->cop_filegv),
- (I32)PL_curcop->cop_line, sv);
+ av_store(CopFILEAV(PL_curcop), (I32)PL_curcop->cop_line, sv);
}
/* having changed the buffer, we must update PL_bufend */
@@ -6996,7 +6994,7 @@ Perl_yyerror(pTHX_ char *s)
}
msg = sv_2mortal(newSVpv(s, 0));
Perl_sv_catpvf(aTHX_ msg, " at %_ line %"IVdf", ",
- GvSV(PL_curcop->cop_filegv), (IV)PL_curcop->cop_line);
+ CopFILESV(PL_curcop), (IV)PL_curcop->cop_line);
if (context)
Perl_sv_catpvf(aTHX_ msg, "near \"%.*s\"\n", contlen, context);
else
@@ -7013,7 +7011,7 @@ Perl_yyerror(pTHX_ char *s)
else
qerror(msg);
if (PL_error_count >= 10)
- Perl_croak(aTHX_ "%_ has too many errors.\n", GvSV(PL_curcop->cop_filegv));
+ Perl_croak(aTHX_ "%_ has too many errors.\n", CopFILESV(PL_curcop));
PL_in_my = 0;
PL_in_my_stash = Nullhv;
return 0;
@@ -7021,7 +7019,6 @@ Perl_yyerror(pTHX_ char *s)
#ifdef PERL_OBJECT
-#define NO_XSLOCKS
#include "XSUB.h"
#endif