зеркало из https://github.com/github/ruby.git
* eval.c (rb_eval): NODE_EVSTR is no longer used.
* eval.c (eval): not enforce to make assigned variables dynamic. * parse.y (string): split rules to strings/xstring/regexp to allow arbitrary statements inside string interpolation. * parse.y (here_document): splitted into three phases. * parse.y (literall_append, literal_concat): added. append/concatinate string literals. * sample/test.rb (valid_syntax): adjust line number for BEGIN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
0e866a2e51
Коммит
33061b45b4
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
|||
Mon Jun 24 16:16:59 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* eval.c (rb_eval): NODE_EVSTR is no longer used.
|
||||
|
||||
* eval.c (eval): not enforce to make assigned variables dynamic.
|
||||
|
||||
* parse.y (string): split rules to strings/xstring/regexp to allow
|
||||
arbitrary statements inside string interpolation.
|
||||
|
||||
* parse.y (here_document): splitted into three phases.
|
||||
|
||||
* parse.y (literall_append, literal_concat): added.
|
||||
append/concatinate string literals.
|
||||
|
||||
* sample/test.rb (valid_syntax): adjust line number for BEGIN.
|
||||
|
||||
Sun Jun 23 00:19:10 2002 Tadayoshi Funaba <tadf@dotrb.org>
|
||||
|
||||
* lib/date.rb, lib/date/format.rb, sample/cal.rb, sample/goodfriday.rb:
|
||||
|
|
18
eval.c
18
eval.c
|
@ -3068,29 +3068,14 @@ rb_eval(self, n)
|
|||
NODE *list = node->nd_next;
|
||||
|
||||
str = rb_str_new3(node->nd_lit);
|
||||
if (!ruby_dyna_vars) rb_dvar_push(0, 0);
|
||||
while (list) {
|
||||
if (list->nd_head) {
|
||||
switch (nd_type(list->nd_head)) {
|
||||
case NODE_STR:
|
||||
str2 = list->nd_head->nd_lit;
|
||||
break;
|
||||
case NODE_EVSTR:
|
||||
result = ruby_errinfo;
|
||||
ruby_errinfo = Qnil;
|
||||
ruby_sourceline = nd_line(node);
|
||||
ruby_in_eval++;
|
||||
list->nd_head = compile(list->nd_head->nd_lit,
|
||||
ruby_sourcefile,
|
||||
ruby_sourceline);
|
||||
ruby_eval_tree = 0;
|
||||
ruby_in_eval--;
|
||||
if (ruby_nerrs > 0) {
|
||||
compile_error("string expansion");
|
||||
}
|
||||
if (!NIL_P(result)) ruby_errinfo = result;
|
||||
/* fall through */
|
||||
default:
|
||||
ruby_sourceline = nd_line(list->nd_head);
|
||||
str2 = rb_obj_as_string(rb_eval(self, list->nd_head));
|
||||
break;
|
||||
}
|
||||
|
@ -5025,7 +5010,6 @@ eval(self, src, scope, file, line)
|
|||
if (ruby_frame->prev) {
|
||||
ruby_frame->iter = ruby_frame->prev->iter;
|
||||
}
|
||||
if (!ruby_dyna_vars) rb_dvar_push(0, 0);
|
||||
}
|
||||
if (file == 0) {
|
||||
file = ruby_sourcefile;
|
||||
|
|
|
@ -14,7 +14,7 @@ def mkfunc(rettype, fnum, argc)
|
|||
|
||||
ret_code =
|
||||
if( DLTYPE[rettype][:c2rb] )
|
||||
" return #{DLTYPE[rettype][:rb2c][\"retval\"]};"
|
||||
" return #{DLTYPE[rettype][:rb2c]['retval']};"
|
||||
else
|
||||
" /* no return value */"
|
||||
end
|
||||
|
|
|
@ -535,7 +535,7 @@ class Test1
|
|||
# clipboard をクリア.
|
||||
clipboard.e("clear")
|
||||
# selection から文字列を読み込み clipboard に追加する.
|
||||
clipboard.e("append {#{selection.e(\"get\")}}")}))
|
||||
clipboard.e("append {#{selection.e('get')}}")}))
|
||||
me1.e("add command -label {selection -> clipboard} -command",c)
|
||||
cb.push(c = TclTkCallback.new(ip, proc{
|
||||
# li1 をクリア.
|
||||
|
|
|
@ -506,11 +506,11 @@ CPPFLAGS = -I. -I$(hdrdir) -I$(srcdir) #{$defs.join(" ")} #{CONFIG["CPPFLAGS"]}
|
|||
CXXFLAGS = $(CFLAGS)
|
||||
#{
|
||||
if /bccwin32/ =~ RUBY_PLATFORM
|
||||
"DLDFLAGS = #$LDFLAGS -L" + '"$(topdir:/=\\)"' + "\n" +
|
||||
"LDSHARED = #{CONFIG[\"LDSHARED\"]}\n"
|
||||
"DLDFLAGS = #$LDFLAGS -L\"$(topdir:/=\\)\"\n" +
|
||||
"LDSHARED = #{CONFIG['LDSHARED']}\n"
|
||||
else
|
||||
"DLDFLAGS = #{$DLDFLAGS} #{$LDFLAGS}\n" +
|
||||
"LDSHARED = #{CONFIG[\"LDSHARED\"]} #{defflag}\n"
|
||||
"LDSHARED = #{CONFIG['LDSHARED']} #{defflag}\n"
|
||||
end
|
||||
}
|
||||
LIBPATH = #{libpath}
|
||||
|
|
1232
parse.y
1232
parse.y
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1210,7 +1210,7 @@ else
|
|||
end
|
||||
|
||||
def valid_syntax?(code, fname)
|
||||
eval("BEGIN {return true}\n#{code}", nil, fname)
|
||||
eval("BEGIN {return true}\n#{code}", nil, fname, 0)
|
||||
rescue Exception
|
||||
p $!
|
||||
ensure
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#define RUBY_VERSION "1.7.2"
|
||||
#define RUBY_RELEASE_DATE "2002-06-20"
|
||||
#define RUBY_RELEASE_DATE "2002-06-24"
|
||||
#define RUBY_VERSION_CODE 172
|
||||
#define RUBY_RELEASE_CODE 20020620
|
||||
#define RUBY_RELEASE_CODE 20020624
|
||||
|
|
Загрузка…
Ссылка в новой задаче