rev 295 - in trunk: pr src

SVN User <[email protected]>
Newsgroups gmane.comp.lang.prothon.cvs
Message-ID <[email protected]>
Author: mark
Date: 2004-04-06 14:33:17 -0400 (Tue, 06 Apr 2004)
New Revision: 295

Modified:
   trunk/pr/meow.pr
   trunk/src/interp.c
   trunk/src/parser_routines.c
Log:
implemented new directed delegation scheme 
(Mammal.describe)()

Modified: trunk/pr/meow.pr
===================================================================
--- trunk/pr/meow.pr	2004-04-06 17:25:19 UTC (rev 294)
+++ trunk/pr/meow.pr	2004-04-06 18:33:17 UTC (rev 295)
@@ -12,7 +12,7 @@
 with Cat:
      def .describe():
           print "I am a cat."
-          ^describe()         #  <--  super call
+          (Mammal.describe)()         #  <--  super call
      def .make_noise():
        print "I go meow."
 

Modified: trunk/src/interp.c
===================================================================
--- trunk/src/interp.c	2004-04-06 17:25:19 UTC (rev 294)
+++ trunk/src/interp.c	2004-04-06 18:33:17 UTC (rev 295)
@@ -854,7 +854,7 @@
 					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;
 					res = ((pr_func*)(func_obj->data.ptr))
-								(ist, frame->locals, 
+								(ist, frame->self, 
 								(plist ? clist_len(plist) : 0), 
 								(plist ? (obj_p*)plist->items : NULL),
 								frame->locals);
@@ -867,7 +867,7 @@
 					if (intrp_exobj) break;
 					new_locals = new_object(ist, NULL);
 					new_frame = new_exec_frame(	ist, 
-												frame->globals,		    // self
+												frame->self,		    // self
 												NULL, NULL,			
 												frame->locals,		    // dyn_locals,
 												new_locals,				// locals,

Modified: trunk/src/parser_routines.c
===================================================================
--- trunk/src/parser_routines.c	2004-04-06 17:25:19 UTC (rev 294)
+++ trunk/src/parser_routines.c	2004-04-06 18:33:17 UTC (rev 295)
@@ -444,12 +444,13 @@
 	int llen = clist_len(parms);
 	for(i=0; i < llen; i++)
 		calc_code(clist_item(parms,i), &len, &stack_depth, &max_stack_depth);
-	res = new_code(param, len+1, stack_depth, max_stack_depth, 0);
+	res = new_code(param, len+2, stack_depth, max_stack_depth, 0);
 	add_code_to(attr_ref, res, &k);
+	res->code_data[k++].bytecode.opcode = OP_DEREF;
 	for(i=0; i < llen; i++)
 		add_code_to(clist_item(parms,i), res, &k);
-	res->code_data[k].bytecode.opcode  = OP_CALL;
-	res->code_data[k++].bytecode.param = clist_len(parms);
+	res->code_data[k  ].bytecode.opcode = OP_OBJCALL;
+	res->code_data[k++].bytecode.param  = clist_len(parms);
 	res->stack_depth -= 1+(2*llen);
 	assert(k==res->len);
 	return debug_retrn(__LINE__, res);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.