From c5c2ffee86c77004037a1cd751595a8f75859ab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Tue, 6 Jul 1999 18:02:38 -0700 Subject: [PATCH] made constant resolving much more lenient... Rev: src/las.c:1.82 --- src/las.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/las.c b/src/las.c index 4017ffcd32..2919c2ec25 100644 --- a/src/las.c +++ b/src/las.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: las.c,v 1.81 1999/06/03 01:39:35 hubbe Exp $"); +RCSID("$Id: las.c,v 1.82 1999/07/07 01:02:38 hubbe Exp $"); #include "language.h" #include "interpret.h" @@ -662,10 +662,32 @@ void resolv_constant(node *n) return; default: - yyerror("Expected constant, got something else"); + { + char fnord[1000]; + if(is_const(n)) + { + int args=eval_low(n); + if(args==1) return; + + if(args!=-1) + { + if(!args) + { + yyerror("Expected constant, got void expression"); + }else{ + yyerror("Possible internal error!!!"); + pop_n_elems(args-1); + return; + } + } + } + + sprintf(fnord,"Expected constant, got something else (%d)",n->token); + yyerror(fnord); push_int(0); return; } + } i=ID_FROM_INT(p, numid); -- GitLab