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.237 2001/02/23 14:46:21 grubba Exp $"); + RCSID("$Id: las.c,v 1.238 2001/02/24 02:38:32 hubbe 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:3440:    n->type = get_type_of_svalue(& n->u.sval);    break;       case F_FOREACH:    if (!CAR(n) || (CAR(n)->token != F_VAL_LVAL)) {    yyerror("foreach(): No expression to loop over.");    } else {    if (!CAAR(n) || pike_types_le(CAAR(n)->type, void_type_string)) {    yyerror("foreach(): Looping over a void expression.");    } else { +  if(CDAR(n)->token && CDAR(n)->token == ':') +  { +  /* type checking for new style iterators goes here */ +  }else{    struct pike_type *array_zero;    MAKE_CONSTANT_SHARED_STRING(array_zero, tArr(tZero));       if (!pike_types_le(array_zero, CAAR(n)->type)) {    yyerror("Bad argument 1 to foreach().");    } else {    if ((lex.pragmas & ID_STRICT_TYPES) &&    !pike_types_le(CAAR(n)->type, array_type_string)) {    struct pike_string *t = describe_type(CAAR(n)->type);    yywarning("Argument 1 to foreach() is not always an array.");
pike.git/src/las.c:3474:    yytype_error("Variable type mismatch in foreach().",    value_type, CDAR(n)->type, YYTE_IS_WARNING);    }    }    free_type(value_type);    }    }    free_type(array_zero);    }    } +  }    copy_type(n->type, void_type_string);    break;       case F_SSCANF:    if (!CAR(n) || (CAR(n)->token != F_ARG_LIST) ||    !CAAR(n) || !CDAR(n)) {    yyerror("Too few arguments to sscanf().");    } else {    if (!pike_types_le(CAAR(n)->type, string_type_string)) {    if (!match_types(CAAR(n)->type, string_type_string)) {