pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.124 1999/11/21 15:23:42 grubba Exp $"); + RCSID("$Id: las.c,v 1.125 1999/11/21 18:54:01 grubba Exp $");      #include "language.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"   #include "pike_types.h"
pike.git/src/las.c:1549:    low_describe_type(foo->type->str);    s=simple_free_buf();    fprintf(stderr, "(%s){",s);    free(s);    low_print_tree(_CAR(foo),0);    fprintf(stderr, "}");    break;    }       case F_COMMA_EXPR: +  low_print_tree(_CAR(foo),0); +  if(_CAR(foo) && _CDR(foo)) +  { +  if(_CAR(foo)->type == void_type_string && +  _CDR(foo)->type == void_type_string) +  fprintf(stderr, ";\n"); +  else +  fprintf(stderr, ",\n"); +  } +  low_print_tree(_CDR(foo),needlval); +  return; +     case F_ARG_LIST:    low_print_tree(_CAR(foo),0);    if(_CAR(foo) && _CDR(foo))    {    if(_CAR(foo)->type == void_type_string &&    _CDR(foo)->type == void_type_string)    fprintf(stderr, ";\n");    else    fputc(',', stderr);    }
pike.git/src/las.c:2168:    /* The expression gets the type from the variable. */    /* FIXME: Ought to strip non-applicable subtypes from the type. */    copy_shared_string(n->type, CAR(n)->type);    } else {    copy_shared_string(n->type, mixed_type_string);    }    break;       case F_RETURN:    if (!CAR(n) || (CAR(n)->type == void_type_string)) { -  yyerror("Returning a void expression."); +  yywarning("Returning a void expression."); +  if (!CAR(n)) { + #ifdef SHARED_NODES +  sub_node(n); + #endif /* SHARED_NODES */ +  _CAR(n) = mkintnode(0); +  copy_shared_string(n->type, CAR(n)->type); + #ifdef SHARED_NODES +  n->hash = hash_node(n); +  n->node_info |= OPT_DEFROSTED; +  add_node(n); + #endif /* SHARED_NODES */ +  break; +  }    } else if(compiler_frame &&    compiler_frame->current_return_type &&    !match_types(compiler_frame->current_return_type,CAR(n)->type) &&    !(    compiler_frame->current_return_type==void_type_string &&    CAR(n)->token == F_CONSTANT &&    IS_ZERO(& CAR(n)->u.sval)    )    )    {