Re: [IronPython] Line numbers in snippets...

2006-05-17 Thread J. Merrill
I was trying to suggest to the IP developers that access to file, line and 
perhaps column should be readily available from any exception.  Your response 
suggests that I might not have said so clearly.

When there's a Name Error, it's often possible to work on solving the problem 
without line number info -- you can look at the script for where the bad name 
is used.  (In the particular case of Name Error, the code that's wrong isn't 
necessarily on the line that was running when the exception occurs -- if you 
define a method named SpelledRite and other code calls method SpelledRight, the 
error will be on the line that does the call, regardless of which name you 
intended to use.)

At 04:24 PM 5/16/2006, Alex Henderson wrote
>The name error exception does give you the name causing the grief, but the
>line number isn't available, not without doing a little extra work (as Dino
>outlined) by wrapping up the evaluation of the snippet within a python
>try... except block and pulling some of the info in from sys.exc_info() and
>exposing it to the application hosting the PythonEngine.  
>
>The name isn't really enough for us, we need access to the line number and a
>python stack trace so clients can better analyse what went wrong (we aren't
>evaluating one line exceptions, these are like 100 line snippets)... and
>there are some other errors where the information provided in the exception
>makes it very difficult to resolve the issue without access to the
>additional info.
>
>Chez,
>
> - Alex
>
>> -Original Message-
>> From: [EMAIL PROTECTED] [mailto:users-
>> [EMAIL PROTECTED] On Behalf Of J. Merrill
>> Sent: Wednesday, 17 May 2006 3:50 a.m.
>> To: Discussion of IronPython
>> Subject: Re: [IronPython] Line numbers in snippets...
>> 
>> Shouldn't all Python errors (not just Synax) provide the filename & line
>> number?  Column number would often be less important, particularly for
>> run-time (vs compile-time -- e.g. not Syntax) errors.
>> 
>> As a practical matter, how can it be that a PythonNameError exception
>> doesn't provide a way to get at the name that couldn't be resolved?  What
>> more important bit of info could there be?  (But I haven't looked to make
>> sure that the name is NOT available in the latest IP.)
>> 
>> At 04:55 PM 5/15/2006, Dino Viehland wrote
>> >Ahh, ok...  Can you wrap the user code you run w/ more python code?  If
>> you could then you could do:
>> >[snip]


J. Merrill / Analytical Software Corp


___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Line numbers in snippets...

2006-05-16 Thread Alex Henderson
The name error exception does give you the name causing the grief, but the
line number isn't available, not without doing a little extra work (as Dino
outlined) by wrapping up the evaluation of the snippet within a python
try... except block and pulling some of the info in from sys.exc_info() and
exposing it to the application hosting the PythonEngine.  

The name isn't really enough for us, we need access to the line number and a
python stack trace so clients can better analyse what went wrong (we aren't
evaluating one line exceptions, these are like 100 line snippets)... and
there are some other errors where the information provided in the exception
makes it very difficult to resolve the issue without access to the
additional info.

Chez,

 - Alex

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:users-
> [EMAIL PROTECTED] On Behalf Of J. Merrill
> Sent: Wednesday, 17 May 2006 3:50 a.m.
> To: Discussion of IronPython
> Subject: Re: [IronPython] Line numbers in snippets...
> 
> Shouldn't all Python errors (not just Synax) provide the filename & line
> number?  Column number would often be less important, particularly for
> run-time (vs compile-time -- e.g. not Syntax) errors.
> 
> As a practical matter, how can it be that a PythonNameError exception
> doesn't provide a way to get at the name that couldn't be resolved?  What
> more important bit of info could there be?  (But I haven't looked to make
> sure that the name is NOT available in the latest IP.)
> 
> At 04:55 PM 5/15/2006, Dino Viehland wrote
> >Ahh, ok...  Can you wrap the user code you run w/ more python code?  If
> you could then you could do:
> >[snip]
> 
> 
> J. Merrill / Analytical Software Corp
> 
> 
> ___
> users mailing list
> users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Line numbers in snippets...

2006-05-16 Thread J. Merrill
Shouldn't all Python errors (not just Synax) provide the filename & line 
number?  Column number would often be less important, particularly for run-time 
(vs compile-time -- e.g. not Syntax) errors.

As a practical matter, how can it be that a PythonNameError exception doesn't 
provide a way to get at the name that couldn't be resolved?  What more 
important bit of info could there be?  (But I haven't looked to make sure that 
the name is NOT available in the latest IP.)

At 04:55 PM 5/15/2006, Dino Viehland wrote
>Ahh, ok...  Can you wrap the user code you run w/ more python code?  If you 
>could then you could do:
>[snip]


J. Merrill / Analytical Software Corp


___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Line numbers in snippets...

2006-05-15 Thread Alex Henderson
Sure thing I'll keep you posted.

Chez,

 - Alex

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:users-
> [EMAIL PROTECTED] On Behalf Of Dino Viehland
> Sent: Tuesday, 16 May 2006 9:14 a.m.
> To: Discussion of IronPython
> Subject: Re: [IronPython] Line numbers in snippets...
> 
> The stack trace is a little odd in that it's given to you as a linked
> list, and you need to pull it out by indexing into an array, but other
> than that it's straight forward (the only thing different from what I
> showed you below is sys.exc_info()[2].tb_next will get you the 2nd frame
> (and .tb_next on that, and so on)...
> 
> Even if you do get it to work let us know how painful it is, that'll help
> us prioritize considering making this easier in the future.
> 
> Do you want to help develop Dynamic languages on CLR?
> (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-
> 11F0-45DF-8B78-DC1B43134038)
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:users-
> [EMAIL PROTECTED] On Behalf Of Alex Henderson
> Sent: Monday, May 15, 2006 2:04 PM
> To: 'Discussion of IronPython'
> Subject: Re: [IronPython] Line numbers in snippets...
> 
> Ahhh... hadn't thought about that ;o) hmm... All the calls to the script
> engine are wrapped up against a simplified engine interface as it is, as
> we
> are attempting to be at least partly script-engine agnostic... so I can't
> see why I couldn't do that, and wrap the exception in one of our own,
> tagged
> with the additional error location info.
> 
> I'll give it a go, and if you don't hear from me then you'll know it
> worked...  I'm a bit of a python newbie, I assume it's easy enough to grab
> hold of a stack trace as well as the line number etc?
> 
> Thanks Dino,
> 
>  - Alex
> 
> > -Original Message-----
> > From: [EMAIL PROTECTED] [mailto:users-
> > [EMAIL PROTECTED] On Behalf Of Dino Viehland
> > Sent: Tuesday, 16 May 2006 8:55 a.m.
> > To: Discussion of IronPython
> > Subject: Re: [IronPython] Line numbers in snippets...
> >
> > Ahh, ok...  Can you wrap the user code you run w/ more python code?  If
> > you could then you could do:
> >
> > try:
> > // run user code
> > except:
> > import sys
> > print sys.exc_info()[2].tb_lineno
> > print sys.exc_info()[2].tb_frame.f_code.co_filename
> >
> > That's the Python way to get this information.  Let us know if that
> seems
> > to burdensome.  If so we could look at a way to expose this information
> > via the engine APIs instead of requiring you to create this wrapper.
> >
> >
> > Do you want to help develop Dynamic languages on CLR?
> >
> (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-
> > 11F0-45DF-8B78-DC1B43134038)
> >
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:users-
> > [EMAIL PROTECTED] On Behalf Of Alex Henderson
> > Sent: Monday, May 15, 2006 1:48 PM
> > To: 'Discussion of IronPython'
> > Subject: Re: [IronPython] Line numbers in snippets...
> >
> > Not quite... my problem is I don't have a PythonSyntaxError thrown, I
> > believe that's because I'm actually receiving a python generated
> > exception,
> > for instance I might catch a PythonNameError when someone incorrectly
> > spells
> > a variable name... and that doesn't contain any information I can use
> the
> > locate where in the snippet string the error occurred... Is there a way
> to
> > get this information out of the PythonEngine itself perhaps?
> >
> > The reason I ask that I just want to implement a feature where by a user
> > can
> > look at a log "view" in our product, see an error has occurred in their
> > script, and be able to double click the entry and navigate to our code
> > editor and be on the right line for fixing the problem - for this to
> > happen
> > we need to be able to extract some details of where the error occurred
> > when
> > using PythonEngine.Execute...
> >
> > Any ideas I would be greatly appreciated... :)
> >
> > Chez,
> >
> >  - Alex
> >
> > > -Original Message-
> > > From: [EMAIL PROTECTED] [mailto:users-
> > > [EMAIL PROTECTED] On Behalf Of Dino Viehland
> > > Sent: Tuesday, 16 May 2006 8:21 a.m.
> > > To: Discussion of IronPython
> > > Subject: Re: [IronPython] Line numbers in snippets...
> > >
> > > We recently made a change so

Re: [IronPython] Line numbers in snippets...

2006-05-15 Thread Dino Viehland
The stack trace is a little odd in that it's given to you as a linked list, and 
you need to pull it out by indexing into an array, but other than that it's 
straight forward (the only thing different from what I showed you below is 
sys.exc_info()[2].tb_next will get you the 2nd frame (and .tb_next on that, and 
so on)...

Even if you do get it to work let us know how painful it is, that'll help us 
prioritize considering making this easier in the future.

Do you want to help develop Dynamic languages on CLR? 
(http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alex Henderson
Sent: Monday, May 15, 2006 2:04 PM
To: 'Discussion of IronPython'
Subject: Re: [IronPython] Line numbers in snippets...

Ahhh... hadn't thought about that ;o) hmm... All the calls to the script
engine are wrapped up against a simplified engine interface as it is, as we
are attempting to be at least partly script-engine agnostic... so I can't
see why I couldn't do that, and wrap the exception in one of our own, tagged
with the additional error location info.

I'll give it a go, and if you don't hear from me then you'll know it
worked...  I'm a bit of a python newbie, I assume it's easy enough to grab
hold of a stack trace as well as the line number etc?

Thanks Dino,

 - Alex

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:users-
> [EMAIL PROTECTED] On Behalf Of Dino Viehland
> Sent: Tuesday, 16 May 2006 8:55 a.m.
> To: Discussion of IronPython
> Subject: Re: [IronPython] Line numbers in snippets...
>
> Ahh, ok...  Can you wrap the user code you run w/ more python code?  If
> you could then you could do:
>
> try:
> // run user code
> except:
> import sys
> print sys.exc_info()[2].tb_lineno
> print sys.exc_info()[2].tb_frame.f_code.co_filename
>
> That's the Python way to get this information.  Let us know if that seems
> to burdensome.  If so we could look at a way to expose this information
> via the engine APIs instead of requiring you to create this wrapper.
>
>
> Do you want to help develop Dynamic languages on CLR?
> (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-
> 11F0-45DF-8B78-DC1B43134038)
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:users-
> [EMAIL PROTECTED] On Behalf Of Alex Henderson
> Sent: Monday, May 15, 2006 1:48 PM
> To: 'Discussion of IronPython'
> Subject: Re: [IronPython] Line numbers in snippets...
>
> Not quite... my problem is I don't have a PythonSyntaxError thrown, I
> believe that's because I'm actually receiving a python generated
> exception,
> for instance I might catch a PythonNameError when someone incorrectly
> spells
> a variable name... and that doesn't contain any information I can use the
> locate where in the snippet string the error occurred... Is there a way to
> get this information out of the PythonEngine itself perhaps?
>
> The reason I ask that I just want to implement a feature where by a user
> can
> look at a log "view" in our product, see an error has occurred in their
> script, and be able to double click the entry and navigate to our code
> editor and be on the right line for fixing the problem - for this to
> happen
> we need to be able to extract some details of where the error occurred
> when
> using PythonEngine.Execute...
>
> Any ideas I would be greatly appreciated... :)
>
> Chez,
>
>  - Alex
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:users-
> > [EMAIL PROTECTED] On Behalf Of Dino Viehland
> > Sent: Tuesday, 16 May 2006 8:21 a.m.
> > To: Discussion of IronPython
> > Subject: Re: [IronPython] Line numbers in snippets...
> >
> > We recently made a change so that PythonSyntaxError contains a Line,
> > Column, Filename, and some other properties on it that you should be
> able
> > to get at for this information.  Is that what you're looking for?
> >
> >
> > Do you want to help develop Dynamic languages on CLR?
> >
> (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-
> > 11F0-45DF-8B78-DC1B43134038)
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:users-
> > [EMAIL PROTECTED] On Behalf Of Alex Henderson
> > Sent: Monday, May 15, 2006 1:09 PM
> > To: 'Discussion of IronPython'
> > Subject: [IronPython] Line numbers in snippets...
> >
> > We've been using IronPython as a scripting engine in one of our products
> > that's in development f

Re: [IronPython] Line numbers in snippets...

2006-05-15 Thread Alex Henderson
Ahhh... hadn't thought about that ;o) hmm... All the calls to the script
engine are wrapped up against a simplified engine interface as it is, as we
are attempting to be at least partly script-engine agnostic... so I can't
see why I couldn't do that, and wrap the exception in one of our own, tagged
with the additional error location info.

I'll give it a go, and if you don't hear from me then you'll know it
worked...  I'm a bit of a python newbie, I assume it's easy enough to grab
hold of a stack trace as well as the line number etc?

Thanks Dino,
 
 - Alex

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:users-
> [EMAIL PROTECTED] On Behalf Of Dino Viehland
> Sent: Tuesday, 16 May 2006 8:55 a.m.
> To: Discussion of IronPython
> Subject: Re: [IronPython] Line numbers in snippets...
> 
> Ahh, ok...  Can you wrap the user code you run w/ more python code?  If
> you could then you could do:
> 
> try:
> // run user code
> except:
> import sys
> print sys.exc_info()[2].tb_lineno
> print sys.exc_info()[2].tb_frame.f_code.co_filename
> 
> That's the Python way to get this information.  Let us know if that seems
> to burdensome.  If so we could look at a way to expose this information
> via the engine APIs instead of requiring you to create this wrapper.
> 
> 
> Do you want to help develop Dynamic languages on CLR?
> (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-
> 11F0-45DF-8B78-DC1B43134038)
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:users-
> [EMAIL PROTECTED] On Behalf Of Alex Henderson
> Sent: Monday, May 15, 2006 1:48 PM
> To: 'Discussion of IronPython'
> Subject: Re: [IronPython] Line numbers in snippets...
> 
> Not quite... my problem is I don't have a PythonSyntaxError thrown, I
> believe that's because I'm actually receiving a python generated
> exception,
> for instance I might catch a PythonNameError when someone incorrectly
> spells
> a variable name... and that doesn't contain any information I can use the
> locate where in the snippet string the error occurred... Is there a way to
> get this information out of the PythonEngine itself perhaps?
> 
> The reason I ask that I just want to implement a feature where by a user
> can
> look at a log "view" in our product, see an error has occurred in their
> script, and be able to double click the entry and navigate to our code
> editor and be on the right line for fixing the problem - for this to
> happen
> we need to be able to extract some details of where the error occurred
> when
> using PythonEngine.Execute...
> 
> Any ideas I would be greatly appreciated... :)
> 
> Chez,
> 
>  - Alex
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:users-
> > [EMAIL PROTECTED] On Behalf Of Dino Viehland
> > Sent: Tuesday, 16 May 2006 8:21 a.m.
> > To: Discussion of IronPython
> > Subject: Re: [IronPython] Line numbers in snippets...
> >
> > We recently made a change so that PythonSyntaxError contains a Line,
> > Column, Filename, and some other properties on it that you should be
> able
> > to get at for this information.  Is that what you're looking for?
> >
> >
> > Do you want to help develop Dynamic languages on CLR?
> >
> (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-
> > 11F0-45DF-8B78-DC1B43134038)
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:users-
> > [EMAIL PROTECTED] On Behalf Of Alex Henderson
> > Sent: Monday, May 15, 2006 1:09 PM
> > To: 'Discussion of IronPython'
> > Subject: [IronPython] Line numbers in snippets...
> >
> > We've been using IronPython as a scripting engine in one of our products
> > that's in development for a while now, works great :)
> >
> > However when executing code which has syntax errors in it we can't seem
> to
> > get line numbers back from the exception, or find any compilation
> context
> > we
> > can examine for a list of errors - which makes it difficult to diagnose
> > problems obviously.
> >
> > I figure this is probably a limitation of the execute method, unless
> I've
> > missed something... is there a different approach we could use where we
> > will
> > get line numbers when an error occurs?
> >
> > Chez,
> >
> >  - Alex
> >
> > ___
> > users mailing list
> > users@lists.ironpython.com
> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.c

Re: [IronPython] Line numbers in snippets...

2006-05-15 Thread Dino Viehland
Ahh, ok...  Can you wrap the user code you run w/ more python code?  If you 
could then you could do:

try:
// run user code
except:
import sys
print sys.exc_info()[2].tb_lineno
print sys.exc_info()[2].tb_frame.f_code.co_filename

That's the Python way to get this information.  Let us know if that seems to 
burdensome.  If so we could look at a way to expose this information via the 
engine APIs instead of requiring you to create this wrapper.


Do you want to help develop Dynamic languages on CLR? 
(http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alex Henderson
Sent: Monday, May 15, 2006 1:48 PM
To: 'Discussion of IronPython'
Subject: Re: [IronPython] Line numbers in snippets...

Not quite... my problem is I don't have a PythonSyntaxError thrown, I
believe that's because I'm actually receiving a python generated exception,
for instance I might catch a PythonNameError when someone incorrectly spells
a variable name... and that doesn't contain any information I can use the
locate where in the snippet string the error occurred... Is there a way to
get this information out of the PythonEngine itself perhaps?

The reason I ask that I just want to implement a feature where by a user can
look at a log "view" in our product, see an error has occurred in their
script, and be able to double click the entry and navigate to our code
editor and be on the right line for fixing the problem - for this to happen
we need to be able to extract some details of where the error occurred when
using PythonEngine.Execute...

Any ideas I would be greatly appreciated... :)

Chez,

 - Alex

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:users-
> [EMAIL PROTECTED] On Behalf Of Dino Viehland
> Sent: Tuesday, 16 May 2006 8:21 a.m.
> To: Discussion of IronPython
> Subject: Re: [IronPython] Line numbers in snippets...
>
> We recently made a change so that PythonSyntaxError contains a Line,
> Column, Filename, and some other properties on it that you should be able
> to get at for this information.  Is that what you're looking for?
>
>
> Do you want to help develop Dynamic languages on CLR?
> (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-
> 11F0-45DF-8B78-DC1B43134038)
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:users-
> [EMAIL PROTECTED] On Behalf Of Alex Henderson
> Sent: Monday, May 15, 2006 1:09 PM
> To: 'Discussion of IronPython'
> Subject: [IronPython] Line numbers in snippets...
>
> We've been using IronPython as a scripting engine in one of our products
> that's in development for a while now, works great :)
>
> However when executing code which has syntax errors in it we can't seem to
> get line numbers back from the exception, or find any compilation context
> we
> can examine for a list of errors - which makes it difficult to diagnose
> problems obviously.
>
> I figure this is probably a limitation of the execute method, unless I've
> missed something... is there a different approach we could use where we
> will
> get line numbers when an error occurs?
>
> Chez,
>
>  - Alex
>
> ___
> users mailing list
> users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> ___
> users mailing list
> users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Line numbers in snippets...

2006-05-15 Thread Alex Henderson
Not quite... my problem is I don't have a PythonSyntaxError thrown, I
believe that's because I'm actually receiving a python generated exception,
for instance I might catch a PythonNameError when someone incorrectly spells
a variable name... and that doesn't contain any information I can use the
locate where in the snippet string the error occurred... Is there a way to
get this information out of the PythonEngine itself perhaps?

The reason I ask that I just want to implement a feature where by a user can
look at a log "view" in our product, see an error has occurred in their
script, and be able to double click the entry and navigate to our code
editor and be on the right line for fixing the problem - for this to happen
we need to be able to extract some details of where the error occurred when
using PythonEngine.Execute...

Any ideas I would be greatly appreciated... :)

Chez,

 - Alex

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:users-
> [EMAIL PROTECTED] On Behalf Of Dino Viehland
> Sent: Tuesday, 16 May 2006 8:21 a.m.
> To: Discussion of IronPython
> Subject: Re: [IronPython] Line numbers in snippets...
> 
> We recently made a change so that PythonSyntaxError contains a Line,
> Column, Filename, and some other properties on it that you should be able
> to get at for this information.  Is that what you're looking for?
> 
> 
> Do you want to help develop Dynamic languages on CLR?
> (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-
> 11F0-45DF-8B78-DC1B43134038)
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:users-
> [EMAIL PROTECTED] On Behalf Of Alex Henderson
> Sent: Monday, May 15, 2006 1:09 PM
> To: 'Discussion of IronPython'
> Subject: [IronPython] Line numbers in snippets...
> 
> We've been using IronPython as a scripting engine in one of our products
> that's in development for a while now, works great :)
> 
> However when executing code which has syntax errors in it we can't seem to
> get line numbers back from the exception, or find any compilation context
> we
> can examine for a list of errors - which makes it difficult to diagnose
> problems obviously.
> 
> I figure this is probably a limitation of the execute method, unless I've
> missed something... is there a different approach we could use where we
> will
> get line numbers when an error occurs?
> 
> Chez,
> 
>  - Alex
> 
> ___
> users mailing list
> users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> ___
> users mailing list
> users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Line numbers in snippets...

2006-05-15 Thread Dino Viehland
We recently made a change so that PythonSyntaxError contains a Line, Column, 
Filename, and some other properties on it that you should be able to get at for 
this information.  Is that what you're looking for?


Do you want to help develop Dynamic languages on CLR? 
(http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alex Henderson
Sent: Monday, May 15, 2006 1:09 PM
To: 'Discussion of IronPython'
Subject: [IronPython] Line numbers in snippets...

We've been using IronPython as a scripting engine in one of our products
that's in development for a while now, works great :)

However when executing code which has syntax errors in it we can't seem to
get line numbers back from the exception, or find any compilation context we
can examine for a list of errors - which makes it difficult to diagnose
problems obviously.

I figure this is probably a limitation of the execute method, unless I've
missed something... is there a different approach we could use where we will
get line numbers when an error occurs?

Chez,

 - Alex

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Line numbers in snippets...

2006-05-15 Thread Alex Henderson
We've been using IronPython as a scripting engine in one of our products
that's in development for a while now, works great :)

However when executing code which has syntax errors in it we can't seem to
get line numbers back from the exception, or find any compilation context we
can examine for a list of errors - which makes it difficult to diagnose
problems obviously.

I figure this is probably a limitation of the execute method, unless I've
missed something... is there a different approach we could use where we will
get line numbers when an error occurs?

Chez,

 - Alex

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com