rev 214 - in trunk: pr src
SVN User <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: mark
Date: 2004-03-30 14:01:08 -0500 (Tue, 30 Mar 2004)
New Revision: 214
Added:
trunk/pr/init.pr
Modified:
trunk/src/interp.c
Log:
Fixed use of ^__init__(), added init.pr test file
Added: trunk/pr/init.pr
===================================================================
--- trunk/pr/init.pr 2004-03-30 18:45:10 UTC (rev 213)
+++ trunk/pr/init.pr 2004-03-30 19:01:08 UTC (rev 214)
@@ -0,0 +1,22 @@
+
+print "Instantiating Base"
+Base = Object()
+with Base:
+ def .__init__():
+ print "__init__ of Base type:", .
+ return .
+
+print "Instantiating Derived"
+Derived = Base()
+with Derived:
+ def .__init__():
+ ^__init__()
+ print "__init__ of Derived type:", .
+ return .
+
+print "Instantiating y"
+y = Derived()
+
+print "Base:", Base
+print "Derived:", Derived
+print "y:", y
Modified: trunk/src/interp.c
===================================================================
--- trunk/src/interp.c 2004-03-30 18:45:10 UTC (rev 213)
+++ trunk/src/interp.c 2004-03-30 19:01:08 UTC (rev 214)
@@ -892,6 +892,11 @@
break;
case OP_CALL: {
fr_sp -= 2+(2*param);
+ if (has_proto(ist, fr_stack[fr_sp+1], OBJ(SUPER_PROTO))) {
+ obj_p proto_list_obj = proto_list(ist, fr_stack[fr_sp]); if (intrp_exobj) break;
+ fr_stack[fr_sp] = list_item(ist, proto_list_obj,1); del_unlock(proto_list_obj);
+ fr_stack[fr_sp+1] = fr_stack[fr_sp+1]->data.ptr;
+ }
if (!has_proto(ist, fr_stack[fr_sp+1], OBJ(SYMBOL_PROTO))) {
raise_exception(ist, OBJ(INTERNAL_EXC), "Indexed function call not supported yet");
break;