summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-02-10 10:21:04 +0000
committerNicholas Clark <nick@ccl4.org>2008-02-10 10:21:04 +0000
commitbcabcc50f85300b3fbf720ece84c2fd14bd909ed (patch)
treea9f7335df9d83c0b31e464510c8bbe3eab5bb0e7 /perly.y
parentf7a782ffe2f8f23ef6d2e927311c879ee73b140f (diff)
downloadperl-bcabcc50f85300b3fbf720ece84c2fd14bd909ed.tar.gz
Eliminate use of Nullop in the core code. Dual life uses remain.
p4raw-id: //depot/perl@33269
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y64
1 files changed, 32 insertions, 32 deletions
diff --git a/perly.y b/perly.y
index 4dac4d0dcd..ad7b55209e 100644
--- a/perly.y
+++ b/perly.y
@@ -177,7 +177,7 @@ mremember: /* NULL */ /* start a partial lexical scope */
/* A collection of "lines" in the program */
lineseq : /* NULL */
- { $$ = Nullop; }
+ { $$ = (OP*)NULL; }
| lineseq decl
{
$$ = IF_MAD(
@@ -213,7 +213,7 @@ line : label cond
else {
$$ = IF_MAD(
newOP(OP_NULL, 0),
- Nullop);
+ (OP*)NULL);
PL_parser->copline = NOLINE;
TOKEN_FREE($1);
TOKEN_GETMAD($2,$$,';');
@@ -240,7 +240,7 @@ line : label cond
/* An expression which may have a side-effect */
sideff : error
- { $$ = Nullop; }
+ { $$ = (OP*)NULL; }
| expr
{ $$ = $1; }
| expr IF expr
@@ -261,14 +261,14 @@ sideff : error
}
| expr FOR expr
{ $$ = newFOROP(0, NULL, (line_t)IVAL($2),
- Nullop, $3, $1, Nullop);
+ (OP*)NULL, $3, $1, (OP*)NULL);
TOKEN_GETMAD($2,((LISTOP*)$$)->op_first->op_sibling,'w');
}
;
/* else and elsif blocks */
else : /* NULL */
- { $$ = Nullop; }
+ { $$ = (OP*)NULL; }
| ELSE mblock
{ ($2)->op_flags |= OPf_PARENS; $$ = scope($2);
TOKEN_GETMAD($1,$$,'o');
@@ -312,7 +312,7 @@ case : WHEN '(' remember mexpr ')' mblock
/* Continue blocks */
cont : /* NULL */
- { $$ = Nullop; }
+ { $$ = (OP*)NULL; }
| CONTINUE block
{ $$ = scope($2);
TOKEN_GETMAD($1,$$,'o');
@@ -325,7 +325,7 @@ loop : label WHILE '(' remember texpr ')' mintro mblock cont
PL_parser->copline = (line_t)$2;
$$ = block_end($4,
newSTATEOP(0, PVAL($1),
- innerop = newWHILEOP(0, 1, (LOOP*)Nullop,
+ innerop = newWHILEOP(0, 1, (LOOP*)(OP*)NULL,
IVAL($2), $5, $8, $9, $7)));
TOKEN_GETMAD($1,innerop,'L');
TOKEN_GETMAD($2,innerop,'W');
@@ -338,7 +338,7 @@ loop : label WHILE '(' remember texpr ')' mintro mblock cont
PL_parser->copline = (line_t)$2;
$$ = block_end($4,
newSTATEOP(0, PVAL($1),
- innerop = newWHILEOP(0, 1, (LOOP*)Nullop,
+ innerop = newWHILEOP(0, 1, (LOOP*)(OP*)NULL,
IVAL($2), $5, $8, $9, $7)));
TOKEN_GETMAD($1,innerop,'L');
TOKEN_GETMAD($2,innerop,'W');
@@ -370,7 +370,7 @@ loop : label WHILE '(' remember texpr ')' mintro mblock cont
{ OP *innerop;
$$ = block_end($4,
innerop = newFOROP(0, PVAL($1), (line_t)IVAL($2),
- Nullop, $5, $7, $8));
+ (OP*)NULL, $5, $7, $8));
TOKEN_GETMAD($1,((LISTOP*)innerop)->op_first,'L');
TOKEN_GETMAD($2,((LISTOP*)innerop)->op_first->op_sibling,'W');
TOKEN_GETMAD($3,((LISTOP*)innerop)->op_first->op_sibling,'(');
@@ -382,7 +382,7 @@ loop : label WHILE '(' remember texpr ')' mintro mblock cont
{ OP *forop;
PL_parser->copline = (line_t)IVAL($2);
forop = newSTATEOP(0, PVAL($1),
- newWHILEOP(0, 1, (LOOP*)Nullop,
+ newWHILEOP(0, 1, (LOOP*)(OP*)NULL,
IVAL($2), scalar($7),
$12, $10, $9));
#ifdef MAD
@@ -410,8 +410,8 @@ loop : label WHILE '(' remember texpr ')' mintro mblock cont
$$ = block_end($4, forop); }
| label block cont /* a block is a loop that happens once */
{ $$ = newSTATEOP(0, PVAL($1),
- newWHILEOP(0, 1, (LOOP*)Nullop,
- NOLINE, Nullop, $2, $3, 0));
+ newWHILEOP(0, 1, (LOOP*)(OP*)NULL,
+ NOLINE, (OP*)NULL, $2, $3, 0));
TOKEN_GETMAD($1,((LISTOP*)$$)->op_first,'L'); }
;
@@ -432,7 +432,7 @@ mintro : /* NULL */
/* Normal expression */
nexpr : /* NULL */
- { $$ = Nullop; }
+ { $$ = (OP*)NULL; }
| sideff
;
@@ -509,13 +509,13 @@ format : FORMAT startformsub formname block
token_free($1);
#else
newFORM($2, $3, $4);
- $$ = Nullop;
+ $$ = (OP*)NULL;
#endif
}
;
formname: WORD { $$ = $1; }
- | /* NULL */ { $$ = Nullop; }
+ | /* NULL */ { $$ = (OP*)NULL; }
;
/* Unimplemented "my sub foo { }" */
@@ -526,7 +526,7 @@ mysubrout: MYSUB startsub subname proto subattrlist subbody
token_getmad($1,$$,'d');
#else
newMYSUB($2, $3, $4, $5, $6);
- $$ = Nullop;
+ $$ = (OP*)NULL;
#endif
}
;
@@ -549,7 +549,7 @@ subrout : SUB startsub subname proto subattrlist subbody
}
#else
newATTRSUB($2, $3, $4, $5, $6);
- $$ = Nullop;
+ $$ = (OP*)NULL;
#endif
}
;
@@ -581,13 +581,13 @@ subname : WORD { const char *const name = SvPV_nolen_const(((SVOP*)$1)->op_sv);
/* Subroutine prototype */
proto : /* NULL */
- { $$ = Nullop; }
+ { $$ = (OP*)NULL; }
| THING
;
/* Optional list of subroutine attributes */
subattrlist: /* NULL */
- { $$ = Nullop; }
+ { $$ = (OP*)NULL; }
| COLONATTR THING
{ $$ = $2;
TOKEN_GETMAD($1,$$,':');
@@ -595,7 +595,7 @@ subattrlist: /* NULL */
| COLONATTR
{ $$ = IF_MAD(
newOP(OP_NULL, 0),
- Nullop
+ (OP*)NULL
);
TOKEN_GETMAD($1,$$,':');
}
@@ -609,7 +609,7 @@ myattrlist: COLONATTR THING
| COLONATTR
{ $$ = IF_MAD(
newOP(OP_NULL, 0),
- Nullop
+ (OP*)NULL
);
TOKEN_GETMAD($1,$$,':');
}
@@ -619,7 +619,7 @@ myattrlist: COLONATTR THING
subbody : block { $$ = $1; }
| ';' { $$ = IF_MAD(
newOP(OP_NULL,0),
- Nullop
+ (OP*)NULL
);
PL_parser->expect = XSTATE;
TOKEN_GETMAD($1,$$,';');
@@ -634,7 +634,7 @@ package : PACKAGE WORD ';'
token_getmad($3,$$,';');
#else
package($2);
- $$ = Nullop;
+ $$ = (OP*)NULL;
#endif
}
;
@@ -652,7 +652,7 @@ use : USE startsub
append_madprops(newMADPROP('!', MAD_PV, "", 0), $$, 0);
#else
utilize(IVAL($1), $2, $4, $5, $6);
- $$ = Nullop;
+ $$ = (OP*)NULL;
#endif
}
;
@@ -750,7 +750,7 @@ listop : LSTOP indirob argexpr /* map {...} @args or print $fh @args */
}
| LSTOPSUB startanonsub block /* sub f(&@); f { foo } ... */
{ SvREFCNT_inc_simple_void(PL_compcv);
- $<opval>$ = newANONATTRSUB($2, 0, Nullop, $3); }
+ $<opval>$ = newANONATTRSUB($2, 0, (OP*)NULL, $3); }
listexpr %prec LSTOP /* ... @bar */
{ $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
append_elem(OP_LIST,
@@ -856,7 +856,7 @@ subscripted: star '{' expr ';' '}' /* *main::{something} */
TOKEN_GETMAD($6,$$,']');
}
| '(' ')' '[' expr ']' /* empty list slice! */
- { $$ = newSLICEOP(0, $4, Nullop);
+ { $$ = newSLICEOP(0, $4, (OP*)NULL);
TOKEN_GETMAD($1,$$,'(');
TOKEN_GETMAD($2,$$,')');
TOKEN_GETMAD($3,$$,'[');
@@ -986,7 +986,7 @@ anonymous: '[' expr ']'
TOKEN_GETMAD($3,$$,']');
}
| '[' ']'
- { $$ = newANONLIST(Nullop);
+ { $$ = newANONLIST((OP*)NULL);
TOKEN_GETMAD($1,$$,'[');
TOKEN_GETMAD($2,$$,']');
}
@@ -997,7 +997,7 @@ anonymous: '[' expr ']'
TOKEN_GETMAD($4,$$,'}');
}
| HASHBRACK ';' '}' %prec '(' /* { } (';' by tokener) */
- { $$ = newANONHASH(Nullop);
+ { $$ = newANONHASH((OP*)NULL);
TOKEN_GETMAD($1,$$,'{');
TOKEN_GETMAD($2,$$,';');
TOKEN_GETMAD($3,$$,'}');
@@ -1028,7 +1028,7 @@ termdo : DO term %prec UNIOP /* do $filename */
scalar(newCVREF(
(OPpENTERSUB_AMPER<<8),
scalar($2)
- )),Nullop)); dep();
+ )),(OP*)NULL)); dep();
TOKEN_GETMAD($1,$$,'o');
TOKEN_GETMAD($3,$$,'(');
TOKEN_GETMAD($4,$$,')');
@@ -1049,7 +1049,7 @@ termdo : DO term %prec UNIOP /* do $filename */
| DO scalar '(' ')' /* do $subref () */
{ $$ = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED,
prepend_elem(OP_LIST,
- scalar(newCVREF(0,scalar($2))), Nullop)); dep();
+ scalar(newCVREF(0,scalar($2))), (OP*)NULL)); dep();
TOKEN_GETMAD($1,$$,'o');
TOKEN_GETMAD($3,$$,'(');
TOKEN_GETMAD($4,$$,')');
@@ -1265,13 +1265,13 @@ myterm : '(' expr ')'
/* Basic list expressions */
listexpr: /* NULL */ %prec PREC_LOW
- { $$ = Nullop; }
+ { $$ = (OP*)NULL; }
| argexpr %prec PREC_LOW
{ $$ = $1; }
;
listexprcom: /* NULL */
- { $$ = Nullop; }
+ { $$ = (OP*)NULL; }
| expr
{ $$ = $1; }
| expr ','