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@13085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-08-18 03:24:32 +00:00
parent 65fc6198c5
commit 2e752da616
4 changed files with 16 additions and 5 deletions

View file

@ -1,3 +1,8 @@
Sat Aug 18 12:24:30 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* sample/test.rb, test/ruby/test_system.rb(valid_syntax?): keep
comment lines first.
Thu Aug 16 20:40:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org> Thu Aug 16 20:40:50 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* bignum.c (bigtrunc): RBIGNUM(x)->len may be zero. out of bound * bignum.c (bigtrunc): RBIGNUM(x)->len may be zero. out of bound

View file

@ -1697,7 +1697,10 @@ else
end end
def valid_syntax?(code, fname) 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 rescue Exception
puts $!.message puts $!.message
false false

View file

@ -4,7 +4,10 @@ require 'envutil'
class TestSystem < Test::Unit::TestCase class TestSystem < Test::Unit::TestCase
def valid_syntax?(code, fname) 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 end
def test_system def test_system

View file

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.8.6" #define RUBY_VERSION "1.8.6"
#define RUBY_RELEASE_DATE "2007-08-16" #define RUBY_RELEASE_DATE "2007-08-18"
#define RUBY_VERSION_CODE 186 #define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20070816 #define RUBY_RELEASE_CODE 20070818
#define RUBY_PATCHLEVEL 5000 #define RUBY_PATCHLEVEL 5000
#define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 6 #define RUBY_VERSION_TEENY 6
#define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 8 #define RUBY_RELEASE_MONTH 8
#define RUBY_RELEASE_DAY 16 #define RUBY_RELEASE_DAY 18
#ifdef RUBY_EXTERN #ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[]; RUBY_EXTERN const char ruby_version[];