Branch: Tag:

2018-05-26

2018-05-26 11:02:43 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Added F_FOREACH_VAL_LVAL.

This tree node type is identical to F_VAL_LVAL except
that it it used only as the CAR of F_FOREACH. This is
in preparation for delaying the resolving of auto for
foreach() to the tree optimizer pass.

228:    {    case F_COMMA_EXPR:    case F_VAL_LVAL: +  case F_FOREACH_VAL_LVAL:    case F_ARG_LIST:    a=count_args(CAR(n));    if(a==-1) return -1;
312:    int val;    while ((n->token == F_COMMA_EXPR) ||    (n->token == F_VAL_LVAL) || +  (n->token == F_FOREACH_VAL_LVAL) ||    (n->token == F_ARG_LIST)) {    if (CAR(n)) {    CAR(n)->parent = n;
2392: Inside #if defined(PIKE_DEBUG)
   }       case F_VAL_LVAL: +  case F_FOREACH_VAL_LVAL:    low_print_tree(_CAR(foo),0);    fputs(",&", stderr);    low_print_tree(_CDR(foo),0);
2874:    break;       case F_VAL_LVAL: +  case F_FOREACH_VAL_LVAL:    find_written_vars(CAR(n), p, 0);    find_written_vars(CDR(n), p, 1);    break;
3957:    break;       case F_FOREACH: -  if (!CAR(n) || (CAR(n)->token != F_VAL_LVAL)) { +  if (!CAR(n) || (CAR(n)->token != F_FOREACH_VAL_LVAL)) {    yyerror("foreach(): No expression to loop over.");    } else {    if (!CAAR(n) || pike_types_le(CAAR(n)->type, void_type_string)) {
4200:    OPT_RETURN|    OPT_FLAG_NODE)) &&    (CAR(n)->tree_info & OPT_TRY_OPTIMIZE) && -  CAR(n)->token != F_VAL_LVAL) +  CAR(n)->token != F_VAL_LVAL && +  CAR(n)->token != F_FOREACH_VAL_LVAL)    {    _CAR(n) = eval(CAR(n));    if(CAR(n)) CAR(n)->parent = n;