pike.git/
src/
las.c
Branch:
Tag:
Non-build tags
All tags
No tags
2007-12-17
2007-12-17 18:03:33 by Henrik Grubbström (Grubba) <grubba@grubba.org>
02f17a110c43e335a8cf3a0987c4d673928b10d8 (
23
lines) (+
22
/-
1
)
[
Show
|
Annotate
]
Branch:
7.9
Now knows about F_APPEND_ARRAY.
Rev: src/docode.c:1.191
Rev: src/las.c:1.399
2:
|| This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: las.c,v 1.
398
2007/12/
15
18:
50
:
51
grubba Exp $
+
|| $Id: las.c,v 1.
399
2007/12/
17
18:
03
:
33
grubba Exp $
*/ #include "global.h"
860:
res->node_info |= OPT_ASSIGNMENT; break;
+
case F_APPEND_ARRAY:
case F_ASSIGN: case F_MOD_EQ: case F_AND_EQ:
3308:
} break;
+
case F_APPEND_ARRAY:
+
if (!CAR(n) || (CAR(n)->type == void_type_string)) {
+
yyerror("Assigning a void expression.");
+
copy_pike_type(n->type, void_type_string);
+
} else if (!CDR(n)) {
+
copy_pike_type(n->type, CAR(n)->type);
+
} else {
+
struct pike_type *tmp;
+
/* Ensure that the type-fields are up to date. */
+
fix_type_field(CAR(n));
+
fix_type_field(CDR(n));
+
type_stack_mark();
+
push_finished_type(CDR(n)->type);
+
push_type(T_ARRAY);
+
n->type = and_pike_types(CAR(n)->type, tmp = pop_unfinished_type());
+
free_type(tmp);
+
}
+
break;
+
case F_ASSIGN: if (!CAR(n) || (CAR(n)->type == void_type_string)) { yyerror("Assigning a void expression.");