aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-28 21:39:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-28 21:39:24 +0000
commit870dc61b5defe6eabd5d9203bcb5cad736ac96f8 (patch)
tree94055a58e49eab1b1c6682d8502b435791ef7384 /compile.c
parent535914050a477127b737198aaa1605bdf5a03184 (diff)
downloadruby-870dc61b5defe6eabd5d9203bcb5cad736ac96f8.tar.gz
remove rb_thread_t::parse_in_eval
* parse.y (struct parser_params): move parse_in_eval flag from rb_thread_t. * parse.y (rb_parser_set_context): set parsing context, not only mild error flag. * iseq.c (rb_iseq_compile_with_option): the parser now refers no thread local states to be restored. * vm_eval.c (eval_string_with_cref): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/compile.c b/compile.c
index efa35ba833..860de31f9f 100644
--- a/compile.c
+++ b/compile.c
@@ -6764,12 +6764,11 @@ rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE misc, VALUE locals, VALUE params,
/* for parser */
int
-rb_dvar_defined(ID id)
+rb_dvar_defined(ID id, const rb_block_t *base_block)
{
- rb_thread_t *th = GET_THREAD();
const rb_iseq_t *iseq;
- if (th->base_block && (iseq = th->base_block->iseq)) {
+ if (base_block && (iseq = base_block->iseq)) {
while (iseq->body->type == ISEQ_TYPE_BLOCK ||
iseq->body->type == ISEQ_TYPE_RESCUE ||
iseq->body->type == ISEQ_TYPE_ENSURE ||
@@ -6790,14 +6789,13 @@ rb_dvar_defined(ID id)
}
int
-rb_local_defined(ID id)
+rb_local_defined(ID id, const rb_block_t *base_block)
{
- rb_thread_t *th = GET_THREAD();
const rb_iseq_t *iseq;
- if (th->base_block && th->base_block->iseq) {
+ if (base_block && base_block->iseq) {
unsigned int i;
- iseq = th->base_block->iseq->body->local_iseq;
+ iseq = base_block->iseq->body->local_iseq;
for (i=0; i<iseq->body->local_table_size; i++) {
if (iseq->body->local_table[i] == id) {
@@ -6808,18 +6806,6 @@ rb_local_defined(ID id)
return 0;
}
-int
-rb_parse_in_eval(void)
-{
- return GET_THREAD()->parse_in_eval > 0;
-}
-
-int
-rb_parse_in_main(void)
-{
- return GET_THREAD()->parse_in_eval < 0;
-}
-
static int
caller_location(VALUE *path, VALUE *absolute_path)
{