Branch: Tag:

1998-08-29

1998-08-29 22:15:18 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Improved some error messages.
index_node() now takes 3 arguments.

Rev: src/language.yacc:1.102
Rev: src/las.c:1.66
Rev: src/las.h:1.16

4:   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: las.c,v 1.65 1998/08/05 22:48:01 hubbe Exp $"); + RCSID("$Id: las.c,v 1.66 1998/08/29 22:15:17 grubba Exp $");      #include "language.h"   #include "interpret.h"
680:          - node *index_node(node *n, struct pike_string * id) + node *index_node(node *n, char *node_name, struct pike_string *id)   {    node *ret;    JMP_BUF tmp;
696:    pop_stack();    UNSET_ONERROR(tmp);    +  if (node_name) { +  my_yyerror("Couldn't index module '%s'.", node_name); +  } else {    yyerror("Couldn't index module."); -  +  }    push_int(0);    }else{    resolv_constant(n);    switch(sp[-1].type)    {    case T_INT: -  if(!num_parse_error) +  if(!num_parse_error) { +  if (node_name) { +  my_yyerror("Failed to index module '%s' (module doesn't exist?)", +  node_name); +  } else {    yyerror("Failed to index module (module doesn't exist?)"); -  +  } +  }    break;       case T_PROGRAM:    case T_FLOAT:    case T_STRING:    case T_ARRAY: -  +  if (node_name) { +  my_yyerror("Failed to index module '%s' (Not a module?)", +  node_name); +  } else {    yyerror("Failed to index module (Not a module?)"); -  +  }    pop_stack();    push_int(0);    break;
733:    !sp[-1].u.integer &&    sp[-1].subtype==NUMBER_UNDEFINED)    { -  my_yyerror("Index '%s' not present in module.",id->str); +  if (node_name) { +  my_yyerror("Index '%s' not present in module '%s'.", +  id->str, node_name); +  } else { +  my_yyerror("Index '%s' not present in module.", id->str);    } -  +  }    END_CYCLIC();    }    }