Phlip
3/2/2008 12:21:00 AM
Victor 'Zverok' Shepelev wrote:
> It seems that the question relates to interpreter "internals", but I'm
> afraid of ask silly questions in ruby-core.
I can't imagine why.
> The question is: why error messages of interpreter has inconsistent
> addressing system of file and line?
Because each is subject to the whims of a programmer who may or may not have
followed conventions when rescuing errors and printing them out.
(BTW I can talk! I might just do this:
rescue => e
diagnostic = [diagnostic, e.inspect,
*e.backtrace].compact.join("\n")
puts diagnostic
)
> There are at many slightly different schemes (and all of them can be
> present
> in the same error backtrace):
>
> path/file.rb:10: error text
> path/file.rb:1:in `require': other-path/other-file.rb:31: error text
> path/file.rb:7:in `method' error text
> ^ from path/file.rb:12
>
> And so on. I can't invent one regexp for my output-capturing text editor
> (EditPlus on Windows) for catch all cases and automatically extract file
> and
> path for navigate me to this path.
Why can't you use more than one regexp for them?
How about you write a Ruby project which tests some regices, then glom them
all together?
BTW EditPlus seems to have a Ruby.stx - shouldn't that provide fault
navigation?
--
Phlip