Ejemplo n.º 1
0
OP *
Perl_scalarseq(pTHX_ OP *o)
{
    dVAR;
    if (o) {
	const OPCODE type = o->op_type;

	if (type == OP_LINESEQ || type == OP_SCOPE ||
	    type == OP_LEAVE || type == OP_LEAVETRY)
	{
            OP *kid;
	    for (kid = cLISTOPo->op_first; kid; kid = kid->op_sibling) {
		if (kid->op_sibling) {
		    scalarvoid(kid);
		}
	    }
	    PL_curcop = &PL_compiling;
	}
	o->op_flags &= ~OPf_PARENS;
	if (PL_hints & HINT_BLOCK_SCOPE)
	    o->op_flags |= OPf_PARENS;
    }
    else
	o = newOP(OP_STUB, 0, NULL);
    return o;
}
Ejemplo n.º 2
0
OP * clone_op(pTHX_
    const OP * const o,
    const unsigned int paramcount)
{
    OP * clone = NULL;

    if (o->op_type == OP_LEAVESUB)
        return clone_op(cUNOPo->op_first, paramcount);
    else if (o->op_flags & OPf_KIDS) {
        OP *kid = cUNOPo->op_first;
        OP *first = NULL;
        OP *last = NULL;
        do {
            OP * child = clone_op(kid, paramcount);
            if (!child) continue;
            clone = op_append_elem(o->op_type, clone, child);
        } while (kid = kid->op_sibling);
        return clone;
    } else switch (o->op_type) {
        case OP_CONST:
            return newSVOP(o->op_type, 0, cSVOPo_sv);
        case OP_PUSHMARK:
            return newOP(o->op_type, 0);
        case OP_NEXTSTATE:
            return newSTATEOP((U8)o->op_flags, NULL, NULL);
        case OP_NULL:
            return NULL;
        default:
            croak("Unsupported op type: %s", PL_op_name[o->op_type]);
    }
}
Ejemplo n.º 3
0
void addObject(gameMap_t * self,sf::RenderWindow & window, int type,int X, int Y){

    if(self->cell[X][Y].unit!=NULL||self->cell[X][Y].object!=NULL||self->cell[X][Y].obj_un_null==1){
        return;
    }

 switch(type){
  case 0:
    self->cell[X][Y].object = newOP();
    self->cell[X][Y].obj_un_null=1;
    break;


 }
}