summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-07 05:00:26 (GMT)
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-07 05:00:26 (GMT)
commitda9a9c68fd91ad541c1fa211f66a3fb511ecdc03 (patch)
treeb6e03f3d27dd4ec57f48114a3d1b9f59a31409df
parentc7a84b8c11792d6d71ff4ece5cc9df43fbddafcd (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_5@13357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--sample/test.rb5
-rw-r--r--test/ruby/test_system.rb5
-rw-r--r--version.h2
3 files changed, 9 insertions, 3 deletions
diff --git a/sample/test.rb b/sample/test.rb
index e7f2d25..741e96e 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 f3a7159..3513577 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
diff --git a/version.h b/version.h
index 7d16d40..264ad00 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2007-09-07"
#define RUBY_VERSION_CODE 185
#define RUBY_RELEASE_CODE 20070907
-#define RUBY_PATCHLEVEL 98
+#define RUBY_PATCHLEVEL 99
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8