summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-05-13 10:01:09 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-05-13 10:01:09 +0000
commitccc13869790d312f614128204c5546d5e9ad0b3f (patch)
tree4a834e153187f75cc2a336f742aea845f55557e6 /eval.c
parentc6ac6cb4542b845eb4c18a9e80e15f8deab4f54a (diff)
990513
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index a6a028ab5c..2d05ebe60c 100644
--- a/eval.c
+++ b/eval.c
@@ -1125,6 +1125,33 @@ rb_eval_string_protect(str, state)
}
VALUE
+rb_eval_string_wrap(str, state)
+ const char *str;
+ int *state;
+{
+ int status;
+ VALUE self = ruby_top_self;
+ VALUE val;
+
+ PUSH_CLASS();
+ ruby_class = ruby_wrapper = rb_module_new();
+ ruby_top_self = rb_obj_clone(ruby_top_self);
+ rb_extend_object(self, ruby_class);
+
+ val = rb_eval_string_protect(str, &status);
+ ruby_top_self = self;
+
+ POP_CLASS();
+ if (state) {
+ if (status == 0) {
+ JUMP_TAG(state);
+ }
+ *state = status;
+ }
+ return val;
+}
+
+VALUE
rb_eval_cmd(cmd, arg)
VALUE cmd, arg;
{