pike.git
/
src
/
docode.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/docode.c:1200:
PUSH_CLEANUP_FRAME(do_pop_mark, 0); do_docode(CAR(n), 0); emit_apply_builtin("aggregate"); POP_AND_DONT_CLEANUP; emit0(F_ASSIGN); return 1; } { case F_ASSIGN_SELF:
-
/*
a
special
case,
we know
we
can
not
really
optimize.
-
car
:
softcast(
efuncall
(
function
,
args
(
2
)))
+
/*
in
assign
self
we know
this:
+
*
+
*
car
(n)
= lvalue
+
* cdr(n)=
softcast(
apply
(
efun
,
arglist
(
car(n
)
,one more arg
))
)
+
*
+
* The first argument of the arglist is equal to the lvalue.
+
*
+
* We only want to evaluate car(n) once.
*/
-
/* node *args=CAADR(n), *func = CAAAR(n); */
+
if( CDR(n)->token == F_AUTO_MAP_MARKER ) yyerror("[*] is not yet supported here\n"); return emit_ltosval_call_and_assign( CDR(n), CAAAR(n), CDAAR(n) ); case F_ASSIGN:
-
/* if assign self is 1 we know this:
-
car(n) = lvalue
-
cdr(n)= softcast(apply(efun, arglist(car(n),one more arg)))
-
-
We only want to evaluate car(n) once.
-
*/
+
if( CDR(n)->token == F_AUTO_MAP_MARKER ) { int depth = 0; node *lval = CDR(n); while( lval->token == F_AUTO_MAP_MARKER ) { lval = CAR(lval); depth++; } do_docode(lval,0); /* note: not lvalue */