From 1470d8abcc562566c5c42e36ad3d5bc3a4ad0ec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Thu, 27 Feb 1997 02:39:42 -0800 Subject: [PATCH] better error messages Rev: src/las.c:1.24 --- src/las.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/las.c b/src/las.c index d091e616c7..1c3b86a39d 100644 --- a/src/las.c +++ b/src/las.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: las.c,v 1.23 1997/02/27 10:34:46 hubbe Exp $"); +RCSID("$Id: las.c,v 1.24 1997/02/27 10:39:42 hubbe Exp $"); #include "language.h" #include "interpret.h" @@ -497,10 +497,20 @@ node *index_node(node *n, struct pike_string * id) push_int(0); }else{ resolv_constant(n); - if(sp[-1].type==T_INT) + switch(sp[-1].type) { + case T_INT: yyerror("Failed to index module (module doesn't exist?)"); - }else{ + break; + + case T_PROGRAM: + case T_FLOAT: + case T_STRING: + case T_ARRAY: + yyerror("Failed to index module (Not a module?)"); + break; + + default: push_string(id); reference_shared_string(id); f_index(2); -- GitLab