diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-24 08:21:04 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-24 08:21:04 +0000 |
commit | 271f6d68d64588b15f5c056736509595d5b15d6b (patch) | |
tree | b86fe742635cbb45f735cc8380ea1ff86797b4e5 /ruby.c | |
parent | b14bfba2e98b8837b842397aa13ce76bbb44b034 (diff) | |
download | ruby-271f6d68d64588b15f5c056736509595d5b15d6b.tar.gz |
parse without $.
* io.c (rb_io_gets_internal): read one line from an IO without
setting ARGF.lineno.
* parse.y (lex_io_gets): use rb_io_gets_internal not to affect
$. global variable.
* ruby.c (load_file): no longer reset $.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r-- | ruby.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -1675,7 +1675,6 @@ struct load_file_arg { int xflag; struct cmdline_options *opt; VALUE f; - VALUE lineno; }; static VALUE @@ -1878,7 +1877,6 @@ restore_load_file(VALUE arg) { struct load_file_arg *argp = (struct load_file_arg *)arg; VALUE f = argp->f; - VALUE lineno = argp->lineno; if (argp->script) { /* @@ -1898,7 +1896,7 @@ restore_load_file(VALUE arg) else if (f != rb_stdin) { rb_io_close(f); } - return rb_gv_set("$.", lineno); + return Qnil; } static NODE * @@ -1910,7 +1908,6 @@ load_file(VALUE parser, VALUE fname, int script, struct cmdline_options *opt) arg.script = script; arg.opt = opt; arg.xflag = 0; - arg.lineno = rb_gv_get("$."); arg.f = open_load_file(rb_str_encode_ospath(fname), &arg.xflag); return (NODE *)rb_ensure(load_file_internal, (VALUE)&arg, restore_load_file, (VALUE)&arg); |