pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*   || 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.381 2007/03/31 21:44:41 grubba Exp $ + || $Id: las.c,v 1.382 2007/04/01 18:26:34 grubba Exp $   */      #include "global.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"
pike.git/src/las.c:3507:       if (expected_t && got_t) {    yyexplain_nonmatching_types(expected_t, got_t, flags);    } else if (expected_t) {    struct pike_string *s = describe_type(expected_t);    if (flags & YYTE_IS_WARNING) {    yywarning("Expected: %s", s->str);    } else {    my_yyerror("Expected: %S", s);    } +  free_string(s);    } else if (got_t) {    struct pike_string *s = describe_type(got_t);    if (flags & YYTE_IS_WARNING) {    yywarning("Got : %s", s->str);    } else {    my_yyerror("Got : %S", s);    } -  +  free_string(s);    }   }      static struct pike_string *get_name_of_function(node *n)   {    struct pike_string *name = NULL;    if (!n) {    MAKE_CONST_STRING(name, "NULL");    return name;    }
pike.git/src/las.c:3813:    if (!pike_types_le(array_type, CAR(n)->type)) {    yytype_error("Bad argument to splice operator.",    array_type, CAR(n)->type, 0);    }    free_type(array_type);    }    /* FIXME: The type field of the splice operator is not yet utilized.    *    * It probably ought to be something similar to MANY(..., VOID).    */ -  copy_pike_type(n->type, mixed_type_string); +  n->type = index_type(CAR(n)->type, int_type_string, n);    break;       case F_AUTO_MAP_MARKER:    if (!CAR(n) || (CAR(n)->type == void_type_string)) {    yyerror("Indexing a void expression.");    /* The optimizer converts this to an expression returning 0. */    copy_pike_type(n->type, zero_type_string);    } else {    type_a=CAR(n)->type;    if(!match_types(type_a, array_type_string))