Branch: Tag:

2021-02-27

2021-02-27 16:32:23 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Added F_INITIALIZER node type.

This node type behaves identically to F_ASSIGN, but is only used
in the case where it is the initializer assignment in a local
variable declaration.

792:    case F_ASSIGN:    case F_MULTI_ASSIGN:    case F_ASSIGN_SELF: +  case F_INITIALIZE:    if ((!a || a->token == F_CONSTANT) &&    (Pike_compiler->compiler_pass == COMPILER_PASS_LAST)) {    yyerror("Illegal lvalue.");
994:    case F_MULTI_ASSIGN:    case F_ASSIGN:    case F_ASSIGN_SELF: +  case F_INITIALIZE:    res->node_info |= OPT_ASSIGNMENT;    if (a) {    res->tree_info |= a->tree_info;
2359:    break;       case F_ASSIGN: +  case F_INITIALIZE:    low_print_tree(_CAR(foo),1);    fputc('=', stderr);    low_print_tree(_CDR(foo),0);
2796:       case F_ASSIGN:    case F_ASSIGN_SELF: +  case F_INITIALIZE:    find_used_variables(CDR(n),p,noblock,0);    find_used_variables(CAR(n),p,noblock,1);    break;
2922:    case F_ASSIGN:    case F_ASSIGN_SELF:    case F_MULTI_ASSIGN: +  case F_INITIALIZE:    find_written_vars(CDR(n), p, 0);    find_written_vars(CAR(n), p, 1);    break;
3633:       case F_ASSIGN:    case F_ASSIGN_SELF: +  case F_INITIALIZE:    if (!CDR(n) || (CDR(n)->type == void_type_string)) {    yyerror("Assigning a void expression.");    copy_pike_type(n->type, void_type_string);