* sample/test.rb: fix to output file name if it contains

invalid syntax.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2007-08-06 07:58:45 +00:00
parent 1951ef76ce
commit 18c81c3d3e
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Mon Aug 6 16:57:08 2007 Koichi Sasada <ko1@atdot.net>
* sample/test.rb: fix to output file name if it contains
invalid syntax.
Mon Aug 6 16:41:22 2007 Koichi Sasada <ko1@atdot.net>
* parse.y (value_expr_gen): fix to cause "void value expression"

View File

@ -1880,12 +1880,13 @@ end
def valid_syntax?(code, fname)
eval("BEGIN {return true}\n#{code}", nil, fname, 0)
rescue Exception
puts $!.message
STDERR.puts $!.message
false
end
for script in Dir["#{dir}{lib,sample,ext}/**/*.rb"]
unless valid_syntax? IO::read(script), script
STDERR.puts script
$bad = true
end
end