[macruby-changes] [4251] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Fri Jun 18 22:15:39 PDT 2010


Revision: 4251
          http://trac.macosforge.org/projects/ruby/changeset/4251
Author:   lsansonetti at apple.com
Date:     2010-06-18 22:15:35 -0700 (Fri, 18 Jun 2010)
Log Message:
-----------
trim the parser and command-line parsing from static

Modified Paths:
--------------
    MacRuby/trunk/eval.c
    MacRuby/trunk/load.c
    MacRuby/trunk/parse.y
    MacRuby/trunk/ruby.c
    MacRuby/trunk/symbol.c
    MacRuby/trunk/vm.cpp
    MacRuby/trunk/vm_eval.c

Modified: MacRuby/trunk/eval.c
===================================================================
--- MacRuby/trunk/eval.c	2010-06-19 02:12:48 UTC (rev 4250)
+++ MacRuby/trunk/eval.c	2010-06-19 05:15:35 UTC (rev 4251)
@@ -68,7 +68,12 @@
 void *
 ruby_options(int argc, char **argv)
 {
+#if MACRUBY_STATIC
+    printf("command-line options are not supported in MacRuby static\n");
+    abort();
+#else
     return ruby_process_options(argc, argv);
+#endif
 }
 
 static void
@@ -193,6 +198,7 @@
     return FALSE;
 }
 
+#if !defined(MACRUBY_STATIC)
 int
 ruby_run_node(void *n)
 {
@@ -205,6 +211,7 @@
     rb_vm_run(RSTRING_PTR(rb_progname), (NODE *)n, NULL, false);
     return ruby_cleanup(0);
 }
+#endif
 
 /*
  *  call-seq:

Modified: MacRuby/trunk/load.c
===================================================================
--- MacRuby/trunk/load.c	2010-06-19 02:12:48 UTC (rev 4250)
+++ MacRuby/trunk/load.c	2010-06-19 05:15:35 UTC (rev 4251)
@@ -52,11 +52,14 @@
     rb_ary_push(get_loaded_features(), feature);
 }
 
+#if !defined(MACRUBY_STATIC)
 static void
-rb_remove_feature(VALUE feature)
+load_failed(VALUE fname)
 {
-    rb_ary_delete(get_loaded_features(), feature);
+    rb_raise(rb_eLoadError, "no such file to load -- %s",
+	    RSTRING_PTR(fname));
 }
+#endif
 
 void
 rb_provide(const char *feature)
@@ -64,16 +67,12 @@
     rb_provide_feature(rb_str_new2(feature));
 }
 
-static void
-load_failed(VALUE fname)
-{
-    rb_raise(rb_eLoadError, "no such file to load -- %s",
-	    RSTRING_PTR(fname));
-}
-
 void
 rb_load(VALUE fname, int wrap)
 {
+#if MACRUBY_STATIC
+    rb_raise(rb_eRuntimeError, "#load is not supported in MacRuby static");
+#else
     // TODO honor wrap
 
     // Locate file.
@@ -95,6 +94,7 @@
     Class old_klass = rb_vm_set_current_class(NULL);
     rb_vm_run(fname_str, node, NULL, false);
     rb_vm_set_current_class(old_klass);
+#endif
 }
 
 /*
@@ -155,6 +155,7 @@
     return rb_f_require(obj, fname);
 }
 
+#if !defined(MACRUBY_STATIC)
 #define TYPE_RB		0x1
 #define TYPE_RBO	0x2
 #define TYPE_BUNDLE	0x3
@@ -251,6 +252,12 @@
     return Qnil;
 }
 
+static void
+rb_remove_feature(VALUE feature)
+{
+    rb_ary_delete(get_loaded_features(), feature);
+}
+
 static VALUE
 load_rescue(VALUE path, VALUE exc)
 {
@@ -258,6 +265,7 @@
     rb_exc_raise(exc);
     return Qnil;
 }
+#endif
 
 VALUE
 rb_require_safe(VALUE fname, int safe)
@@ -270,6 +278,9 @@
 	return Qtrue;
     }
 
+#if MACRUBY_STATIC
+    rb_raise(rb_eRuntimeError, "#require is not supported in MacRuby static");
+#else
     VALUE result = Qnil;
     VALUE path;
     int type = 0;
@@ -307,6 +318,7 @@
     }
 
     return result;
+#endif
 }
 
 VALUE

Modified: MacRuby/trunk/parse.y
===================================================================
--- MacRuby/trunk/parse.y	2010-06-19 02:12:48 UTC (rev 4250)
+++ MacRuby/trunk/parse.y	2010-06-19 05:15:35 UTC (rev 4251)
@@ -9304,50 +9304,6 @@
 	    return 0;
     }
 }
-
-int
-rb_is_const_id(ID id)
-{
-    if (is_const_id(id)) return Qtrue;
-    return Qfalse;
-}
-
-int
-rb_is_class_id(ID id)
-{
-    if (is_class_id(id)) return Qtrue;
-    return Qfalse;
-}
-
-int
-rb_is_instance_id(ID id)
-{
-    if (is_instance_id(id)) return Qtrue;
-    return Qfalse;
-}
-
-int
-rb_is_local_id(ID id)
-{
-    if (is_local_id(id)) return Qtrue;
-    return Qfalse;
-}
-
-int
-rb_is_junk_id(ID id)
-{
-    if (is_junk_id(id)) return Qtrue;
-    return Qfalse;
-}
-
-ID
-rb_id_attrset(ID id)
-{
-    id &= ~ID_SCOPE_MASK;
-    id |= ID_ATTRSET;
-    return id;
-}
-
 #endif /* !RIPPER */
 
 static void

Modified: MacRuby/trunk/ruby.c
===================================================================
--- MacRuby/trunk/ruby.c	2010-06-19 02:12:48 UTC (rev 4250)
+++ MacRuby/trunk/ruby.c	2010-06-19 05:15:35 UTC (rev 4251)
@@ -36,6 +36,24 @@
 VALUE ruby_debug_socket_path = Qfalse;
 VALUE ruby_aot_compile = Qfalse;
 VALUE ruby_aot_init_func = Qfalse;
+VALUE rb_progname = Qnil;
+
+static int uid, euid, gid, egid;
+
+static void
+init_ids(void)
+{
+    uid = (int)getuid();
+    euid = (int)geteuid();
+    gid = (int)getgid();
+    egid = (int)getegid();
+    if (uid && (euid != uid || egid != gid)) {
+	rb_set_safe_level(1);
+    }
+}
+
+#if !defined(MACRUBY_STATIC)
+
 VALUE rb_parser_get_yydebug(VALUE);
 VALUE rb_parser_set_yydebug(VALUE, VALUE);
 
@@ -201,71 +219,6 @@
     ruby_push_include(path, expand_include_path);
 }
 
-void
-ruby_init_loadpath(void)
-{
-    VALUE load_path;
-#if defined LOAD_RELATIVE
-    char libpath[MAXPATHLEN + 1];
-    char *p;
-    int rest;
-
-    libpath[sizeof(libpath) - 1] = '\0';
-    p = strrchr(libpath, '/');
-    if (p) {
-	*p = 0;
-	if (p - libpath > 3 && !STRCASECMP(p - 4, "/bin")) {
-	    p -= 4;
-	    *p = 0;
-	}
-    }
-    else {
-	strcpy(libpath, ".");
-	p = libpath + 1;
-    }
-
-    rest = sizeof(libpath) - 1 - (p - libpath);
-
-#define RUBY_RELATIVE(path) (strncpy(p, (path), rest), libpath)
-#else
-#define RUBY_RELATIVE(path) (path)
-#endif
-#define incpush(path) rb_ary_push(load_path, rubylib_mangled_path2(path))
-    load_path = rb_vm_load_path();
-
-    if (rb_safe_level() == 0) {
-	ruby_incpush(getenv("RUBYLIB"));
-    }
-
-#ifdef RUBY_SEARCH_PATH
-    incpush(RUBY_RELATIVE(RUBY_SEARCH_PATH));
-#endif
-
-    incpush(RUBY_RELATIVE(RUBY_SITE_LIB2));
-#ifdef RUBY_SITE_THIN_ARCHLIB
-    incpush(RUBY_RELATIVE(RUBY_SITE_THIN_ARCHLIB));
-#endif
-    incpush(RUBY_RELATIVE(RUBY_SITE_ARCHLIB));
-    incpush(RUBY_RELATIVE(RUBY_SITE_LIB));
-
-    incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB2));
-#ifdef RUBY_VENDOR_THIN_ARCHLIB
-    incpush(RUBY_RELATIVE(RUBY_VENDOR_THIN_ARCHLIB));
-#endif
-    incpush(RUBY_RELATIVE(RUBY_VENDOR_ARCHLIB));
-    incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB));
-
-    incpush(RUBY_RELATIVE(RUBY_LIB));
-#ifdef RUBY_THIN_ARCHLIB
-    incpush(RUBY_RELATIVE(RUBY_THIN_ARCHLIB));
-#endif
-    incpush(RUBY_RELATIVE(RUBY_ARCHLIB));
-
-    if (rb_safe_level() == 0) {
-	incpush(".");
-    }
-}
-
 static CFMutableArrayRef req_list = NULL;
 
 static void
@@ -813,12 +766,7 @@
 static void
 ruby_init_gems(int enable)
 {
-#if 0 // TODO
-    if (enable) {
-	rb_define_module("Gem");
-    }
-    Init_prelude();
-#endif
+    // TODO
 }
 
 static rb_encoding *
@@ -832,7 +780,6 @@
     return enc;
 }
 
-VALUE rb_progname = Qnil;
 VALUE rb_argv0;
 
 static rb_encoding *src_encoding;
@@ -1017,22 +964,7 @@
 	tree = rb_parser_while_loop(parser, tree, opt->do_line, opt->do_split);
     }
 
-#if 1
     return (VALUE)tree;
-#else
-    VALUE iseq;
-
-    iseq = rb_iseq_new(tree, opt->script_name);
-
-    if (opt->dump & DUMP_BIT(insns)) {
-	// TODO 
-	//rb_io_write(rb_stdout, ruby_iseq_disasm(iseq));
-	rb_io_flush(rb_stdout);
-	return Qtrue;
-    }
-
-    return iseq;
-#endif
 }
 
 static NODE *
@@ -1237,81 +1169,6 @@
 #endif
 
 static void
-set_arg0(VALUE val, ID id)
-{
-    const char *s;
-    long i;
-
-    if (origarg.argv == 0)
-	rb_raise(rb_eRuntimeError, "$0 not initialized");
-    StringValue(val);
-    s = RSTRING_PTR(val);
-    i = RSTRING_LEN(val);
-#if defined(PSTAT_SETCMD)
-    if (i > PST_CLEN) {
-	union pstun un;
-	char buf[PST_CLEN + 1];	/* PST_CLEN is 64 (HP-UX 11.23) */
-	strncpy(buf, s, PST_CLEN);
-	buf[PST_CLEN] = '\0';
-	un.pst_command = buf;
-	pstat(PSTAT_SETCMD, un, PST_CLEN, 0, 0);
-    }
-    else {
-	union pstun un;
-	un.pst_command = s;
-	pstat(PSTAT_SETCMD, un, i, 0, 0);
-    }
-#elif defined(HAVE_SETPROCTITLE)
-    setproctitle("%.*s", (int)i, s);
-#else
-
-    if (i >= origarg.len) {
-	i = origarg.len;
-    }
-
-    memcpy(origarg.argv[0], s, i);
-
-    {
-	int j;
-	char *t = origarg.argv[0] + i;
-	*t = '\0';
-
-	if (i + 1 < origarg.len) memset(t + 1, ' ', origarg.len - i - 1);
-	for (j = 1; j < origarg.argc; j++) {
-	    origarg.argv[j] = t;
-	}
-    }
-#endif
-    GC_RELEASE(rb_progname);
-    rb_progname = rb_tainted_str_new(s, i);
-    GC_RETAIN(rb_progname);
-}
-
-void
-ruby_script(const char *name)
-{
-    if (name != NULL) {
-	GC_RELEASE(rb_progname);
-	rb_progname = rb_tainted_str_new2(name);
-	GC_RETAIN(rb_progname);
-    }
-}
-
-static int uid, euid, gid, egid;
-
-static void
-init_ids(void)
-{
-    uid = (int)getuid();
-    euid = (int)geteuid();
-    gid = (int)getgid();
-    egid = (int)getegid();
-    if (uid && (euid != uid || egid != gid)) {
-	rb_set_safe_level(1);
-    }
-}
-
-static void
 forbid_setid(const char *s)
 {
     if (euid != uid) {
@@ -1325,69 +1182,7 @@
     }
 }
 
-static void
-verbose_setter(VALUE val, ID id, VALUE *variable)
-{
-    ruby_verbose = RTEST(val) ? Qtrue : val;
-}
-
 static VALUE
-opt_W_getter(VALUE val, ID id)
-{
-    if (ruby_verbose == Qnil) {
-	return INT2FIX(0);
-    }
-    if (ruby_verbose == Qfalse) {
-	return INT2FIX(1);
-    }
-    if (ruby_verbose == Qtrue) {
-	return INT2FIX(2);
-    }
-    return Qnil;		/* not reached */
-}
-
-void
-ruby_prog_init(void)
-{
-    init_ids();
-
-    rb_define_hooked_variable("$VERBOSE", &ruby_verbose, 0, verbose_setter);
-    rb_define_hooked_variable("$-v", &ruby_verbose, 0, verbose_setter);
-    rb_define_hooked_variable("$-w", &ruby_verbose, 0, verbose_setter);
-    rb_define_virtual_variable("$-W", opt_W_getter, 0);
-    rb_define_variable("$DEBUG", &ruby_debug);
-    rb_define_variable("$-d", &ruby_debug);
-
-    rb_define_hooked_variable("$0", &rb_progname, 0, set_arg0);
-    rb_define_hooked_variable("$PROGRAM_NAME", &rb_progname, 0, set_arg0);
-
-    rb_define_global_const("ARGV", rb_argv);
-
-    rb_vm_set_running(true);
-}
-
-void
-ruby_set_argv(int argc, char **argv)
-{
-    int i;
-    VALUE av = rb_argv;
-
-#if defined(USE_DLN_A_OUT)
-    if (origarg.argv)
-	dln_argv0 = origarg.argv[0];
-    else
-	dln_argv0 = argv[0];
-#endif
-    rb_ary_clear(av);
-    for (i = 0; i < argc; i++) {
-	VALUE arg = rb_tainted_str_new2(argv[i]);
-
-	OBJ_FREEZE(arg);
-	rb_ary_push(av, arg);
-    }
-}
-
-static VALUE
 false_value(void)
 {
     return Qfalse;
@@ -1433,6 +1228,8 @@
     return tree;
 }
 
+#endif // !MACRUBY_STATIC
+
 void
 ruby_sysinit(int *argc, char ***argv)
 {
@@ -1453,13 +1250,203 @@
     v2[n] = 0;
     *argv = v2;
 
+#if !defined(MACRUBY_STATIC)
     origarg.argc = *argc;
     origarg.argv = *argv;
 
-#if !defined(PSTAT_SETCMD) && !defined(HAVE_SETPROCTITLE)
+# if !defined(PSTAT_SETCMD) && !defined(HAVE_SETPROCTITLE)
     origarg.len = get_arglen(origarg.argc, origarg.argv);
+# endif
 #endif
-#if defined(USE_DLN_A_OUT)
-    dln_argv0 = origarg.argv[0];
+}
+
+void
+ruby_init_loadpath(void)
+{
+#if !defined(MACRUBY_STATIC)
+    VALUE load_path;
+#if defined LOAD_RELATIVE
+    char libpath[MAXPATHLEN + 1];
+    char *p;
+    int rest;
+
+    libpath[sizeof(libpath) - 1] = '\0';
+    p = strrchr(libpath, '/');
+    if (p) {
+	*p = 0;
+	if (p - libpath > 3 && !STRCASECMP(p - 4, "/bin")) {
+	    p -= 4;
+	    *p = 0;
+	}
+    }
+    else {
+	strcpy(libpath, ".");
+	p = libpath + 1;
+    }
+
+    rest = sizeof(libpath) - 1 - (p - libpath);
+
+#define RUBY_RELATIVE(path) (strncpy(p, (path), rest), libpath)
+#else
+#define RUBY_RELATIVE(path) (path)
 #endif
+#define incpush(path) rb_ary_push(load_path, rubylib_mangled_path2(path))
+    load_path = rb_vm_load_path();
+
+    if (rb_safe_level() == 0) {
+	ruby_incpush(getenv("RUBYLIB"));
+    }
+
+#ifdef RUBY_SEARCH_PATH
+    incpush(RUBY_RELATIVE(RUBY_SEARCH_PATH));
+#endif
+
+    incpush(RUBY_RELATIVE(RUBY_SITE_LIB2));
+#ifdef RUBY_SITE_THIN_ARCHLIB
+    incpush(RUBY_RELATIVE(RUBY_SITE_THIN_ARCHLIB));
+#endif
+    incpush(RUBY_RELATIVE(RUBY_SITE_ARCHLIB));
+    incpush(RUBY_RELATIVE(RUBY_SITE_LIB));
+
+    incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB2));
+#ifdef RUBY_VENDOR_THIN_ARCHLIB
+    incpush(RUBY_RELATIVE(RUBY_VENDOR_THIN_ARCHLIB));
+#endif
+    incpush(RUBY_RELATIVE(RUBY_VENDOR_ARCHLIB));
+    incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB));
+
+    incpush(RUBY_RELATIVE(RUBY_LIB));
+#ifdef RUBY_THIN_ARCHLIB
+    incpush(RUBY_RELATIVE(RUBY_THIN_ARCHLIB));
+#endif
+    incpush(RUBY_RELATIVE(RUBY_ARCHLIB));
+
+    if (rb_safe_level() == 0) {
+	incpush(".");
+    }
+#endif // !MACRUBY_STATIC
 }
+
+void
+ruby_set_argv(int argc, char **argv)
+{
+    int i;
+    VALUE av = rb_argv;
+
+    rb_ary_clear(av);
+    for (i = 0; i < argc; i++) {
+	VALUE arg = rb_tainted_str_new2(argv[i]);
+
+	OBJ_FREEZE(arg);
+	rb_ary_push(av, arg);
+    }
+}
+
+void
+ruby_script(const char *name)
+{
+    if (name != NULL) {
+	GC_RELEASE(rb_progname);
+	rb_progname = rb_tainted_str_new2(name);
+	GC_RETAIN(rb_progname);
+    }
+}
+
+static void
+verbose_setter(VALUE val, ID id, VALUE *variable)
+{
+    ruby_verbose = RTEST(val) ? Qtrue : val;
+}
+
+static VALUE
+opt_W_getter(VALUE val, ID id)
+{
+    if (ruby_verbose == Qnil) {
+	return INT2FIX(0);
+    }
+    if (ruby_verbose == Qfalse) {
+	return INT2FIX(1);
+    }
+    if (ruby_verbose == Qtrue) {
+	return INT2FIX(2);
+    }
+    return Qnil; // not reached
+}
+
+static void
+set_arg0(VALUE val, ID id)
+{
+#if MACRUBY_STATIC
+    rb_raise(rb_eRuntimeError,
+	    "changing program name is not supported in MacRuby static");
+#else
+    const char *s;
+    long i;
+
+    if (origarg.argv == 0) {
+	rb_raise(rb_eRuntimeError, "$0 not initialized");
+    }
+    StringValue(val);
+    s = RSTRING_PTR(val);
+    i = RSTRING_LEN(val);
+#if defined(PSTAT_SETCMD)
+    if (i > PST_CLEN) {
+	union pstun un;
+	char buf[PST_CLEN + 1];	/* PST_CLEN is 64 (HP-UX 11.23) */
+	strncpy(buf, s, PST_CLEN);
+	buf[PST_CLEN] = '\0';
+	un.pst_command = buf;
+	pstat(PSTAT_SETCMD, un, PST_CLEN, 0, 0);
+    }
+    else {
+	union pstun un;
+	un.pst_command = s;
+	pstat(PSTAT_SETCMD, un, i, 0, 0);
+    }
+#elif defined(HAVE_SETPROCTITLE)
+    setproctitle("%.*s", (int)i, s);
+#else
+
+    if (i >= origarg.len) {
+	i = origarg.len;
+    }
+
+    memcpy(origarg.argv[0], s, i);
+
+    {
+	int j;
+	char *t = origarg.argv[0] + i;
+	*t = '\0';
+
+	if (i + 1 < origarg.len) memset(t + 1, ' ', origarg.len - i - 1);
+	for (j = 1; j < origarg.argc; j++) {
+	    origarg.argv[j] = t;
+	}
+    }
+#endif
+    GC_RELEASE(rb_progname);
+    rb_progname = rb_tainted_str_new(s, i);
+    GC_RETAIN(rb_progname);
+#endif // !MACRUBY_STATIC
+}
+
+void
+ruby_prog_init(void)
+{
+    init_ids();
+
+    rb_define_hooked_variable("$VERBOSE", &ruby_verbose, 0, verbose_setter);
+    rb_define_hooked_variable("$-v", &ruby_verbose, 0, verbose_setter);
+    rb_define_hooked_variable("$-w", &ruby_verbose, 0, verbose_setter);
+    rb_define_virtual_variable("$-W", opt_W_getter, 0);
+    rb_define_variable("$DEBUG", &ruby_debug);
+    rb_define_variable("$-d", &ruby_debug);
+
+    rb_define_hooked_variable("$0", &rb_progname, 0, set_arg0);
+    rb_define_hooked_variable("$PROGRAM_NAME", &rb_progname, 0, set_arg0);
+
+    rb_define_global_const("ARGV", rb_argv);
+
+    rb_vm_set_running(true);
+}
+

Modified: MacRuby/trunk/symbol.c
===================================================================
--- MacRuby/trunk/symbol.c	2010-06-19 02:12:48 UTC (rev 4250)
+++ MacRuby/trunk/symbol.c	2010-06-19 05:15:35 UTC (rev 4251)
@@ -238,6 +238,44 @@
     return ary;
 }
 
+#if MACRUBY_STATIC
+struct rb_op_tbl_entry rb_op_tbl[] = {
+    {'+', "+"},
+    {'-', "-"},
+    {'*', "*"},
+    {'/', "/"},
+    {'%', "%"},
+    {'|', "|"},
+    {'^', "^"},
+    {'&', "&"},
+    {'!', "!"},
+    {'>', ">"},
+    {'<', "<"},
+    {'~', "~"},
+    {'!', "!"},
+    {'`', "`"},
+    {334, ".."},
+    {335, "..."},
+    {323, "**"},
+    {321, "+@"},
+    {322, "-@"},
+    {324, "<=>"},
+    {328, ">="},
+    {329, "<="},
+    {325, "=="},
+    {326, "==="},
+    {327, "!="},
+    {332, "=~"},
+    {333, "!~"},
+    {336, "[]"},
+    {337, "[]="},
+    {338, "<<"},
+    {339, ">>"},
+    {340, "::"},
+    {0,   NULL}
+};
+#endif
+
 void
 Init_PreSymbol(void)
 {
@@ -761,3 +799,41 @@
     rb_objc_install_method2((Class)rb_cSymbol, "classForKeyedArchiver",
 	    (IMP)rsym_imp_classForKeyedArchiver);
 }
+
+int
+rb_is_const_id(ID id)
+{
+    return is_const_id(id) ? Qtrue : Qfalse;
+}
+
+int
+rb_is_class_id(ID id)
+{
+    return is_class_id(id) ? Qtrue : Qfalse;
+}
+
+int
+rb_is_instance_id(ID id)
+{
+    return is_instance_id(id) ? Qtrue : Qfalse;
+}
+
+int
+rb_is_local_id(ID id)
+{
+    return is_local_id(id) ? Qtrue : Qfalse;
+}
+
+int
+rb_is_junk_id(ID id)
+{
+    return is_junk_id(id) ? Qtrue : Qfalse;
+}
+
+ID
+rb_id_attrset(ID id)
+{
+    id &= ~ID_SCOPE_MASK;
+    id |= ID_ATTRSET;
+    return id;
+}

Modified: MacRuby/trunk/vm.cpp
===================================================================
--- MacRuby/trunk/vm.cpp	2010-06-19 02:12:48 UTC (rev 4250)
+++ MacRuby/trunk/vm.cpp	2010-06-19 05:15:35 UTC (rev 4251)
@@ -4766,6 +4766,7 @@
     return rb_str_new2("main");
 }
 
+#if !defined(MACRUBY_STATIC)
 static const char *
 resources_path(char *path, size_t len)
 {
@@ -4833,6 +4834,7 @@
 	exit(1);	
     }
 }
+#endif
 
 extern "C"
 void

Modified: MacRuby/trunk/vm_eval.c
===================================================================
--- MacRuby/trunk/vm_eval.c	2010-06-19 02:12:48 UTC (rev 4250)
+++ MacRuby/trunk/vm_eval.c	2010-06-19 05:15:35 UTC (rev 4251)
@@ -306,6 +306,10 @@
 rb_vm_eval_string(VALUE self, VALUE klass, VALUE src, rb_vm_binding_t *binding,
 	const char *file, const int line)
 {
+#if MACRUBY_STATIC
+    rb_raise(rb_eRuntimeError,
+	    "evaluating strings is not supported in MacRuby static");
+#else
     bool old_parse_in_eval = rb_vm_parse_in_eval();
     rb_vm_set_parse_in_eval(true);
     if (binding != NULL) {
@@ -333,6 +337,7 @@
     }
 
     return rb_vm_run_under(klass, self, file, node, binding, true);
+#endif
 }
 
 static VALUE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100618/c3c6a2d8/attachment-0001.html>


More information about the macruby-changes mailing list