iox/Shell.cs
/// <summary>
/// Run a file, and optionally a REPL shell afterwards.
/// </summary>
/// <param name="repl">If set to <c>true</c> repl.</param>
Run a file, and optionally a REPL shell afterwards.
Run a file and optionally a REPL shell afterwards .
void RunFile (bool repl) {
			var content = string.Empty;
			try {
				content = File.ReadAllText (Conf.File);
			} catch (FileNotFoundException ex) {
				ANSI.WriteLine (ex.Message);
				Environment.Exit (1);
			}
			Iodine.Engine.Context.ShouldCache = false;
			var module = WrapIodineOperation (this, () => Iodine.CompileSource (content));
			if (module == null) return;
			var result = WrapIodineOperation (this, () => Iodine.InvokeModule (module));
			if (result == null) return;
			if (repl) {
				RunRepl ();
			}
		}
void RunFile ( bool repl ) { var content = string . Empty ; try { content = File . ReadAllText ( Conf . File ) ; } catch ( FileNotFoundException ex ) { ANSI . WriteLine ( ex . Message ) ; Environment . Exit ( 1 ) ; } Iodine . Engine . Context . ShouldCache = false ; var module = WrapIodineOperation ( this , ( ) => Iodine . CompileSource ( content ) ) ; if ( module == null ) return ; var result = WrapIodineOperation ( this , ( ) => Iodine . InvokeModule ( module ) ) ; if ( result == null ) return ; if ( repl ) { RunRepl ( ) ; } }
Run a file, and optionally a REPL shell afterwards.
Run a file and optionally a REPL shell afterwards .
// Get the file // Compile the module // Invoke the module // Test if the REPL shell should be entered // Enter REPL shell
repl
bool
If set to true
If set to true