diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-07 06:41:17 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-07 06:41:17 +0000 |
commit | b65958153c553fa23420fc7262589e18baef2e52 (patch) | |
tree | ce77d3d05eb0f3481c5f94e37a28aa4a7cfb9c14 | |
parent | 30953338df004dba1b6ff5f532a359c881c74eff (diff) |
* sample/test.rb, test/ruby/test_system.rb(valid_syntax?): keep
comment lines first.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@13381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | sample/test.rb | 5 | ||||
-rw-r--r-- | test/ruby/test_system.rb | 5 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 14 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Fri Sep 7 15:40:47 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * sample/test.rb, test/ruby/test_system.rb(valid_syntax?): keep + comment lines first. + Wed Aug 22 12:40:15 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> * hash.c (rb_hash_delete_key): delete the entry without calling block. diff --git a/sample/test.rb b/sample/test.rb index e7f2d251b7..741e96ee9d 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -1697,7 +1697,10 @@ else end def valid_syntax?(code, fname) - eval("BEGIN {return true}\n#{code}", nil, fname, 0) + code = code.sub(/\A(?:\s*\#.*$)*(\n)?/n) { + "#$&#{"\n" if $1 && !$2}BEGIN{return true}\n" + } + eval(code, nil, fname, 0) rescue Exception puts $!.message false diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb index f3a71598f7..3513577ec5 100644 --- a/test/ruby/test_system.rb +++ b/test/ruby/test_system.rb @@ -4,7 +4,10 @@ require 'envutil' class TestSystem < Test::Unit::TestCase def valid_syntax?(code, fname) - eval("BEGIN {return true}\n#{code}", nil, fname, 0) + code = code.sub(/\A(?:\s*\#.*$)*(\n)?/n) { + "#$&#{"\n" if $1 && !$2}BEGIN{return true}\n" + } + eval(code, nil, fname, 0) end def test_system @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2007-09-07" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20070907 -#define RUBY_PATCHLEVEL 90 +#define RUBY_PATCHLEVEL 91 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 |