The IRB::Source class uses Ripper and might be of help as well.

On 6 jan 2011, at 23:50, Laurent Sansonetti wrote:

> I would catch the SyntaxError exception and poke at its content.
> 
> If you want to catch syntax errors ahead of execution, you can use the ripper 
> extension, which is bundled in MacRuby. It's basically an interface to the 
> Ruby parser and allows you to retrieve the AST.
> 
> Laurent
> 
> On Jan 6, 2011, at 12:13 PM, Joel Reymont wrote:
> 
>> I would like to edit MacRuby code in a Cocoa text window, press a button to 
>> "compile" it and display error information in a status line. 
>> 
>> I would also like to highlight the position of the error in my text window. 
>> 
>> How do I programmatically grab the error location from an evaluation or 
>> compilation error?
>> 
>>      Thanks, Joel
>> 
>> ---
>> http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
> 
> _______________________________________________
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

_______________________________________________
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Reply via email to