rev 305 - in trunk: pr src
SVN User <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: mark
Date: 2004-04-09 02:57:04 -0400 (Fri, 09 Apr 2004)
New Revision: 305
Modified:
trunk/pr/chained.pr
trunk/src/interp.c
Log:
fixed problem with two f() calls in one statement,
cleaned up chained.pr,
problem still remains: a<b<c evaluates b twice
Modified: trunk/pr/chained.pr
===================================================================
--- trunk/pr/chained.pr 2004-04-08 23:04:27 UTC (rev 304)
+++ trunk/pr/chained.pr 2004-04-09 06:57:04 UTC (rev 305)
@@ -21,14 +21,16 @@
print 1 >= 1 == 2 != 2 == 2 > 1 <= 1 <= 2
-print "\n\nThis should print 0 1 1 1 2 1 0 2 1 2 2 1\n"
-N=[0,0,0]
-def c(x,i):
- N[i] += 1
- print i, N[i],
- return x
+def f(i):
+ print i,
+ return i
+
+print "\n\nThis should print 0 1 1 2\n"
-c(1,0) < c(2,1) < c(3,2)
-c(1,0) > c(2,1) < c(3,2)
+f(0) < f(1) < f(2)
+print "\n\nThis should print 0 1\n"
+
+f(0) > f(1) < f(2)
+
Modified: trunk/src/interp.c
===================================================================
--- trunk/src/interp.c 2004-04-08 23:04:27 UTC (rev 304)
+++ trunk/src/interp.c 2004-04-09 06:57:04 UTC (rev 305)
@@ -851,7 +851,7 @@
} break;
case OP_OBJCALL: {
fr_sp -= 1+2*param;
- if ((func_obj = fr_stack[0])->data_type == OBJ_TYPE_FUNCPTR){
+ if ((func_obj = fr_stack[fr_sp])->data_type == OBJ_TYPE_FUNCPTR){
obj_p res;
clist_p plist = get_func_params(ist, func_obj, param*2, fr_stack+fr_sp+1);
pre_call_lock(frame->locals, plist); if (intrp_exobj) break;