You should be able to just copy and paste throwing error sink into your own 
version, it's pretty simple:

internal class ThrowingErrorSink : ErrorSink {
        public static new readonly ThrowingErrorSink/*!*/ Default = new 
ThrowingErrorSink();

        private ThrowingErrorSink() {
        }

        public override void Add(SourceUnit sourceUnit, string message, 
SourceSpan span, int errorCode, Severity severity) {
            if (severity == Severity.Warning) {
                throw PythonOps.SyntaxWarning(message, sourceUnit, span, 
errorCode);
            } else {
                throw PythonOps.SyntaxError(message, sourceUnit, span, 
errorCode);
            }
        }
    }

-----Original Message-----
From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Dan Eloff
Sent: Wednesday, January 07, 2009 12:51 PM
To: Discussion of IronPython
Subject: [IronPython] ThrowingErrorSink and CompilerContext

Internally, in compile builtin, IronPython creates a CompilerContext like:

new CompilerContext(sourceUnit, opts, ThrowingErrorSink.Default)

But ThrowingErrorSink is internal, what can I do to get a equivalent
CompilerContext?

This is blocking the _ast module from running on unpatched IronPython.

Thanks,
-Dan
_______________________________________________
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

Reply via email to