rev 681 - in trunk: pr/test src

SVN User <[email protected]> Wed, 30 Jun 2004 04:17:51 -0400
Newsgroups gmane.comp.lang.prothon.cvs
Message-ID <[email protected]>
Author: mark
Date: 2004-06-30 04:17:47 -0400 (Wed, 30 Jun 2004)
New Revision: 681

Modified:
   trunk/pr/test/test.pr
   trunk/src/console.c
   trunk/src/main.c
Log:
fixed import command in console

Modified: trunk/pr/test/test.pr
===================================================================
--- trunk/pr/test/test.pr	2004-06-30 06:57:00 UTC (rev 680)
+++ trunk/pr/test/test.pr	2004-06-30 08:17:47 UTC (rev 681)
@@ -1,15 +1,7 @@
 #!/usr/bin/env prothon
 
-for i in 5:
-	print i
-	
-a, b = (1,2)
-print a,b
+object x:
+	pass
 
-gen g():
-	for i in 3:
-		y = (2*i, 3*i)
-		yield y
-	
-for a, b in g():
-	print a,b
+x.attrs_.delItem_($eee)
+print .attrs_

Modified: trunk/src/console.c
===================================================================
--- trunk/src/console.c	2004-06-30 06:57:00 UTC (rev 680)
+++ trunk/src/console.c	2004-06-30 08:17:47 UTC (rev 681)
@@ -191,10 +191,12 @@
 	ist->in_console = TRUE;
 	new_self = new_object(ist, NULL);
 	if (!ist->frame) {
-		new_locals  = NEW_OBJ(NULL);
+		if (ist->module)
+			new_locals  = ist->module;
+		else
+			new_locals  = NEW_OBJ(NULL);
 		frame = create_frame(ist, new_self, NULL, NULL, new_locals, NULL, NULL, "console");
 	}
-
 	if ((home = getenv("HOME")) != NULL)
 		apr_snprintf(histfile, sizeof(histfile), "%s/%s", home, PROTHON_HISTORY);
 	else

Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c	2004-06-30 06:57:00 UTC (rev 680)
+++ trunk/src/main.c	2004-06-30 08:17:47 UTC (rev 681)
@@ -177,6 +177,8 @@
 
 	if (!main_threads_started)  {
 		ist->access = ACC_USER2;
+		if (!ist->module)
+			ist->module = NEW_OBJ(NULL);
 		console(ist);
 		ist->access = ACC_SYSTEM;
 	} else {
@@ -185,8 +187,9 @@
 			if (cmd_line_option_i_flg && (!main1_thread_ptr || !main1_thread_ptr->running)) {
 				ist->access = ACC_USER2;
 				if (main1_thread_ptr)
-					ist->frame = main1_thread_ptr->frame;
-				console(ist);
+					console(main1_thread_ptr->ist);
+				else
+					console(ist);
 				ist->access = ACC_SYSTEM;
 				cmd_line_option_i_flg = FALSE;
 			}
@@ -194,8 +197,9 @@
 		if (cmd_line_option_i_flg) {
 			ist->access = ACC_USER2;
 			if (main1_thread_ptr)
-				ist->frame = main1_thread_ptr->frame;
-			console(ist);
+				console(main1_thread_ptr->ist);
+			else
+				console(ist);
 			ist->access = ACC_SYSTEM;
 		}
 	}