Пример #1
0
 public static CompilerPipeline AdjustPipeline(EvaluationContext context, CompilerPipeline pipeline)
 {
     pipeline.InsertAfter(typeof(IntroduceUnityGlobalNamespaces), new IntroduceScriptingNamespace(context));
     pipeline.InsertAfter(typeof(IntroduceScriptingNamespace), new IntroduceImports(context));
     pipeline.InsertAfter(typeof(ApplySemantics), new IntroduceEvaluationContext(context));
     pipeline.Replace(typeof(ProcessUnityScriptMethods), new ProcessScriptingMethods(context));
     pipeline.InsertAfter(typeof(ProcessScriptingMethods), new IntroduceReturnValue());
     return pipeline;
 }
Пример #2
0
 public Evaluator(EvaluationContext context, string code)
 {
     if (code == null)
     {
         throw new ArgumentNullException("code");
     }
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     this._context = context;
     this._code = code;
     this._cacheKey = new EvaluationScriptCacheKey(context.GetType(), code);
 }
Пример #3
0
 public static object Eval(EvaluationContext context, string code)
 {
     return new Evaluator(context, code).Run();
 }
 public IntroduceEvaluationContext(EvaluationContext evaluationContext)
 {
     this._evaluationContext = evaluationContext;
 }
 public ProcessScriptingMethods(EvaluationContext evaluationContext)
 {
     this._evaluationContext = evaluationContext;
 }
Пример #6
0
 public IntroduceImports(EvaluationContext context)
 {
     this._evaluationContext = context;
 }