mruby/mruby — pull request #1563 by Fleurer (2013-11-03 04:11:00+00:00)
Title: fix #1558 and #1527

in my machine, #1527 can still be reproduced after f8fea:

```
$ bin/mirb
mirb - Embeddable Interactive Ruby Shell

This is a very early version, please test and report errors.
Thanks :)

> a=a
=> :public
```

```
$ bin/mruby -e "p a=a"
:public
```

this pr introduced `mrb_context_run()`, for currently there are two scnenario to call `mrb_run()`, the first is calling a proc, in this case mrb should create a new environment, discarding all the variables except args, reciever and block. the second is calling the newly generated irep, like in mirb. in this case, the variables on stack should be kept.

so introduce `mrb_context_run()` which allows us setting the kept variables on stack to handle it respectively.

after applied, #1527 disappeared without #1558:

```
$ bin/mruby -e 'p a=a'
nil
```

```
$ bin/mirb
mirb - Embeddable Interactive Ruby Shell

This is a very early version, please test and report errors.
Thanks :)

> a=a
=> nil
```

```
$ bin/mirb
mirb - Embeddable Interactive Ruby Shell

This is a very early version, please test and report errors.
Thanks :)

> a=1;b=2;c=3
=> 3
> b
=> 2
> c
=> 3
>
```