зеркало из https://github.com/github/ruby.git
* ruby.c (load_file_internal): no need to cast.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
767a9a5ecd
Коммит
1a0f593b3c
20
ruby.c
20
ruby.c
|
@ -325,7 +325,7 @@ expand_include_path(VALUE path)
|
||||||
return rb_file_expand_path(path, Qnil);
|
return rb_file_expand_path(path, Qnil);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ruby_incpush_expand(const char *path)
|
ruby_incpush_expand(const char *path)
|
||||||
{
|
{
|
||||||
ruby_push_include(path, expand_include_path);
|
ruby_push_include(path, expand_include_path);
|
||||||
|
@ -566,7 +566,7 @@ moreswitches(const char *s, struct cmdline_options *opt, int envopt)
|
||||||
while (*p && !ISSPACE(*p)) ++p;
|
while (*p && !ISSPACE(*p)) ++p;
|
||||||
if (!*p) break;
|
if (!*p) break;
|
||||||
*p++ = '\0';
|
*p++ = '\0';
|
||||||
while (ISSPACE(*p)) ++p;
|
while (ISSPACE(*p)) ++p;
|
||||||
}
|
}
|
||||||
argc = RSTRING_LEN(argary) / sizeof(ap);
|
argc = RSTRING_LEN(argary) / sizeof(ap);
|
||||||
ap = 0;
|
ap = 0;
|
||||||
|
@ -1128,7 +1128,7 @@ uscore_get()
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* sub(pattern, replacement) => $_
|
* sub(pattern, replacement) => $_
|
||||||
* sub(pattern) { block } => $_
|
* sub(pattern) { block } => $_
|
||||||
*
|
*
|
||||||
* Equivalent to <code>$_.sub(<i>args</i>)</code>, except that
|
* Equivalent to <code>$_.sub(<i>args</i>)</code>, except that
|
||||||
* <code>$_</code> will be updated if substitution occurs.
|
* <code>$_</code> will be updated if substitution occurs.
|
||||||
* Available only when -p/-n command line option specified.
|
* Available only when -p/-n command line option specified.
|
||||||
|
@ -1148,11 +1148,11 @@ rb_f_sub(argc, argv)
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* gsub(pattern, replacement) => string
|
* gsub(pattern, replacement) => string
|
||||||
* gsub(pattern) {|...| block } => string
|
* gsub(pattern) {|...| block } => string
|
||||||
*
|
*
|
||||||
* Equivalent to <code>$_.gsub...</code>, except that <code>$_</code>
|
* Equivalent to <code>$_.gsub...</code>, except that <code>$_</code>
|
||||||
* receives the modified result.
|
* receives the modified result.
|
||||||
* Available only when -p/-n command line option specified.
|
* Available only when -p/-n command line option specified.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -1168,11 +1168,11 @@ rb_f_gsub(argc, argv)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* chop => string
|
* chop => string
|
||||||
*
|
*
|
||||||
* Equivalent to <code>($_.dup).chop!</code>, except <code>nil</code>
|
* Equivalent to <code>($_.dup).chop!</code>, except <code>nil</code>
|
||||||
* is never returned. See <code>String#chop!</code>.
|
* is never returned. See <code>String#chop!</code>.
|
||||||
* Available only when -p/-n command line option specified.
|
* Available only when -p/-n command line option specified.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -1188,11 +1188,11 @@ rb_f_chop()
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* chomp => $_
|
* chomp => $_
|
||||||
* chomp(string) => $_
|
* chomp(string) => $_
|
||||||
*
|
*
|
||||||
* Equivalent to <code>$_ = $_.chomp(<em>string</em>)</code>. See
|
* Equivalent to <code>$_ = $_.chomp(<em>string</em>)</code>. See
|
||||||
* <code>String#chomp</code>.
|
* <code>String#chomp</code>.
|
||||||
* Available only when -p/-n command line option specified.
|
* Available only when -p/-n command line option specified.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -1592,7 +1592,7 @@ load_file_internal(VALUE arg)
|
||||||
enc = rb_usascii_encoding();
|
enc = rb_usascii_encoding();
|
||||||
}
|
}
|
||||||
rb_funcall(f, set_encoding, 2, rb_enc_from_encoding(enc), rb_str_new_cstr("-"));
|
rb_funcall(f, set_encoding, 2, rb_enc_from_encoding(enc), rb_str_new_cstr("-"));
|
||||||
tree = (NODE *)rb_parser_compile_file(parser, fname, f, line_start);
|
tree = rb_parser_compile_file(parser, fname, f, line_start);
|
||||||
rb_funcall(f, set_encoding, 1, rb_parser_encoding(parser));
|
rb_funcall(f, set_encoding, 1, rb_parser_encoding(parser));
|
||||||
if (script && rb_parser_end_seen_p(parser)) {
|
if (script && rb_parser_end_seen_p(parser)) {
|
||||||
rb_define_global_const("DATA", f);
|
rb_define_global_const("DATA", f);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче