diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-18 03:24:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-18 03:24:32 +0000 |
commit | 77519504b2d2c54ea695396bdddcb41f7544a5cb (patch) | |
tree | bb561786ebce17fea1875e4738fe3c8dd25295b6 /sample | |
parent | a38a944191a6a1ba1705575ee53eacf92083be2a (diff) | |
download | ruby-77519504b2d2c54ea695396bdddcb41f7544a5cb.tar.gz ruby-77519504b2d2c54ea695396bdddcb41f7544a5cb.tar.xz ruby-77519504b2d2c54ea695396bdddcb41f7544a5cb.zip |
* sample/test.rb, test/ruby/test_system.rb(valid_syntax?): keep
comment lines first.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r-- | sample/test.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sample/test.rb b/sample/test.rb index 768429d95..11d555540 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -1879,7 +1879,10 @@ end def valid_syntax?(code, fname) p 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 STDERR.puts $!.message false |