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.114 1999/11/18 22:15:33 grubba Exp $"); + RCSID("$Id: las.c,v 1.115 1999/11/18 22:17:46 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:1966:    struct pike_string *type_a,*type_b;       if(n->type) return; /* assume it is correct */       switch(n->token)    {    case F_LAND:    case F_LOR:    if (!CAR(n) || CAR(n)->type == void_type_string ||    !CDR(n) || CDR(n)->type == void_type_string) { -  yyerror("Conditional contains void expression.\n"); +  yyerror("Conditional contains void expression.");    copy_shared_string(n->type, mixed_type_string);    }    if(!match_types(CAR(n)->type,mixed_type_string)) -  yyerror("Bad conditional expression.\n"); +  yyerror("Bad conditional expression.");       if(!match_types(CDR(n)->type,mixed_type_string)) -  yyerror("Bad conditional expression.\n"); +  yyerror("Bad conditional expression.");       if(CAR(n)->type == CDR(n)->type)    {    copy_shared_string(n->type,CAR(n)->type);    }else{    /* FIXME: Shouldn't it be an or? */    copy_shared_string(n->type,mixed_type_string);    }    break;   
pike.git/src/las.c:2081:    break;    }    break;       default:    name="unknown function";    }       if(max_args < args)    { -  my_yyerror("Too many arguments to %s.\n",name); +  my_yyerror("Too many arguments to %s.",name);    }    else if(max_correct_args == args)    { -  my_yyerror("Too few arguments to %s.\n",name); +  my_yyerror("Too few arguments to %s.",name);    }else{    my_yyerror("Bad argument %d to %s.",    max_correct_args+1, name);    }    copy_shared_string(n->type, mixed_type_string);    }    free_string(s);    break;    }       case '?':    if (!CAR(n) || (CAR(n)->type == void_type_string)) { -  yyerror("Conditional expression is void.\n"); +  yyerror("Conditional expression is void.");    } else if(!match_types(CAR(n)->type,mixed_type_string)) -  yyerror("Bad conditional expression.\n"); +  yyerror("Bad conditional expression.");       if(!CADR(n) || !CDDR(n))    {    copy_shared_string(n->type,void_type_string);    return;    }       if(CADR(n)->type == CDDR(n)->type)    {    copy_shared_string(n->type,CADR(n)->type);    return;    }       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.\n"); +  yyerror("Returning a void expression.");    } 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)    )    )    { -  yyerror("Wrong return type.\n"); +  yyerror("Wrong return type.");    }       /* Fall through */       case F_INC_LOOP:    case F_DEC_LOOP:    case F_DEC_NEQ_LOOP:    case F_INC_NEQ_LOOP:    case F_CASE:    case F_CONTINUE:    case F_BREAK:    case F_DEFAULT:    copy_shared_string(n->type,void_type_string);    break;       case F_DO:    if (!CDR(n) || (CDR(n)->type == void_type_string)) { -  yyerror("do - while(): Conditional expression is void.\n"); +  yyerror("do - while(): Conditional expression is void.");    } else if(!match_types(CDR(n)->type,mixed_type_string)) -  yyerror("Bad conditional expression do - while().\n"); +  yyerror("Bad conditional expression do - while().");    copy_shared_string(n->type,void_type_string);    break;       case F_FOR:    if (!CAR(n) || (CAR(n)->type == void_type_string)) { -  yyerror("for(): Conditional expression is void.\n"); +  yyerror("for(): Conditional expression is void.");    } else if(!match_types(CAR(n)->type,mixed_type_string)) -  yyerror("Bad conditional expression for().\n"); +  yyerror("Bad conditional expression for().");    copy_shared_string(n->type,void_type_string);    break;       case F_SWITCH:    if (!CAR(n) || (CAR(n)->type == void_type_string)) { -  yyerror("switch(): Conditional expression is void.\n"); +  yyerror("switch(): Conditional expression is void.");    } else if(!match_types(CAR(n)->type,mixed_type_string)) -  yyerror("Bad switch expression.\n"); +  yyerror("Bad switch expression.");    copy_shared_string(n->type,void_type_string);    break;       case F_CONSTANT:    n->type = get_type_of_svalue(& n->u.sval);    break;       case F_COMMA_EXPR:    case F_ARG_LIST:    if(!CAR(n) || CAR(n)->type==void_type_string)