public bool ScriptCompile() { StatusShowLog("开始编译..."); try { _eventdisabled = true; _program = new Script.Script(); _program.Parse(textBoxScript.Text); textBoxScript.Text = _program.ToCode(); textBoxScript.Select(0, 0); return(true); } catch (ParseException ex) { _program = null; string str = $"{ex.Message}: 行{ex.Index + 1}"; SystemSounds.Hand.Play(); MessageBox.Show(str); StatusShowLog(str); ScriptSelectLine(ex.Index); return(false); } finally { _eventdisabled = false; } }
private void textBoxScript_TextChanged(object sender, EventArgs e) { if (_eventdisabled) { return; } _fileEdited = true; _program = null; }