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.243 2001/03/03 17:51:50 grubba Exp $"); + RCSID("$Id: las.c,v 1.244 2001/03/11 14:19:49 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:3466:    if (!pike_types_le(CAAR(n)->type, iterator_type)) {    if (!match_types(CAAR(n)->type, iterator_type)) {    yytype_error("Bad argument 1 to foreach()", iterator_type,    CAAR(n)->type, 0);       /* No use checking the index and value types if    * the iterator type is bad.    */    free_type(iterator_type);    goto foreach_type_check_done; -  } else { +  } else if (lex.pragmas & ID_STRICT_TYPES) {    yytype_error("Iterator type mismatch in foreach()",    iterator_type, CAAR(n)->type, YYTE_IS_WARNING);    }    }    free_type(iterator_type);       push_type(T_MIXED);    push_type(T_VOID);    push_type(T_MANY);    push_finished_type(CAAR(n)->type);
pike.git/src/las.c:3501:    tFunc(tObj, tZero)));    index_type = check_call(foreach_call_type, index_fun_type, 0);    if (!index_type) {    /* Should not happen. */    yyerror("Bad iterator type for index in foreach().");    } else {    if (!pike_types_le(index_type, CADAR(n)->type)) {    if (!match_types(CADAR(n)->type, index_type)) {    yytype_error("Type mismatch for index in foreach().",    index_type, CADAR(n)->type, 0); -  } else { +  } else if (lex.pragmas & ID_STRICT_TYPES) {    yytype_error("Type mismatch for index in foreach().",    index_type, CADAR(n)->type, YYTE_IS_WARNING);    }    }    free_type(index_type);    }    free_type(index_fun_type);    }    if (CDDAR(n)) {    /* Check the value type */
pike.git/src/las.c:3531:    tFunc(tObj, tZero)));    value_type = check_call(foreach_call_type, value_fun_type, 0);    if (!value_type) {    /* Should not happen. */    yyerror("Bad iterator type for value in foreach().");    } else {    if (!pike_types_le(value_type, CDDAR(n)->type)) {    if (!match_types(CDDAR(n)->type, value_type)) {    yytype_error("Type mismatch for value in foreach().",    value_type, CDDAR(n)->type, 0); -  } else { +  } else if (lex.pragmas & ID_STRICT_TYPES) {    yytype_error("Type mismatch for value in foreach().",    value_type, CDDAR(n)->type, YYTE_IS_WARNING);    }    }    free_type(value_type);    }    free_type(value_fun_type);    }    free_type(foreach_call_type);    } else {