Exemplo n.º 1
0
    public IScriptScope Create(IScriptScope parent, params object[] args)
    {
      if (args == null || args.Length == 0)
      {
        ScriptScope result = new ScriptScope(parent);
        SetBaseItems(result);
        return result;
      }

      throw new NotSupportedException();
    }
Exemplo n.º 2
0
    private void SetBaseItems(ScriptScope result)
    {
      //Process only root scopes
      if (result.Parent != null) return;        

      //Variables
      result.SetItem("Scope", result);
      result.SetItem("Compiler", RuntimeHost.Parser);

      ////Custom Functions
      //AppendAst
      result.SetItem(CustomFunctions.AppendFunc.FunctionName, CustomFunctions.AppendFunc.FunctionDefinition);
      //ReplaceAst
      result.SetItem(CustomFunctions.ReplaceFunc.FunctionName, CustomFunctions.ReplaceFunc.FunctionDefinition);
      //eval
      result.SetItem(CustomFunctions.EvalFunc.FunctionName, CustomFunctions.EvalFunc.FunctionDefinition);
      //Console
      result.SetItem(CustomFunctions.RunConsole.FunctionName, CustomFunctions.RunConsole.FunctionDefinition);
      //Array
      result.SetItem(CustomFunctions.ArrayFunc.FunctionName, CustomFunctions.ArrayFunc.FunctionDefinition);
      //Char
      result.SetItem(CustomFunctions.CharFunc.FunctionName, CustomFunctions.CharFunc.FunctionDefinition);
    }
Exemplo n.º 3
0
 public ScriptScopeDebugViewer(ScriptScope s)
 {
   _scope = s;
 }