Through the hosting API, it's something like this:
engine = IronPython.Hosting.Python.CreateEngine()
source = engine.CreateScriptSourceFromString(text, SourceCodeKind.File)
errors = ErrorListener()
command = source.Compile(errors)
if command is None:
# compilation failed
Here, ErrorListener is some class that derives
from Microsoft.Scripting.Hosting.ErrorListener and stores the errors.
On Wed, Jun 10, 2009 at 12:52 PM, Harri Vartiainen
<[email protected]>wrote:
> Hi,
>
> What's the best way to check syntax of IronPython source code without
> actually running it?
>
> I'd like to embed IronPython to application and make it as user
> friendly as possible, so all checking before running the code would be
> helpful.
>
> There are many options listed here for CPython:
>
> http://stackoverflow.com/questions/205704/how-can-i-check-the-syntax-of-python-code-in-emacs-without-actually-executing-it
>
>
>
> Next stop, debugging..
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com