1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
shyouhei 2007-09-07 06:41:17 +00:00
parent 30953338df
commit b65958153c
4 changed files with 14 additions and 3 deletions

View file

@ -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.

View file

@ -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

View file

@ -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

View file

@ -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