rev 267 - in trunk: . include/prothon pr src
SVN User <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: mark
Date: 2004-04-03 18:39:50 -0500 (Sat, 03 Apr 2004)
New Revision: 267
Modified:
trunk/STATUS.txt
trunk/include/prothon/prothon.h
trunk/pr/meow.pr
trunk/pr/test.pr
trunk/src/interp.c
trunk/src/prothon.y
Log:
changed tab/space scope to block instead of file,
fixed problem in obj() calling
Modified: trunk/STATUS.txt
===================================================================
--- trunk/STATUS.txt 2004-04-03 06:15:20 UTC (rev 266)
+++ trunk/STATUS.txt 2004-04-03 23:39:50 UTC (rev 267)
@@ -56,6 +56,8 @@
----------------------- TO-DO (highest priority first) ------------------------
+--- zip version of description
+
--- add list comprehension
--- add Object.clone() method
Modified: trunk/include/prothon/prothon.h
===================================================================
--- trunk/include/prothon/prothon.h 2004-04-03 06:15:20 UTC (rev 266)
+++ trunk/include/prothon/prothon.h 2004-04-03 23:39:50 UTC (rev 267)
@@ -90,8 +90,8 @@
//#define DEBUG_THREADS
//#define DEBUG_MEM_MGR
//#define TRACE_PARSER
-//#define TRACE_INTERPRETER
-//#define DUMP_MODULE_CODE
+#define TRACE_INTERPRETER
+#define DUMP_MODULE_CODE
//#define DUMP_OBJECTS_AT_END
//************************* BASIC TYPE DEFINITIONS ********************************
Modified: trunk/pr/meow.pr
===================================================================
--- trunk/pr/meow.pr 2004-04-03 06:15:20 UTC (rev 266)
+++ trunk/pr/meow.pr 2004-04-03 23:39:50 UTC (rev 267)
@@ -14,8 +14,7 @@
print "I am a cat."
^describe() # <-- super call
def .make_noise():
- print "I go meow.",
- "loudly!!!"
+ print "I go meow."
c = Cat()
c.describe()
Modified: trunk/pr/test.pr
===================================================================
--- trunk/pr/test.pr 2004-04-03 06:15:20 UTC (rev 266)
+++ trunk/pr/test.pr 2004-04-03 23:39:50 UTC (rev 267)
@@ -1,7 +1,15 @@
#!/usr/local/bin/prothon
-def x():
- print 2
- ,44
-
-x()
+def outer():
+ print 'outer',
+ 'outer2'
+ def x():
+ print 2, (5+
+12)
+ return x
+
+def block2():
+ print 'block2'
+
+outer()()
+block2()
Modified: trunk/src/interp.c
===================================================================
--- trunk/src/interp.c 2004-04-03 06:15:20 UTC (rev 266)
+++ trunk/src/interp.c 2004-04-03 23:39:50 UTC (rev 267)
@@ -848,7 +848,7 @@
switch_frame = new_frame;
} break;
case OP_OBJCALL: {
- fr_sp -= 2*param;
+ fr_sp -= 1+2*param;
if ((func_obj = fr_stack[0])->data_type == OBJ_TYPE_FUNCPTR){
obj_p res;
clist_p plist = get_func_params(ist, func_obj, param*2, fr_stack+fr_sp+1);
@@ -1528,6 +1528,8 @@
break;
case OP_WITH: fprintf(fout,"%4d %20s(%4d) %s", pc, "OP_WITH", param, codedata(str, code, op, param, pc));
break;
+ case OP_OBJCALL: fprintf(fout,"%4d %20s(%4d) %s", pc, "OP_OBJCALL", param, codedata(str, code, op, param, pc));
+ break;
case OP_CALL: fprintf(fout,"%4d %20s(%4d) %s", pc, "OP_CALL", param, codedata(str, code, op, param, pc));
break;
case OP_ASSIGN: fprintf(fout,"%4d %20s(%4d) %s", pc, "OP_ASSIGN", param, codedata(str, code, op, param, pc));
Modified: trunk/src/prothon.y
===================================================================
--- trunk/src/prothon.y 2004-04-03 06:15:20 UTC (rev 266)
+++ trunk/src/prothon.y 2004-04-03 23:39:50 UTC (rev 267)
@@ -780,6 +780,7 @@
state->indents_needed = indent_cnt - state->old_tab_count;
state->old_tab_count = indent_cnt;
while (clist_len(state->indent_stack) > indent_cnt) clist_pop(state->indent_stack);
+ if (!indent_cnt) state->indent_char = 0;
return EOL;
}
break;