Eval() 공개 메소드

public Eval ( string code ) : bool
code string
리턴 bool
예제 #1
0
    public void Update()
    {
        if (doProcess)
        {
            // Don't be executing code when we're about to reload it.  Not sure this is
            // actually needed but seems prudent to be wary of it.
            if (EditorApplication.isCompiling)
            {
                return;
            }

            helper.Init(ref isInitialized);
            doProcess = false;
            bool compiledCorrectly = helper.Eval(codeToProcess);
            if (compiledCorrectly)
            {
                resetCommand = true;
            }
            else
            {
                // Continue with what enter the user pressed...  Yes, this is an ugly
                // way to handle it.
                codeToProcess = Paste(editorState, "\n", false);
            }
        }
    }
예제 #2
0
 public void Update()
 {
     if (doProcess)
     {
         if (helper.Init(ref isInitialized))
         {
             doProcess = false;
             bool compiledCorrectly = helper.Eval(logEntries, codeToProcess);
             if (compiledCorrectly)
             {
                 resetCommand = true;
             }
             else
             {
                 // Continue with that enter the user pressed...  Yes, this is an ugly
                 // way to handle it.
                 codeToProcess = Paste(editorState, "\n", false);
             }
         }
         else
         {
             // For some reason, we weren't ready to run.
             // TODO: Make sure it's not some sort of permanent error!
         }
     }
 }