rev 148 - in trunk: . src

SVN User <[email protected]>
Newsgroups gmane.comp.lang.prothon.cvs
Message-ID <[email protected]>
Author: mark
Date: 2004-03-27 02:01:43 -0500 (Sat, 27 Mar 2004)
New Revision: 148

Modified:
   trunk/src/argproc.c
   trunk/src/interp.c
   trunk/src/main.c
   trunk/status.txt
Log:
implemented -c cmd-line argument

Modified: trunk/src/argproc.c
===================================================================
--- trunk/src/argproc.c	2004-03-27 06:32:17 UTC (rev 147)
+++ trunk/src/argproc.c	2004-03-27 07:01:43 UTC (rev 148)
@@ -173,7 +173,6 @@
 				printf("      that you may interact with.\n");
 				printf("\n");
 				printf("   -c --code \"code to execute\"\n");
-				printf("      (Not implemented yet)\n");
 				printf("      Execute code in quotes before any code in files are run.  This option\n");
 				printf("      may co-exist with the main file execution.\n");
 				printf("\n");

Modified: trunk/src/interp.c
===================================================================
--- trunk/src/interp.c	2004-03-27 06:32:17 UTC (rev 147)
+++ trunk/src/interp.c	2004-03-27 07:01:43 UTC (rev 148)
@@ -1206,7 +1206,7 @@
 		strcat(name, "_execstr_code.txt");
 		dump_code(code, dump_name);   }
 #endif
-	if (*frame_p) {
+	if (frame_p && *frame_p) {
 		frame = *frame_p;
 		new_frame = new_exec_frame( ist, frame->self, frame->globals, 
 						frame->syn_locals, frame->dyn_locals, frame->locals, NULL, code );

Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c	2004-03-27 06:32:17 UTC (rev 147)
+++ trunk/src/main.c	2004-03-27 07:01:43 UTC (rev 148)
@@ -151,7 +151,7 @@
 }
 
 int main(int argc, char *argv[]) {
-	obj_p sys_argv_obj, main_argv_obj, threads;
+	obj_p sys_argv_obj, main_argv_obj, threads, code_str_obj;
 	isp ist;
 	apr_status_t aprerr;
 	char buf[1024];
@@ -192,6 +192,11 @@
 	sys_argv_obj = arginit(ist, argc, argv);
 	sysinit(ist, argv[0], sys_argv_obj);
 
+	if (code_str_obj = get_attr(ist, sys_argv_obj, sym(ist, "code"))) {
+		exec_string(ist, strch(code_str_obj), FALSE, NULL);
+		check_exceptions(ist);
+	}
+
 	main_argv_obj = get_attr(ist, sys_argv_obj, sym(ist, "argv"));
 	if (main_argv_obj && list_len(ist, main_argv_obj))
 		start_new_thread((apr_thread_start_t)main_thread, main_argv_obj);

Modified: trunk/status.txt
===================================================================
--- trunk/status.txt	2004-03-27 06:32:17 UTC (rev 147)
+++ trunk/status.txt	2004-03-27 07:01:43 UTC (rev 148)
@@ -6,8 +6,6 @@
 
 --- help() in interactive console()
 
---- go back to returning None on functions with no return
-
 --- cmd-line code options missing (-i, -c, -d)
 
 --- flesh out dlls, list.sort!(), dict stuff, string %, built-in funcs
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.