protected EngineOptions(EngineOptions options) { Contract.RequiresNotNull(options, "options"); _clrDebuggingEnabled = options._clrDebuggingEnabled; _exceptionDetail = options._exceptionDetail; _showClrExceptions = options._showClrExceptions; }
public override void Parse(string[] args) { if (_consoleOptions == null) _consoleOptions = GetDefaultConsoleOptions(); if (_engineOptions == null) _engineOptions = GetDefaultEngineOptions(); base.Parse(args); }
public ToyEngine(LanguageProvider provider, EngineOptions engineOptions) : base(provider, engineOptions) { IronPython.Runtime.Operations.Ops.Bool2Object(true); //awful initialization hack IronPython.Runtime.Operations.Ops.RegisterAssembly(typeof(ToyEngine).Assembly); _defaultContext = new ToyContext(this); _defaultBinder = new DefaultActionBinder(new CodeContext(null, _defaultContext)); }
public override ScriptEngine GetEngine(EngineOptions options) { if (options == null) { options = new InfixEngineOptions(); } return new InfixEngine(this, options); }
public static string FormatException (Exception exception, EngineOptions options) { StringBuilder builder = new StringBuilder (); builder.AppendLine (" Error: "); builder.AppendLine (exception.Message); if (options.ShowClrExceptions) { builder.AppendLine (); builder.AppendLine ("CLR Exception"); builder.Append (exception.GetType().Name + " : "); builder.AppendLine (exception.Message); builder.AppendLine (exception.StackTrace); } return builder.ToString (); }
public void FormatException () { Exception ex = new Exception("test message", new Exception ("inner exception test", null)); try { throw ex; } catch (Exception e) { Console.WriteLine (e.StackTrace.ToString()); MSc.EngineOptions option = new MSc.EngineOptions(); option.ShowClrExceptions = true; string result = JSErrorConvertor.FormatException (e, option); Assert.AreEqual (" Error: test message\r\n\r\nCLR Exception\r\nException : test message\r\n" + e.StackTrace.ToString() +"\r\n", result, "#1"); option.ShowClrExceptions = false; result = JSErrorConvertor.FormatException (e, option); Assert.AreEqual (" Error: test message\r\n", result, "#2"); } }
public void FormatException() { Exception ex = new Exception("test message", new Exception("inner exception test", null)); try { throw ex; } catch (Exception e) { Console.WriteLine(e.StackTrace.ToString()); MSc.EngineOptions option = new MSc.EngineOptions(); option.ShowClrExceptions = true; string result = JSErrorConvertor.FormatException(e, option); Assert.AreEqual(" Error: test message\r\n\r\nCLR Exception\r\nException : test message\r\n" + e.StackTrace.ToString() + "\r\n", result, "#1"); option.ShowClrExceptions = false; result = JSErrorConvertor.FormatException(e, option); Assert.AreEqual(" Error: test message\r\n", result, "#2"); } }
public IronSchemeScriptEngine(LanguageProvider lp, EngineOptions eo, LanguageContext lc) : base(lp, eo, lc) { ((IronSchemeLanguageContext)LanguageContext).se = this; }
public InfixEngine(InfixLanguageProvider provider, EngineOptions options) : base(provider, options, new InfixLanguageContext()) { ((InfixLanguageContext)LanguageContext).InfixEngine = this; this._binder = new InfixBinder(new CodeContext(new Scope(), LanguageContext, new ModuleContext(null))); }
public static PythonEngine CreateIronPythonEngine() { EngineOptions engineOptions = new EngineOptions(); engineOptions.ShowClrExceptions = true; return new PythonEngine(engineOptions); }
public override ScriptEngine GetEngine(EngineOptions options) { if (se == null) { LanguageContext lc = new IronSchemeLanguageContext(); se = new IronSchemeScriptEngine(this, options ?? new IronSchemeOptionsParser.IronSchemeEngineOptions(), lc); } return se; }
public override ScriptEngine GetEngine(EngineOptions options) { return new ToyEngine(this, options); }
public InfixOptionsParser() { this._consoleOptions = this.GetDefaultConsoleOptions(); this._engineOptions = this.GetDefaultEngineOptions(); }