[IronPython] Parsing Stack Traces

Dino Viehland dinov at exchange.microsoft.com
Wed Feb 13 22:23:54 CET 2008


Are you using the Python code dom provider from 1.x or directly interacting w/ the hosting APIs?  I think you should get a list of errors like you'd normally get w/ CodeDom - although it'll probably only include 1 error (but it should have line info).

Otherwise in 1.x you can subclass the CompilerSink class and set your own sink on PythonCompiler and have all the errors provided to you.  When AddError on the sink gets called you'll get a CodeSpan and the text of the line.

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Slide
Sent: Tuesday, February 12, 2008 3:53 PM
To: Discussion of IronPython
Subject: [IronPython] Parsing Stack Traces

I have a current script engine I wrote which deals with CodeDom for
JScript.NET scripts and I am currently adding Python capabilities to
it. On the JScript.NET side, I can get the CompilerErrors from the
CompileResults after I've compiled and run the main entry point of the
script. On the Python side, when I run it, I get
SyntaxErrorExceptions, etc that I would like to turn into something
like a CompilerError object. I wrote my own object that is very
similar to CompilerError so that I could abstract this out. Is there a
way to get the line number, column number, etc from the Python engine
so I could fill these items in?

Thanks

--
slide-o-blog
http://slide-o-blog.blogspot.com/
_______________________________________________
Users mailing list
Users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list