public string RunProgram(string[] args, bool onlyStandardExtension) { try { _executionContext.InitField(_parser.GetSourceCode(args[0], onlyStandardExtension)); } catch (FileNotFoundException) { ExitCode = -1; return($"Can't find file {args[0]}"); } catch (ParserException e) { ExitCode = -1; return(e.Message); } _executionContext.ProgramArguments = args; string error = null; while (error == null && _executionContext.InterpreterAlive) { error = NextStep(); } return(error); }
protected FungeFamilyLanguage(FungeContext executionContext, CommandProducer commandProducer) { _executionContext = executionContext; _commandProducer = commandProducer; _executionContext.InitField(); }