diff options
author | Zefram <zefram@fysh.org> | 2010-10-23 15:40:58 +0100 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-10-25 12:29:47 -0700 |
commit | 94bf0465170f13a4a3114b27d564dc2287d466b2 (patch) | |
tree | 4156eb4d63521dfab715d1cef1a2c94181b43c81 /ext/XS-APItest | |
parent | eae48c8938e50ebb341a72c2886c5ae8587092a5 (diff) | |
download | perl-94bf0465170f13a4a3114b27d564dc2287d466b2.tar.gz |
stop passing line numbers into op constructor functions
Remove the line number parameter from newWHILEOP() and newFOROP()
functions. Instead, the line number for the impending COP is set by
parser code after constructing the ops. (In fact the parser was doing
this anyway in most cases.) This brings newWHILEOP() and newFOROP()
in line with the other op constructors, in that they do not concern
themselves with COPs.
Diffstat (limited to 'ext/XS-APItest')
-rw-r--r-- | ext/XS-APItest/APItest.xs | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs index 0ff2ed1409..99c96d96bd 100644 --- a/ext/XS-APItest/APItest.xs +++ b/ext/XS-APItest/APItest.xs @@ -741,12 +741,8 @@ static OP *THX_parse_keyword_swaptwostmts(pTHX) #define parse_keyword_looprest() THX_parse_keyword_looprest(aTHX) static OP *THX_parse_keyword_looprest(pTHX) { - I32 condline; - OP *body; - condline = CopLINE(PL_curcop); - body = parse_stmtseq(0); - return newWHILEOP(0, 1, NULL, condline, newSVOP(OP_CONST, 0, &PL_sv_yes), - body, NULL, 1); + return newWHILEOP(0, 1, NULL, newSVOP(OP_CONST, 0, &PL_sv_yes), + parse_stmtseq(0), NULL, 1); } #define parse_keyword_scopelessblock() THX_parse_keyword_scopelessblock(aTHX) @@ -794,12 +790,8 @@ static OP *THX_parse_keyword_stmtsasexpr(pTHX) #define parse_keyword_loopblock() THX_parse_keyword_loopblock(aTHX) static OP *THX_parse_keyword_loopblock(pTHX) { - I32 condline; - OP *body; - condline = CopLINE(PL_curcop); - body = parse_block(0); - return newWHILEOP(0, 1, NULL, condline, newSVOP(OP_CONST, 0, &PL_sv_yes), - body, NULL, 1); + return newWHILEOP(0, 1, NULL, newSVOP(OP_CONST, 0, &PL_sv_yes), + parse_block(0), NULL, 1); } #define parse_keyword_blockasexpr() THX_parse_keyword_blockasexpr(aTHX) |