[IronPython] Checking syntax of source code without running it
curt at hagenlocher.org
Thu Jun 11 00:15:07 CEST 2009
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
<harri.vartiainen at iki.fi>wrote:
> 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
> There are many options listed here for CPython:
> Next stop, debugging..
> Users mailing list
> Users at lists.ironpython.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ironpython-users