Is it possible to catch illegal syntax errors?


irb(main):001:0> 550p
SyntaxError: compile error

...

# se.rb
begin
   550p
rescue SyntaxError => e
   # This never seems to get run
   puts "Caught a syntax error: " + e
end

~> ruby se.rb
blah.rb:2: syntax error

Thanks,
Caleb