* 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:
parent
0e866a2e51
commit
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>
|
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:
|
* 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;
|
NODE *list = node->nd_next;
|
||||||
|
|
||||||
str = rb_str_new3(node->nd_lit);
|
str = rb_str_new3(node->nd_lit);
|
||||||
if (!ruby_dyna_vars) rb_dvar_push(0, 0);
|
|
||||||
while (list) {
|
while (list) {
|
||||||
if (list->nd_head) {
|
if (list->nd_head) {
|
||||||
switch (nd_type(list->nd_head)) {
|
switch (nd_type(list->nd_head)) {
|
||||||
case NODE_STR:
|
case NODE_STR:
|
||||||
str2 = list->nd_head->nd_lit;
|
str2 = list->nd_head->nd_lit;
|
||||||
break;
|
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:
|
default:
|
||||||
|
ruby_sourceline = nd_line(list->nd_head);
|
||||||
str2 = rb_obj_as_string(rb_eval(self, list->nd_head));
|
str2 = rb_obj_as_string(rb_eval(self, list->nd_head));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -5025,7 +5010,6 @@ eval(self, src, scope, file, line)
|
|||||||
if (ruby_frame->prev) {
|
if (ruby_frame->prev) {
|
||||||
ruby_frame->iter = ruby_frame->prev->iter;
|
ruby_frame->iter = ruby_frame->prev->iter;
|
||||||
}
|
}
|
||||||
if (!ruby_dyna_vars) rb_dvar_push(0, 0);
|
|
||||||
}
|
}
|
||||||
if (file == 0) {
|
if (file == 0) {
|
||||||
file = ruby_sourcefile;
|
file = ruby_sourcefile;
|
||||||
|
@ -14,7 +14,7 @@ def mkfunc(rettype, fnum, argc)
|
|||||||
|
|
||||||
ret_code =
|
ret_code =
|
||||||
if( DLTYPE[rettype][:c2rb] )
|
if( DLTYPE[rettype][:c2rb] )
|
||||||
" return #{DLTYPE[rettype][:rb2c][\"retval\"]};"
|
" return #{DLTYPE[rettype][:rb2c]['retval']};"
|
||||||
else
|
else
|
||||||
" /* no return value */"
|
" /* no return value */"
|
||||||
end
|
end
|
||||||
|
@ -535,7 +535,7 @@ class Test1
|
|||||||
# clipboard をクリア.
|
# clipboard をクリア.
|
||||||
clipboard.e("clear")
|
clipboard.e("clear")
|
||||||
# selection から文字列を読み込み clipboard に追加する.
|
# selection から文字列を読み込み clipboard に追加する.
|
||||||
clipboard.e("append {#{selection.e(\"get\")}}")}))
|
clipboard.e("append {#{selection.e('get')}}")}))
|
||||||
me1.e("add command -label {selection -> clipboard} -command",c)
|
me1.e("add command -label {selection -> clipboard} -command",c)
|
||||||
cb.push(c = TclTkCallback.new(ip, proc{
|
cb.push(c = TclTkCallback.new(ip, proc{
|
||||||
# li1 をクリア.
|
# li1 をクリア.
|
||||||
|
@ -506,11 +506,11 @@ CPPFLAGS = -I. -I$(hdrdir) -I$(srcdir) #{$defs.join(" ")} #{CONFIG["CPPFLAGS"]}
|
|||||||
CXXFLAGS = $(CFLAGS)
|
CXXFLAGS = $(CFLAGS)
|
||||||
#{
|
#{
|
||||||
if /bccwin32/ =~ RUBY_PLATFORM
|
if /bccwin32/ =~ RUBY_PLATFORM
|
||||||
"DLDFLAGS = #$LDFLAGS -L" + '"$(topdir:/=\\)"' + "\n" +
|
"DLDFLAGS = #$LDFLAGS -L\"$(topdir:/=\\)\"\n" +
|
||||||
"LDSHARED = #{CONFIG[\"LDSHARED\"]}\n"
|
"LDSHARED = #{CONFIG['LDSHARED']}\n"
|
||||||
else
|
else
|
||||||
"DLDFLAGS = #{$DLDFLAGS} #{$LDFLAGS}\n" +
|
"DLDFLAGS = #{$DLDFLAGS} #{$LDFLAGS}\n" +
|
||||||
"LDSHARED = #{CONFIG[\"LDSHARED\"]} #{defflag}\n"
|
"LDSHARED = #{CONFIG['LDSHARED']} #{defflag}\n"
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
LIBPATH = #{libpath}
|
LIBPATH = #{libpath}
|
||||||
|
@ -1210,7 +1210,7 @@ else
|
|||||||
end
|
end
|
||||||
|
|
||||||
def valid_syntax?(code, fname)
|
def valid_syntax?(code, fname)
|
||||||
eval("BEGIN {return true}\n#{code}", nil, fname)
|
eval("BEGIN {return true}\n#{code}", nil, fname, 0)
|
||||||
rescue Exception
|
rescue Exception
|
||||||
p $!
|
p $!
|
||||||
ensure
|
ensure
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#define RUBY_VERSION "1.7.2"
|
#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_VERSION_CODE 172
|
||||||
#define RUBY_RELEASE_CODE 20020620
|
#define RUBY_RELEASE_CODE 20020624
|
||||||
|
Loading…
x
Reference in New Issue
Block a user