summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2019-10-04 01:29:21 +0900
committerYusuke Endoh <mame@ruby-lang.org>2019-10-04 02:30:36 +0900
commit711c40ebdcd0974ef3e6ac6870412dc88ae25f3e (patch)
tree01e4b774c92c8a873bac38826ab7136c631c396d /iseq.c
parent8f7fca784a46c4d4213ed7b166945f5b9143062d (diff)
Refactor parser_params by removing "in_main" flag
The relation between parser_param#base_block and #in_main were very subtle. A main script (that is passed via a command line) was parsed under base_block = TOPLEVEL_BINDING and in_main = 1. A script loaded by Kernel#require was parsed under base_block = NULL and in_main = 0. If base_block is non-NULL and in_main == 0, it is parsed by Kernel#eval or family. However, we know that TOPLEVEL_BINDING has no local variables when a main script is parsed. So, we don't have to parse a main script under base_block = TOPLEVEL_BINDING. Instead, this change parses a main script under base_block = 0. If base_block is non-NULL, it is parsed by Kernel#eval or family. By this simplication, "in_main" is no longer needed.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2519
Diffstat (limited to 'iseq.c')
0 files changed, 0 insertions, 0 deletions