Пример #1
0
        private void btnStepClicked(object sender, EventArgs e)
        {
            try
            {
                if (Interpreter == null || Interpreter.Script != txtScriptEntry.Text)
                {
                    Interpreter = new EUOInterpreter(txtScriptEntry.Text);
                    UpdateAST();
                }


                Interpreter.Statement();
                txtDebug.Text = "Current Line: " + Interpreter.CurrentLine + " Current Statement: " + Interpreter.CurrentStatment ?? "null";
                var start = txtScriptEntry.GetFirstCharIndexFromLine(Interpreter.CurrentLine - 1);
                var end   = txtScriptEntry.GetFirstCharIndexFromLine(Interpreter.CurrentLine) - 1;

                txtScriptEntry.SelectionStart     = 0;
                txtScriptEntry.SelectionLength    = txtScriptEntry.Text.Length;
                txtScriptEntry.SelectionBackColor = SystemColors.Window;


                txtScriptEntry.SelectionStart     = start;
                txtScriptEntry.SelectionLength    = end - start;
                txtScriptEntry.SelectionBackColor = Color.Red;
                txtScriptEntry.SelectionBullet    = true;
                txtScriptEntry.SelectionLength    = 0;
            } catch (Exception ee)
            {
                txtDebug.Text = "E: " + ee.Message;
            }
        }